diff options
author | Matthias Clasen <mclasen@redhat.com> | 2014-01-24 20:13:01 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2014-01-24 20:16:33 -0500 |
commit | e1d9974537269f4478c6612f03c48ee42deb40ba (patch) | |
tree | 9413a4bf9e44df39f665e833f6b9383140c30142 | |
parent | 6fd7e547c52168158f76941bed87ed24aff1ab29 (diff) | |
download | gtk+-e1d9974537269f4478c6612f03c48ee42deb40ba.tar.gz |
Drop internal uses of gtk_widget_get_root_window
This function is just a one-line convenience function that
is about to be deprecated.
-rw-r--r-- | gtk/deprecated/gtkhandlebox.c | 2 | ||||
-rw-r--r-- | gtk/gtkdnd.c | 4 | ||||
-rw-r--r-- | gtk/gtkinvisible.c | 2 | ||||
-rw-r--r-- | gtk/gtkmenu.c | 4 | ||||
-rw-r--r-- | gtk/gtkplug.c | 15 | ||||
-rw-r--r-- | gtk/gtktreeview.c | 4 | ||||
-rw-r--r-- | gtk/gtkwindow.c | 2 |
7 files changed, 19 insertions, 14 deletions
diff --git a/gtk/deprecated/gtkhandlebox.c b/gtk/deprecated/gtkhandlebox.c index 228913eb56..521bb8e0f4 100644 --- a/gtk/deprecated/gtkhandlebox.c +++ b/gtk/deprecated/gtkhandlebox.c @@ -542,7 +542,7 @@ gtk_handle_box_realize (GtkWidget *widget) | GDK_STRUCTURE_MASK); attributes.type_hint = GDK_WINDOW_TYPE_HINT_TOOLBAR; attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_TYPE_HINT; - priv->float_window = gdk_window_new (gtk_widget_get_root_window (widget), + priv->float_window = gdk_window_new (gdk_screen_get_root_window (gtk_widget_get_screen (widget)), &attributes, attributes_mask); gdk_window_set_user_data (priv->float_window, widget); gdk_window_set_decorations (priv->float_window, 0); diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c index 110def72bf..d89e34759e 100644 --- a/gtk/gtkdnd.c +++ b/gtk/gtkdnd.c @@ -4292,7 +4292,7 @@ gtk_drag_end (GtkDragSourceInfo *info, guint32 time) */ send_event = gdk_event_new (GDK_BUTTON_RELEASE); - send_event->button.window = g_object_ref (gtk_widget_get_root_window (source_widget)); + send_event->button.window = g_object_ref (gdk_screen_get_root_window (gtk_widget_get_screen (source_widget))); send_event->button.send_event = TRUE; send_event->button.time = time; send_event->button.x = 0; @@ -4440,7 +4440,7 @@ gtk_drag_key_cb (GtkWidget *widget, * to query it here. We could use XGetModifierMapping, but * that would be overkill. */ - root_window = gtk_widget_get_root_window (widget); + root_window = gdk_screen_get_root_window (gtk_widget_get_screen (widget)); gdk_window_get_device_position (root_window, pointer, NULL, NULL, &state); event->state = state; diff --git a/gtk/gtkinvisible.c b/gtk/gtkinvisible.c index 903ea02130..48e7cf32de 100644 --- a/gtk/gtkinvisible.c +++ b/gtk/gtkinvisible.c @@ -241,7 +241,7 @@ gtk_invisible_realize (GtkWidget *widget) parent = gtk_widget_get_parent_window (widget); if (parent == NULL) - parent = gtk_widget_get_root_window (widget); + parent = gdk_screen_get_root_window (gtk_widget_get_screen (widget)); attributes.x = -100; attributes.y = -100; diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c index 43dbb28ae5..22317cf990 100644 --- a/gtk/gtkmenu.c +++ b/gtk/gtkmenu.c @@ -2647,6 +2647,7 @@ menu_grab_transfer_window_get (GtkMenu *menu) { GdkWindowAttr attributes; gint attributes_mask; + GdkWindow *parent; attributes.x = -100; attributes.y = -100; @@ -2659,7 +2660,8 @@ menu_grab_transfer_window_get (GtkMenu *menu) attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_NOREDIR; - window = gdk_window_new (gtk_widget_get_root_window (GTK_WIDGET (menu)), + parent = gdk_screen_get_root_window (gtk_widget_get_screen (GTK_WIDGET (menu))); + window = gdk_window_new (parent, &attributes, attributes_mask); gtk_widget_register_window (GTK_WIDGET (menu), window); diff --git a/gtk/gtkplug.c b/gtk/gtkplug.c index 66917a3db7..276997588e 100644 --- a/gtk/gtkplug.c +++ b/gtk/gtkplug.c @@ -481,6 +481,7 @@ _gtk_plug_remove_from_socket (GtkPlug *plug, GtkPlugPrivate *priv; GtkWidget *widget; GdkWindow *window; + GdkWindow *root_window; gboolean result; gboolean widget_was_visible; @@ -499,12 +500,11 @@ _gtk_plug_remove_from_socket (GtkPlug *plug, widget_was_visible = gtk_widget_get_visible (widget); window = gtk_widget_get_window (widget); + root_window = gdk_screen_get_root_window (gtk_widget_get_screen (widget)); gdk_window_hide (window); _gtk_widget_set_in_reparent (widget, TRUE); - gdk_window_reparent (window, - gtk_widget_get_root_window (widget), - 0, 0); + gdk_window_reparent (window, root_window, 0, 0); gtk_widget_unparent (GTK_WIDGET (plug)); _gtk_widget_set_in_reparent (widget, FALSE); @@ -1048,14 +1048,17 @@ gtk_plug_realize (GtkWidget *widget) if (gtk_widget_is_toplevel (widget)) { + GdkWindow *root_window; attributes.window_type = GDK_WINDOW_TOPLEVEL; + root_window = gdk_screen_get_root_window (gtk_widget_get_screen (widget)); + gdk_error_trap_push (); if (priv->socket_window) gdk_window = gdk_window_new (priv->socket_window, &attributes, attributes_mask); else /* If it's a passive plug, we use the root window */ - gdk_window = gdk_window_new (gtk_widget_get_root_window (widget), + gdk_window = gdk_window_new (root_window, &attributes, attributes_mask); /* Because the window isn't known to the window manager, * frame sync won't work. In theory, XEMBED could be extended @@ -1072,8 +1075,8 @@ gtk_plug_realize (GtkWidget *widget) gdk_error_trap_push (); gdk_window_destroy (gdk_window); gdk_error_trap_pop_ignored (); - gdk_window = gdk_window_new (gtk_widget_get_root_window (widget), - &attributes, attributes_mask); + gdk_window = gdk_window_new (root_window, + &attributes, attributes_mask); gtk_widget_set_window (widget, gdk_window); } diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c index 58d03ae514..6aef036525 100644 --- a/gtk/gtktreeview.c +++ b/gtk/gtktreeview.c @@ -3938,7 +3938,7 @@ gtk_tree_view_motion_draw_column_motion_arrow (GtkTreeView *tree_view) attributes.y = y; attributes.width = width; attributes.height = height; - tree_view->priv->drag_highlight_window = gdk_window_new (gtk_widget_get_root_window (widget), + tree_view->priv->drag_highlight_window = gdk_window_new (gdk_screen_get_root_window (gtk_widget_get_screen (widget)), &attributes, attributes_mask); gtk_widget_register_window (GTK_WIDGET (tree_view), tree_view->priv->drag_highlight_window); @@ -4019,7 +4019,7 @@ gtk_tree_view_motion_draw_column_motion_arrow (GtkTreeView *tree_view) attributes.y = y; attributes.width = width; attributes.height = height; - tree_view->priv->drag_highlight_window = gdk_window_new (gtk_widget_get_root_window (widget), &attributes, attributes_mask); + tree_view->priv->drag_highlight_window = gdk_window_new (gdk_screen_get_root_window (gtk_widget_get_screen (widget)), &attributes, attributes_mask); gtk_widget_register_window (GTK_WIDGET (tree_view), tree_view->priv->drag_highlight_window); mask_image = cairo_image_surface_create (CAIRO_FORMAT_A1, width, height); diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index 5e2cc05aee..3d9e858a96 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -6052,7 +6052,7 @@ gtk_window_realize (GtkWidget *widget) attributes.visual = gtk_widget_get_visual (widget); attributes_mask = 0; - parent_window = gtk_widget_get_root_window (widget); + parent_window = gdk_screen_get_root_window (gtk_widget_get_screen (widget)); gtk_widget_get_allocation (widget, &allocation); attributes.width = allocation.width; |