This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project wmaker-crm.git.

The branch, next has been updated
       via  8ae05f55b3a8156270a055f1ac32bef006622e13 (commit)
      from  b486387d0e68ea8cec63eb4e2b81a11cb1cdb0bf (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://repo.or.cz/w/wmaker-crm.git/commit/8ae05f55b3a8156270a055f1ac32bef006622e13

commit 8ae05f55b3a8156270a055f1ac32bef006622e13
Author: David Maciejak <[email protected]>
Date:   Sat Sep 13 15:55:03 2014 +0800

    wmaker: improve windows listing in switchpanel
    
    This patch is updating makeWindowListArray function,
    as it crosses the whole window focused list each time
    we don't have to bother on checking previous and then next
    focused windows, so saving some cycles here.

diff --git a/src/switchpanel.c b/src/switchpanel.c
index 6ced6eb2..da0bac07 100644
--- a/src/switchpanel.c
+++ b/src/switchpanel.c
@@ -358,41 +358,22 @@ static void drawTitle(WSwitchPanel *panel, int idecks, 
const char *title)
                free(ntitle);
 }
 
-static WMArray *makeWindowListArray(WWindow *curwin, int include_unmapped, 
Bool class_only)
+static WMArray *makeWindowListArray(WScreen *scr, int include_unmapped, Bool 
class_only)
 {
        WMArray *windows = WMCreateArray(10);
-       int fl;
-       WWindow *wwin;
-
-       for (fl = 0; fl < 2; fl++) {
-               for (wwin = curwin; wwin; wwin = wwin->prev) {
-                       if (((!fl && canReceiveFocus(wwin) > 0) || (fl && 
canReceiveFocus(wwin) < 0)) &&
-                           (wwin->flags.mapped || wwin->flags.shaded || 
include_unmapped)) {
-                               if (class_only)
-                                       if (!sameWindowClass(wwin, curwin))
-                                               continue;
+       WWindow *wwin = scr->focused_window;
 
-                               if (!WFLAGP(wwin, skip_switchpanel))
-                                       WMAddToArray(windows, wwin);
-                       }
-               }
-               wwin = curwin;
-               /* start over from the beginning of the list */
-               while (wwin->next)
-                       wwin = wwin->next;
-
-               for (wwin = curwin; wwin && wwin != curwin; wwin = wwin->prev) {
-                       if (((!fl && canReceiveFocus(wwin) > 0) || (fl && 
canReceiveFocus(wwin) < 0)) &&
-                           (wwin->flags.mapped || wwin->flags.shaded || 
include_unmapped)) {
-                               if (class_only)
-                                   if (!sameWindowClass(wwin, curwin))
+       while (wwin) {
+               if ((canReceiveFocus(wwin) != 0) &&
+                   (wwin->flags.mapped || wwin->flags.shaded || 
include_unmapped)) {
+                       if (class_only)
+                               if (!sameWindowClass(scr->focused_window, wwin))
                                        continue;
-                               if (!WFLAGP(wwin, skip_switchpanel))
+                       if (!WFLAGP(wwin, skip_switchpanel))
                                WMAddToArray(windows, wwin);
-                       }
                }
+               wwin = wwin->prev;
        }
-
        return windows;
 }
 
@@ -416,7 +397,7 @@ WSwitchPanel *wInitSwitchPanel(WScreen *scr, WWindow 
*curwin, Bool class_only)
        WMRect rect = wGetRectForHead(scr, wGetHeadForPointerLocation(scr));
 
        panel->scr = scr;
-       panel->windows = makeWindowListArray(curwin, wPreferences.swtileImage 
!= NULL, class_only);
+       panel->windows = makeWindowListArray(scr, wPreferences.swtileImage != 
NULL, class_only);
        count = WMGetArrayItemCount(panel->windows);
        if (count)
                panel->flags = makeWindowFlagsArray(count);
@@ -623,7 +604,7 @@ WWindow *wSwitchPanelSelectNext(WSwitchPanel *panel, int 
back, int ignore_minimi
                        else
                                panel->current++;
 
-                       panel->current= (count + panel->current) % count;
+                       panel->current = (count + panel->current) % count;
                        wwin = WMGetFromArray(panel->windows, panel->current);
 
                        if (!class_only)

-----------------------------------------------------------------------

Summary of changes:
 src/switchpanel.c |   41 +++++++++++------------------------------
 1 files changed, 11 insertions(+), 30 deletions(-)


repo.or.cz automatic notification. Contact project admin [email protected]
if you want to unsubscribe, or site admin [email protected] if you receive
no reply.
-- 
wmaker-crm.git ("The Window Maker window manager")


-- 
To unsubscribe, send mail to [email protected].

Reply via email to