forked from AuroraMiddleware/gtk
Update size of root window after display reconfiguration
This commit is contained in:
parent
959a9437e6
commit
93530675de
@ -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 {
|
||||
|
@ -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");
|
||||
|
@ -1090,6 +1090,26 @@ _gdk_window_impl_new (GdkWindow *window,
|
||||
gdk_window_set_type_hint (window, attributes->type_hint);
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user