[gtk+] notebook: Properly hide drag window
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] notebook: Properly hide drag window
- Date: Wed, 20 Jan 2016 16:37:59 +0000 (UTC)
commit c162a0cca8c7454f8b695b71cec08160569f26ee
Author: Benjamin Otte <otte redhat com>
Date: Wed Jan 20 17:20:03 2016 +0100
notebook: Properly hide drag window
Move code to properly reinsert the tab label to where it belongs.
The if has the distinction between reparented-to-dnd-window and
just-changed-the-gdk-window-to-draw-to right there.
https://bugzilla.gnome.org/show_bug.cgi?id=760754
gtk/gtknotebook.c | 21 ++++++++++-----------
1 files changed, 10 insertions(+), 11 deletions(-)
---
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index 80e6fc9..0664a5a 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -2973,8 +2973,16 @@ hide_drag_window (GtkNotebook *notebook,
{
GtkWidget *widget = GTK_WIDGET (notebook);
- if (gtk_widget_get_window (page->tab_label) != gtk_widget_get_window (widget) ||
- !NOTEBOOK_IS_TAB_LABEL_PARENT (notebook, page))
+ if (!NOTEBOOK_IS_TAB_LABEL_PARENT (notebook, page))
+ {
+ g_object_ref (page->tab_label);
+ gtk_container_remove (GTK_CONTAINER (gtk_widget_get_parent (page->tab_label)), page->tab_label);
+ gtk_css_node_set_parent (gtk_widget_get_css_node (page->tab_label),
+ gtk_css_gadget_get_node (page->gadget));
+ gtk_widget_set_parent (page->tab_label, GTK_WIDGET (notebook));
+ g_object_unref (page->tab_label);
+ }
+ else if (gtk_widget_get_window (page->tab_label) != gtk_widget_get_window (widget))
{
gtk_widget_set_child_visible (page->tab_label, FALSE);
gtk_widget_unrealize (page->tab_label);
@@ -3034,15 +3042,6 @@ gtk_notebook_stop_reorder (GtkNotebook *notebook)
hide_drag_window (notebook, priv, page);
}
- else
- {
- g_object_ref (page->tab_label);
- gtk_container_remove (GTK_CONTAINER (gtk_widget_get_parent (page->tab_label)), page->tab_label);
- gtk_css_node_set_parent (gtk_widget_get_css_node (page->tab_label),
- gtk_css_gadget_get_node (page->gadget));
- gtk_widget_set_parent (page->tab_label, GTK_WIDGET (notebook));
- g_object_unref (page->tab_label);
- }
priv->operation = DRAG_OPERATION_NONE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]