Don't calculate the main window monitor every time it`s needed

The main monitor of a window is maintained as 'window->monitor' and is
updated when the window is resized or moved. Lets avoid calculating it
every time it`s needed.

https://bugzilla.gnome.org/show_bug.cgi?id=744934
This commit is contained in:
Jonas Ådahl
2015-04-09 12:20:24 +08:00
parent 441efd17ce
commit 14b0a83f64
5 changed files with 12 additions and 15 deletions

View File

@ -288,8 +288,7 @@ windows_on_different_monitor (MetaWindow *a,
if (a->screen != b->screen)
return TRUE;
return meta_screen_get_monitor_for_window (a->screen, a) !=
meta_screen_get_monitor_for_window (b->screen, b);
return a->monitor != b->monitor;
}
/* Get layer ignoring any transient or group relationships */