diff --git a/po/xfwm4.pot b/po/xfwm4.pot index 395a74f9ee77be40a2650bf01811d558ec28b26e..d459b3b9265c551ff997377092e18a6a2fdcb05b 100644 --- a/po/xfwm4.pot +++ b/po/xfwm4.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2004-12-13 22:44+0100\n" +"POT-Creation-Date: 2004-12-14 20:31+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" diff --git a/src/compositor.c b/src/compositor.c index dc794780b05b1c5f2a532d74b5a49230b4fb6d3e..883f9168d7ab70649ee5d2f132d543c545dc5eef 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -1490,9 +1490,9 @@ void restack_win (CWindow *cw, Window above) { ScreenInfo *screen_info = NULL; + Window previous_above = None; GList *sibling; GList *next; - GList *index; g_return_if_fail (cw != NULL); TRACE ("entering restack_win"); @@ -1500,32 +1500,46 @@ restack_win (CWindow *cw, Window above) screen_info = cw->screen_info; sibling = g_list_find (screen_info->cwindows, (gconstpointer) cw); next = g_list_next (sibling); - screen_info->cwindows = g_list_delete_link (screen_info->cwindows, sibling); - for (index = screen_info->cwindows; index; index = g_list_next (index)) + if (next) { - CWindow *cw2 = (CWindow *) index->data; - if (cw2->id == above) - { - break; - } + CWindow *ncw = (CWindow *) next; + previous_above = ncw->id; } - if (index != NULL) - { - screen_info->cwindows = g_list_insert_before (screen_info->cwindows, index, cw); - } - else if (above == None) - { - /* Insert at bottom of window stack */ - screen_info->cwindows = g_list_append (screen_info->cwindows, cw); - } - else + if (previous_above != above) { - /* Insert at top of window stack */ - g_warning ("The window 0x%lx has been placed on top of stack\n" - "because the specified sibling 0x%lx was not found in our stack", cw->id, above); - screen_info->cwindows = g_list_prepend (screen_info->cwindows, cw); + GList *index; + + for (index = screen_info->cwindows; index; index = g_list_next (index)) + { + CWindow *cw2 = (CWindow *) index->data; + if (cw2->id == above) + { + break; + } + } + + if (index != NULL) + { + screen_info->cwindows = g_list_delete_link (screen_info->cwindows, sibling); + screen_info->cwindows = g_list_insert_before (screen_info->cwindows, index, cw); + } + else if (above == None) + { + /* Insert at bottom of window stack */ + screen_info->cwindows = g_list_delete_link (screen_info->cwindows, sibling); + screen_info->cwindows = g_list_append (screen_info->cwindows, cw); + } +#ifdef DEBUG + else + { + /* Don't know what to do */ + g_warning ("The window 0x%lx has not been restacked\n" + "because the specified sibling 0x%lx was\n" + "not found in our stack", cw->id, above); + } +#endif } } @@ -1839,8 +1853,6 @@ compositorHandleCirculateNotify (DisplayInfo *display_info, XCirculateEvent *ev) static void compositorHandleCreateNotify (DisplayInfo *display_info, XCreateWindowEvent *ev) { - CWindow *cw; - g_return_if_fail (display_info != NULL); g_return_if_fail (ev != NULL); TRACE ("entering compositorHandleCreateNotify for 0x%lx", ev->window);