[mutter] Track the monitor for each window
- From: Alexander Larsson <alexl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] Track the monitor for each window
- Date: Thu, 17 Mar 2011 12:54:40 +0000 (UTC)
commit 44cfceba00d6cc8532cef7b9a8f3e3acef0ca5ca
Author: Alexander Larsson <alexl redhat com>
Date: Fri Feb 25 16:37:05 2011 +0100
Track the monitor for each window
https://bugzilla.gnome.org/show_bug.cgi?id=609258
src/core/screen.c | 17 ++++++++++++++++-
src/core/window-private.h | 2 ++
src/core/window.c | 12 ++++++++++++
3 files changed, 30 insertions(+), 1 deletions(-)
---
diff --git a/src/core/screen.c b/src/core/screen.c
index 252c3e3..8affdd0 100644
--- a/src/core/screen.c
+++ b/src/core/screen.c
@@ -2816,7 +2816,9 @@ void
meta_screen_resize (MetaScreen *screen,
int width,
int height)
-{
+{
+ GSList *windows, *tmp;
+
screen->rect.width = width;
screen->rect.height = height;
@@ -2830,6 +2832,19 @@ meta_screen_resize (MetaScreen *screen,
/* Queue a resize on all the windows */
meta_screen_foreach_window (screen, meta_screen_resize_func, 0);
+ /* Fix up monitor for all windows on this screen */
+ windows = meta_display_list_windows (screen->display,
+ META_LIST_INCLUDE_OVERRIDE_REDIRECT);
+ for (tmp = windows; tmp != NULL; tmp = tmp->next)
+ {
+ MetaWindow *window = tmp->data;
+
+ if (window->screen == screen)
+ meta_window_update_monitor (window);
+ }
+
+ g_slist_free (windows);
+
g_signal_emit (screen, screen_signals[MONITORS_CHANGED], 0, index);
}
diff --git a/src/core/window-private.h b/src/core/window-private.h
index e75f13a..5fe10d8 100644
--- a/src/core/window-private.h
+++ b/src/core/window-private.h
@@ -67,6 +67,7 @@ struct _MetaWindow
MetaDisplay *display;
MetaScreen *screen;
+ const MetaMonitorInfo *monitor;
MetaWorkspace *workspace;
Window xwindow;
/* may be NULL! not all windows get decorated */
@@ -625,5 +626,6 @@ void meta_window_update_icon_now (MetaWindow *window);
void meta_window_update_role (MetaWindow *window);
void meta_window_update_net_wm_type (MetaWindow *window);
+void meta_window_update_monitor (MetaWindow *window);
#endif
diff --git a/src/core/window.c b/src/core/window.c
index 7f7abdf..1bf4799 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -880,6 +880,8 @@ meta_window_new_with_attrs (MetaDisplay *display,
window->compositor_private = NULL;
+ window->monitor = meta_screen_get_monitor_for_window (window->screen, window);
+
if (window->override_redirect)
{
window->decorated = FALSE;
@@ -3993,6 +3995,12 @@ move_attached_dialog (MetaWindow *window,
return FALSE;
}
+void
+meta_window_update_monitor (MetaWindow *window)
+{
+ window->monitor = meta_screen_get_monitor_for_window (window->screen, window);
+}
+
static void
meta_window_move_resize_internal (MetaWindow *window,
MetaMoveResizeFlags flags,
@@ -4444,6 +4452,8 @@ meta_window_move_resize_internal (MetaWindow *window,
meta_window_refresh_resize_popup (window);
+ meta_window_update_monitor (window);
+
/* Invariants leaving this function are:
* a) window->rect and frame->rect reflect the actual
* server-side size/pos of window->xwindow and frame->xwindow
@@ -4659,6 +4669,8 @@ meta_window_configure_notify (MetaWindow *window,
window->rect.y = event->y;
window->rect.width = event->width;
window->rect.height = event->height;
+ meta_window_update_monitor (window);
+
if (!event->override_redirect && !event->send_event)
meta_warning ("Unhandled change of windows override redirect status\n");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]