From caf43a123f40d3a68599ac5453a79759b828e8f0 Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Sun, 3 Dec 2006 20:05:23 +0000 Subject: [PATCH] Fix http://bugzilla.gnome.org/show_bug.cgi?id=381127: 2006-12-03 Federico Mena Quintero Fix http://bugzilla.gnome.org/show_bug.cgi?id=381127: * src/window.c (idle_calc_showing): Grab the server while the windows are being shuffled. First show the windows to be shown, and then hide the windows to be hidden, in order to minimize the number of expose events. --- ChangeLog | 9 +++++++++ src/window.c | 31 +++++++++++++++++++------------ 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 45db5211e..3d9bab487 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2006-12-03 Federico Mena Quintero + + Fix http://bugzilla.gnome.org/show_bug.cgi?id=381127: + + * src/window.c (idle_calc_showing): Grab the server while the + windows are being shuffled. First show the windows to be shown, + and then hide the windows to be hidden, in order to minimize + the number of expose events. + 2006-11-15 Bruno Boaventura 2006-11-15 Björn Lindqvist diff --git a/src/window.c b/src/window.c index b7a13b29c..0e6399693 100644 --- a/src/window.c +++ b/src/window.c @@ -1457,6 +1457,7 @@ idle_calc_showing (gpointer data) GSList *should_hide; GSList *unplaced; GSList *displays; + MetaWindow *first_window; meta_topic (META_DEBUG_WINDOW_STATE, "Clearing the calc_showing queue\n"); @@ -1505,6 +1506,10 @@ idle_calc_showing (gpointer data) /* top to bottom */ should_show = g_slist_sort (should_show, stackcmp); should_show = g_slist_reverse (should_show); + + first_window = copy->data; + + meta_display_grab (first_window->display); tmp = unplaced; while (tmp != NULL) @@ -1518,18 +1523,6 @@ idle_calc_showing (gpointer data) tmp = tmp->next; } - tmp = should_hide; - while (tmp != NULL) - { - MetaWindow *window; - - window = tmp->data; - - implement_showing (window, FALSE); - - tmp = tmp->next; - } - tmp = should_show; while (tmp != NULL) { @@ -1542,6 +1535,18 @@ idle_calc_showing (gpointer data) tmp = tmp->next; } + tmp = should_hide; + while (tmp != NULL) + { + MetaWindow *window; + + window = tmp->data; + + implement_showing (window, FALSE); + + tmp = tmp->next; + } + tmp = copy; while (tmp != NULL) { @@ -1578,6 +1583,8 @@ idle_calc_showing (gpointer data) } } + meta_display_ungrab (first_window->display); + g_slist_free (copy); g_slist_free (unplaced);