Commit e1d99745 authored by Matthias Clasen's avatar Matthias Clasen

Drop internal uses of gtk_widget_get_root_window

This function is just a one-line convenience function that
is about to be deprecated.
parent 6fd7e547
......@@ -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);
......
......@@ -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;
......
......@@ -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;
......
......@@ -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);
......
......@@ -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);
}
......
......@@ -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);
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment