From cb549154aa1ddff177014899e77c5211933fc5fc Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Tue, 18 Mar 2014 10:36:00 -0400 Subject: [PATCH] window: Move meta_window_configure_notify to window-x11 --- src/core/display.c | 2 +- src/core/window-private.h | 2 ++ src/core/window-x11.c | 34 ++++++++++++++++++++++++++++++++++ src/core/window-x11.h | 3 +++ src/core/window.c | 38 +------------------------------------- src/meta/window.h | 1 - 6 files changed, 41 insertions(+), 39 deletions(-) diff --git a/src/core/display.c b/src/core/display.c index 576bf3813..08df05102 100644 --- a/src/core/display.c +++ b/src/core/display.c @@ -2676,7 +2676,7 @@ handle_other_xevent (MetaDisplay *display, } if (window && window->override_redirect) - meta_window_configure_notify (window, &event->xconfigure); + meta_window_x11_configure_notify (window, &event->xconfigure); break; case ConfigureRequest: diff --git a/src/core/window-private.h b/src/core/window-private.h index 1f2166454..2beb8cd0f 100644 --- a/src/core/window-private.h +++ b/src/core/window-private.h @@ -746,4 +746,6 @@ void meta_window_activate_full (MetaWindow *window, gboolean meta_window_is_client_decorated (MetaWindow *window); +void meta_window_update_monitor (MetaWindow *window); + #endif diff --git a/src/core/window-x11.c b/src/core/window-x11.c index a27a16a1f..5787cb685 100644 --- a/src/core/window-x11.c +++ b/src/core/window-x11.c @@ -1617,3 +1617,37 @@ meta_window_x11_recalc_window_type (MetaWindow *window) type, window->desc, type); meta_window_set_type (window, type); } + +/** + * meta_window_x11_configure_notify: (skip) + * @window: a #MetaWindow + * @event: a #XConfigureEvent + * + * This is used to notify us of an unrequested configuration + * (only applicable to override redirect windows) + */ +void +meta_window_x11_configure_notify (MetaWindow *window, + XConfigureEvent *event) +{ + g_assert (window->override_redirect); + g_assert (window->frame == NULL); + + window->rect.x = event->x; + window->rect.y = event->y; + window->rect.width = event->width; + window->rect.height = event->height; + meta_window_update_monitor (window); + + /* Whether an override-redirect window is considered fullscreen depends + * on its geometry. + */ + if (window->override_redirect) + meta_screen_queue_check_fullscreen (window->screen); + + if (!event->override_redirect && !event->send_event) + meta_warning ("Unhandled change of windows override redirect status\n"); + + if (window->display->compositor) + meta_compositor_sync_window_geometry (window->display->compositor, window, FALSE); +} diff --git a/src/core/window-x11.h b/src/core/window-x11.h index d8f2ce2db..81debec6c 100644 --- a/src/core/window-x11.h +++ b/src/core/window-x11.h @@ -44,4 +44,7 @@ gboolean meta_window_x11_property_notify (MetaWindow *window, gboolean meta_window_x11_client_message (MetaWindow *window, XEvent *event); +void meta_window_x11_configure_notify (MetaWindow *window, + XConfigureEvent *event); + #endif diff --git a/src/core/window.c b/src/core/window.c index a9d6e1221..729872f61 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -132,8 +132,6 @@ static void meta_window_move_between_rects (MetaWindow *window, static void unmaximize_window_before_freeing (MetaWindow *window); static void unminimize_window_and_all_transient_parents (MetaWindow *window); -static void meta_window_update_monitor (MetaWindow *window); - /* Idle handlers for the three queues (run with meta_later_add()). The * "data" parameter in each case will be a GINT_TO_POINTER of the * index into the queue arrays to use. @@ -4399,7 +4397,7 @@ meta_window_update_for_monitors_changed (MetaWindow *window) &new->rect); } -static void +void meta_window_update_monitor (MetaWindow *window) { const MetaMonitorInfo *old; @@ -5325,40 +5323,6 @@ idle_move_resize (gpointer data) return FALSE; } -/** - * meta_window_configure_notify: (skip) - * @window: a #MetaWindow - * @event: a #XConfigureEvent - * - * This is used to notify us of an unrequested configuration - * (only applicable to override redirect windows) - */ -void -meta_window_configure_notify (MetaWindow *window, - XConfigureEvent *event) -{ - g_assert (window->override_redirect); - g_assert (window->frame == NULL); - - window->rect.x = event->x; - window->rect.y = event->y; - window->rect.width = event->width; - window->rect.height = event->height; - meta_window_update_monitor (window); - - /* Whether an override-redirect window is considered fullscreen depends - * on its geometry. - */ - if (window->override_redirect) - meta_screen_queue_check_fullscreen (window->screen); - - if (!event->override_redirect && !event->send_event) - meta_warning ("Unhandled change of windows override redirect status\n"); - - if (window->display->compositor) - meta_compositor_sync_window_geometry (window->display->compositor, window, FALSE); -} - void meta_window_get_position (MetaWindow *window, int *x, diff --git a/src/meta/window.h b/src/meta/window.h index 378b5d82f..09c82f9c1 100644 --- a/src/meta/window.h +++ b/src/meta/window.h @@ -165,7 +165,6 @@ void meta_window_change_workspace (MetaWindow *window, MetaWorkspace *workspace); GObject *meta_window_get_compositor_private (MetaWindow *window); void meta_window_set_compositor_private (MetaWindow *window, GObject *priv); -void meta_window_configure_notify (MetaWindow *window, XConfigureEvent *event); const char *meta_window_get_role (MetaWindow *window); MetaStackLayer meta_window_get_layer (MetaWindow *window); MetaWindow* meta_window_find_root_ancestor (MetaWindow *window);