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  bf2f9421388a56f804b7912de137fb12d062f106 (commit)
       via  914d4e06effcc78df4ffcf92175d51e4af45ff75 (commit)
      from  eae7ef6c596f0a8db8000d4590e367b88ba9dbbb (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/bf2f9421388a56f804b7912de137fb12d062f106

commit bf2f9421388a56f804b7912de137fb12d062f106
Author: Rodolfo García Peñas (kix) <k...@kix.es>
Date:   Thu Nov 22 22:40:12 2012 +0100

    Avoid crash on icon move without command
    
    This patch avoid a crash when moving an icon without command.
    To reproduce the problem:
    
    1. Launch an application, for example xeyes, with appicon.
    2. Move the appicon to the clip.
    3. Close the application.
    4. Edit the appicon in the clip, and empty the commands fields.
    5. Move the appicon from the clip to the dock. -> Crash.
    
    The crash happends because icon->icon->owner is NULL and then
    wwin will be NULL. Then the call of wwin->client_win will crash.
    
    This patch checks if icon->icon->owner is not null (application is
    running) and then assign it to wwin. Then get the command from the
    running application.

diff --git a/src/dock.c b/src/dock.c
index 6e2e0e3..21d6aee 100644
--- a/src/dock.c
+++ b/src/dock.c
@@ -1855,18 +1855,21 @@ Bool wDockAttachIcon(WDock *dock, WAppIcon *icon, int 
x, int y, Bool update_icon
 {
        WWindow *wwin;
        Bool lupdate_icon = False;
+       char *command = NULL;
        int index;
 
-       wwin = icon->icon->owner;
        icon->editing = 0;
 
        if (update_icon)
                lupdate_icon = True;
 
        if (icon->command == NULL) {
-               char *command;
+               /* If icon->owner exists, it means the application is running */
+               if (icon->icon->owner) {
+                       wwin = icon->icon->owner;
+                       command = GetCommandForWindow(wwin->client_win);
+               }
 
-               command = GetCommandForWindow(wwin->client_win);
                if (command) {
                        icon->command = command;
                } else {
@@ -1986,7 +1989,7 @@ static void reattachIcon(WDock *dock, WAppIcon *icon, int 
x, int y)
 static Bool moveIconBetweenDocks(WDock *src, WDock *dest, WAppIcon *icon, int 
x, int y)
 {
        WWindow *wwin;
-       char *command;
+       char *command = NULL;
        int index;
        Bool update_icon = False;
 
@@ -1996,8 +1999,6 @@ static Bool moveIconBetweenDocks(WDock *src, WDock *dest, 
WAppIcon *icon, int x,
        if (dest == NULL)
                return False;
 
-       wwin = icon->icon->owner;
-
        /*
         * For the moment we can't do this if we move icons in Clip from one
         * workspace to other, because if we move two or more icons without
@@ -2005,7 +2006,12 @@ static Bool moveIconBetweenDocks(WDock *src, WDock 
*dest, WAppIcon *icon, int x,
         * moved icons it applies. -Dan
         */
        if ((dest->type == WM_DOCK /*|| dest->keep_attracted */ ) && 
icon->command == NULL) {
-               command = GetCommandForWindow(wwin->client_win);
+               /* If icon->owner exists, it means the application is running */
+               if (icon->icon->owner) {
+                       wwin = icon->icon->owner;
+                       command = GetCommandForWindow(wwin->client_win);
+               }
+
                if (command) {
                        icon->command = command;
                } else {

http://repo.or.cz/w/wmaker-crm.git/commit/914d4e06effcc78df4ffcf92175d51e4af45ff75

commit 914d4e06effcc78df4ffcf92175d51e4af45ff75
Author: Martin Frydl <mfr...@gmail.com>
Date:   Tue Nov 27 11:13:34 2012 +0100

    Added option to ignore minimized windows during cycling.
    
    Added CycleIgnoreMinimized configuration option settable on Expert page in 
WPrefs.
    When option is set, switch panel cycling ignores minimized (grayed) 
windows. They
    are still visible and can be selected using left/right arrows or mouse 
click.

diff --git a/WPrefs.app/Expert.c b/WPrefs.app/Expert.c
index c6ecefd..d82bc6f 100644
--- a/WPrefs.app/Expert.c
+++ b/WPrefs.app/Expert.c
@@ -62,6 +62,9 @@ static const struct {
        { N_("Cycle windows only on the active head."),
          /* default: */ False, OPTION_WMAKER, "CycleActiveHeadOnly" },
 
+       { N_("Ignore minimized windows when cycling."),
+         /* default: */ False, OPTION_WMAKER, "CycleIgnoreMinimized" },
+
        { N_("Show workspace title on Clip."),
          /* default: */ True, OPTION_WMAKER, "ShowClipTitle" },
 
diff --git a/src/WindowMaker.h b/src/WindowMaker.h
index afc2871..ee6dbf9 100644
--- a/src/WindowMaker.h
+++ b/src/WindowMaker.h
@@ -427,6 +427,7 @@ typedef struct WPreferences {
     char single_click;                  /* single click to lauch applications 
*/
     int history_lines;                  /* history of "Run..." dialog */
     char cycle_active_head_only;        /* Cycle only windows on the active 
head */
+    char cycle_ignore_minimized;        /* Ignore minimized windows when 
cycling */
 
     RImage *swtileImage;
     RImage *swbackImage[9];
diff --git a/src/cycling.c b/src/cycling.c
index 0b0dc7c..b2c7726 100644
--- a/src/cycling.c
+++ b/src/cycling.c
@@ -123,7 +123,7 @@ void StartWindozeCycle(WWindow * wwin, XEvent * event, Bool 
next, Bool class_onl
        if (swpanel) {
 
                if (wwin->flags.mapped)
-                       newFocused = wSwitchPanelSelectNext(swpanel, !next);
+                       newFocused = wSwitchPanelSelectNext(swpanel, !next, 
True);
                else
                        newFocused = wSwitchPanelSelectFirst(swpanel, False);
 
@@ -157,7 +157,7 @@ void StartWindozeCycle(WWindow * wwin, XEvent * event, Bool 
next, Bool class_onl
                            && wKeyBindings[WKBD_GROUPNEXT].modifier == 
modifiers)
                            || ev.xkey.keycode == rightKey) {
 
-                               newFocused = wSwitchPanelSelectNext(swpanel, 
False);
+                               newFocused = wSwitchPanelSelectNext(swpanel, 
False, ev.xkey.keycode != rightKey);
                                oldFocused = change_focus_and_raise(newFocused, 
oldFocused, swpanel, scr, False);
 
                        } else if ((wKeyBindings[WKBD_FOCUSPREV].keycode == 
ev.xkey.keycode
@@ -166,7 +166,7 @@ void StartWindozeCycle(WWindow * wwin, XEvent * event, Bool 
next, Bool class_onl
                            && wKeyBindings[WKBD_GROUPPREV].modifier == 
modifiers)
                                   || ev.xkey.keycode == leftKey) {
 
-                               newFocused = wSwitchPanelSelectNext(swpanel, 
True);
+                               newFocused = wSwitchPanelSelectNext(swpanel, 
True, ev.xkey.keycode != leftKey);
                                oldFocused = change_focus_and_raise(newFocused, 
oldFocused, swpanel, scr, False);
 
                        } else if (ev.xkey.keycode == homeKey || 
ev.xkey.keycode == endKey) {
diff --git a/src/defaults.c b/src/defaults.c
index e8c33e0..8453070 100644
--- a/src/defaults.c
+++ b/src/defaults.c
@@ -684,7 +684,9 @@ WDefaultEntry optionList[] = {
        {"DialogHistoryLines", "500", NULL,
            &wPreferences.history_lines, getInt, NULL, NULL, NULL},
        {"CycleActiveHeadOnly", "NO", NULL,
-           &wPreferences.cycle_active_head_only, getBool, NULL, NULL, NULL}
+           &wPreferences.cycle_active_head_only, getBool, NULL, NULL, NULL},
+       {"CycleIgnoreMinimized", "NO", NULL,
+           &wPreferences.cycle_ignore_minimized, getBool, NULL, NULL, NULL}
 };
 
 static void initDefaults()
diff --git a/src/switchpanel.c b/src/switchpanel.c
index ca2994c..fcd61fa 100644
--- a/src/switchpanel.c
+++ b/src/switchpanel.c
@@ -559,10 +559,11 @@ void wSwitchPanelDestroy(WSwitchPanel *panel)
        wfree(panel);
 }
 
-WWindow *wSwitchPanelSelectNext(WSwitchPanel *panel, int back)
+WWindow *wSwitchPanelSelectNext(WSwitchPanel *panel, int back, int 
ignore_minimized)
 {
        WWindow *wwin;
        int count = WMGetArrayItemCount(panel->windows);
+       int orig = panel->current;
 
        if (count == 0)
                return NULL;
@@ -570,26 +571,26 @@ WWindow *wSwitchPanelSelectNext(WSwitchPanel *panel, int 
back)
        if (panel->win)
                changeImage(panel, panel->current, 0);
 
-       if (back)
-               panel->current--;
-       else
-               panel->current++;
+       if (!wPreferences.cycle_ignore_minimized)
+               ignore_minimized = False;
 
-       wwin = WMGetFromArray(panel->windows, (count + panel->current) % count);
+       if (ignore_minimized && canReceiveFocus(WMGetFromArray(panel->windows, 
(count + panel->current) % count)) < 0)
+               ignore_minimized = False;
 
-       if (back) {
-               if (panel->current < 0)
-                       scrollIcons(panel, count);
-               else if (panel->current < panel->firstVisible)
-                       scrollIcons(panel, -1);
-       } else {
-               if (panel->current >= count)
-                       scrollIcons(panel, -count);
-               else if (panel->current - panel->firstVisible >= 
panel->visibleCount)
-                       scrollIcons(panel, 1);
-       }
+       do {
+               if (back)
+                       panel->current--;
+               else
+                       panel->current++;
+
+               panel->current= (count + panel->current) % count;
+               wwin = WMGetFromArray(panel->windows, panel->current);
+       } while (ignore_minimized && panel->current != orig && 
canReceiveFocus(wwin) < 0);
 
-       panel->current = (count + panel->current) % count;
+       if (panel->current < panel->firstVisible)
+               scrollIcons(panel, panel->current - panel->firstVisible);
+       else if (panel->current - panel->firstVisible >= panel->visibleCount)
+               scrollIcons(panel, panel->current - panel->firstVisible - 
panel->visibleCount + 1);
 
        if (panel->win) {
                drawTitle(panel, panel->current, wwin->frame->title);
diff --git a/src/switchpanel.h b/src/switchpanel.h
index 73efa63..041d222 100644
--- a/src/switchpanel.h
+++ b/src/switchpanel.h
@@ -27,7 +27,7 @@ WSwitchPanel *wInitSwitchPanel(WScreen *scr, WWindow *curwin, 
Bool class_only);
 
 void wSwitchPanelDestroy(WSwitchPanel *panel);
 
-WWindow *wSwitchPanelSelectNext(WSwitchPanel *panel, int back);
+WWindow *wSwitchPanelSelectNext(WSwitchPanel *panel, int back, int 
ignore_minimized);
 WWindow *wSwitchPanelSelectFirst(WSwitchPanel *panel, int back);
 
 WWindow *wSwitchPanelHandleEvent(WSwitchPanel *panel, XEvent *event);

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

Summary of changes:
 WPrefs.app/Expert.c |    3 +++
 src/WindowMaker.h   |    1 +
 src/cycling.c       |    6 +++---
 src/defaults.c      |    4 +++-
 src/dock.c          |   20 +++++++++++++-------
 src/switchpanel.c   |   37 +++++++++++++++++++------------------
 src/switchpanel.h   |    2 +-
 7 files changed, 43 insertions(+), 30 deletions(-)


repo.or.cz automatic notification. Contact project admin crma...@gmail.com
if you want to unsubscribe, or site admin ad...@repo.or.cz if you receive
no reply.
-- 
wmaker-crm.git ("The Window Maker window manager")


-- 
To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.

Reply via email to