[gtk+] Assign the size of the screen to the root window



commit d797dcc4dd3454d768743702c7094f549bc34315
Author: Kristian Rietveld <kris gtk org>
Date:   Tue Sep 15 11:04:50 2009 +0200

    Assign the size of the screen to the root window
    
    On startup, the root window got assigned the size of the main screen.
    But, the GdkScreen has the width of all screens/monitors connected to the
    machine.  Change this so that in _gdk_windowing_window_init, we assign
    the width/height of all monitors to the root window width, height.
    Should fix bug 594738.

 gdk/quartz/gdkwindow-quartz.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/gdk/quartz/gdkwindow-quartz.c b/gdk/quartz/gdkwindow-quartz.c
index 6b8373b..a7aaf91 100644
--- a/gdk/quartz/gdkwindow-quartz.c
+++ b/gdk/quartz/gdkwindow-quartz.c
@@ -955,16 +955,20 @@ _gdk_windowing_window_init (void)
   private->impl = g_object_new (_gdk_window_impl_get_type (), NULL);
   private->impl_window = private;
 
-  /* Note: This needs to be reworked for multi-screen support. */
   impl = GDK_WINDOW_IMPL_QUARTZ (GDK_WINDOW_OBJECT (_gdk_root)->impl);
-  rect = [[NSScreen mainScreen] frame];
 
+  /* The size of the root window should be the same as the size of
+   * the screen it belongs to.
+   *
+   * FIXME: Of course this needs to be updated when you change the monitor
+   * configuration (add another one, remove one, etc).
+   */
   private->x = 0;
   private->y = 0;
   private->abs_x = 0;
   private->abs_y = 0;
-  private->width = rect.size.width;
-  private->height = rect.size.height;
+  private->width = gdk_screen_get_width (_gdk_screen);
+  private->height = gdk_screen_get_height (_gdk_screen);
 
   private->state = 0; /* We don't want GDK_WINDOW_STATE_WITHDRAWN here */
   private->window_type = GDK_WINDOW_ROOT;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]