Commit 44cfceba authored by Alexander Larsson's avatar Alexander Larsson
Browse files

Track the monitor for each window

https://bugzilla.gnome.org/show_bug.cgi?id=609258
parent 349fb7c2
......@@ -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);
}
......
......@@ -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
......@@ -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");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment