diff options
author | Benjamin Otte <otte@redhat.com> | 2016-11-04 00:33:13 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2016-11-04 00:33:13 +0100 |
commit | 4b88b81e67081ffe039573123cf8dd0507e929b7 (patch) | |
tree | f2cffad329d9f86e907b515cf1eb4f9188b71583 /gdk/x11 | |
parent | 7c474c689a754ad40e7e3367271ae068eff9ebb0 (diff) | |
download | gtk+-4b88b81e67081ffe039573123cf8dd0507e929b7.tar.gz |
x11: Init no-multihead monitor without root window
Previous code gave warnings because the root window wasn't initialized
yet.
Diffstat (limited to 'gdk/x11')
-rw-r--r-- | gdk/x11/gdkscreen-x11.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/gdk/x11/gdkscreen-x11.c b/gdk/x11/gdkscreen-x11.c index 6a06b62c1d..5011155f66 100644 --- a/gdk/x11/gdkscreen-x11.c +++ b/gdk/x11/gdkscreen-x11.c @@ -702,13 +702,11 @@ init_no_multihead (GdkScreen *screen, gboolean *changed) GdkX11Screen *x11_screen = GDK_X11_SCREEN (screen); GdkX11Display *x11_display = GDK_X11_DISPLAY (x11_screen->display); GdkX11Monitor *monitor; - GdkWindow *root_window; GdkRectangle geometry; int width_mm, height_mm; + int width, height; int i; - root_window = gdk_screen_get_root_window (screen); - for (i = 0; i < x11_display->monitors->len; i++) { GdkX11Monitor *monitor = x11_display->monitors->pdata[i]; @@ -731,20 +729,20 @@ init_no_multihead (GdkScreen *screen, gboolean *changed) width_mm = WidthMMOfScreen (x11_screen->xscreen); height_mm = HeightMMOfScreen (x11_screen->xscreen); + width = WidthOfScreen (x11_screen->xscreen); + height = HeightOfScreen (x11_screen->xscreen); gdk_monitor_get_geometry (GDK_MONITOR (monitor), &geometry); if (0 != geometry.x || 0 != geometry.y || - gdk_window_get_width (root_window) != geometry.width || - gdk_window_get_height (root_window) != geometry.height || + width != geometry.width || + height != geometry.height || width_mm != gdk_monitor_get_width_mm (GDK_MONITOR (monitor)) || height_mm != gdk_monitor_get_height_mm (GDK_MONITOR (monitor))) *changed = TRUE; gdk_monitor_set_position (GDK_MONITOR (monitor), 0, 0); - gdk_monitor_set_size (GDK_MONITOR (monitor), - gdk_window_get_width (root_window), - gdk_window_get_height (root_window)); + gdk_monitor_set_size (GDK_MONITOR (monitor), width, height); g_object_notify (G_OBJECT (monitor), "workarea"); gdk_monitor_set_physical_size (GDK_MONITOR (monitor), width_mm, height_mm); gdk_monitor_set_scale_factor (GDK_MONITOR (monitor), x11_screen->window_scale); |