diff options
author | Kristian Rietveld <kris@gtk.org> | 2009-10-26 08:53:20 +0100 |
---|---|---|
committer | Kristian Rietveld <kris@gtk.org> | 2009-10-26 09:52:54 +0100 |
commit | 93530675de5e2d287bc27d0c6d691bbcbedef5e7 (patch) | |
tree | 85a0061c6b8d9a979b3bade3c4130ed4d714fb85 | |
parent | 959a9437e61b803ba9234d7a4e71a96910dbbc69 (diff) | |
download | gtk+-93530675de5e2d287bc27d0c6d691bbcbedef5e7.tar.gz |
Update size of root window after display reconfiguration
-rw-r--r-- | gdk/quartz/gdkprivate-quartz.h | 11 | ||||
-rw-r--r-- | gdk/quartz/gdkscreen-quartz.c | 2 | ||||
-rw-r--r-- | gdk/quartz/gdkwindow-quartz.c | 33 |
3 files changed, 29 insertions, 17 deletions
diff --git a/gdk/quartz/gdkprivate-quartz.h b/gdk/quartz/gdkprivate-quartz.h index 258d1f8c70..dadec3f549 100644 --- a/gdk/quartz/gdkprivate-quartz.h +++ b/gdk/quartz/gdkprivate-quartz.h @@ -105,11 +105,12 @@ extern GdkDragContext *_gdk_quartz_drag_source_context; #define GDK_WINDOW_IS_QUARTZ(win) (GDK_IS_WINDOW_IMPL_QUARTZ (((GdkWindowObject *)win)->impl)) /* Initialization */ -void _gdk_windowing_window_init (void); -void _gdk_events_init (void); -void _gdk_visual_init (void); -void _gdk_input_init (void); -void _gdk_quartz_event_loop_init (void); +void _gdk_windowing_update_root_window_size (GdkScreen *screen); +void _gdk_windowing_window_init (void); +void _gdk_events_init (void); +void _gdk_visual_init (void); +void _gdk_input_init (void); +void _gdk_quartz_event_loop_init (void); /* GC */ typedef enum { diff --git a/gdk/quartz/gdkscreen-quartz.c b/gdk/quartz/gdkscreen-quartz.c index 54577eda7e..5c3db27586 100644 --- a/gdk/quartz/gdkscreen-quartz.c +++ b/gdk/quartz/gdkscreen-quartz.c @@ -177,6 +177,8 @@ process_display_reconfiguration (GdkScreenQuartz *screen) gdk_screen_quartz_calculate_layout (GDK_SCREEN_QUARTZ (screen)); + _gdk_windowing_update_root_window_size (GDK_SCREEN (screen)); + if (screen->emit_monitors_changed) { g_signal_emit_by_name (screen, "monitors-changed"); diff --git a/gdk/quartz/gdkwindow-quartz.c b/gdk/quartz/gdkwindow-quartz.c index f60cc79779..cda36154ce 100644 --- a/gdk/quartz/gdkwindow-quartz.c +++ b/gdk/quartz/gdkwindow-quartz.c @@ -1091,6 +1091,26 @@ _gdk_window_impl_new (GdkWindow *window, } void +_gdk_windowing_update_root_window_size (GdkScreen *screen) +{ + GdkWindowObject *private = (GdkWindowObject *)_gdk_root; + + /* The size of the root window is so that it can contain all + * monitors attached to this machine. The monitors are laid out + * within this root window. We calculate the size of the root window + * and the positions of the different monitors in gdkscreen-quartz.c. + * + * This data is updated when the monitor configuration is changed. + */ + private->x = 0; + private->y = 0; + private->abs_x = 0; + private->abs_y = 0; + private->width = gdk_screen_get_width (screen); + private->height = gdk_screen_get_height (screen); +} + +void _gdk_windowing_window_init (void) { GdkWindowObject *private; @@ -1107,18 +1127,7 @@ _gdk_windowing_window_init (void) impl = GDK_WINDOW_IMPL_QUARTZ (GDK_WINDOW_OBJECT (_gdk_root)->impl); - /* 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 = gdk_screen_get_width (_gdk_screen); - private->height = gdk_screen_get_height (_gdk_screen); + _gdk_windowing_update_root_window_size (_gdk_screen); private->state = 0; /* We don't want GDK_WINDOW_STATE_WITHDRAWN here */ private->window_type = GDK_WINDOW_ROOT; |