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

@@ -3186,7 +3186,7 @@ handle_move_to_monitor (MetaDisplay *display,
gint which = binding->handler->data;
const MetaMonitorInfo *current, *new;
current = meta_screen_get_monitor_for_window (screen, window);
current = window->monitor;
new = meta_screen_get_monitor_neighbor (screen, current->number, which);
if (new == NULL)