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  a7fbc167175d76db7ebc97ca3028228370b52fa4 (commit)
       via  072b3569111d3f77ca4b1fafbac29d74cddcef21 (commit)
       via  a96c5c7f08f4df47a4a74fdd3599da316beb2699 (commit)
       via  99465f87fb2e1454aa239b711a14bcb4f7c9c5c1 (commit)
       via  6c5fc1f6505531f71b7d2c1c4105700b2799279a (commit)
      from  601f42c64141cd58cd1f5987fa9464ebb4f68313 (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/a7fbc167175d76db7ebc97ca3028228370b52fa4

commit a7fbc167175d76db7ebc97ca3028228370b52fa4
Author: David Maciejak <[email protected]>
Date:   Thu Sep 11 07:38:10 2014 +0700

    WPrefs: add new mouse actions configuration
    
    This patch is adding GUI configuration for new mouse actions:
    -Previous Workspace
    -Next Workspace
    -Previous Window
    -Next Window
    -Switch Windows

diff --git a/WPrefs.app/MouseSettings.c b/WPrefs.app/MouseSettings.c
index 749feeee..0ef5f35c 100644
--- a/WPrefs.app/MouseSettings.c
+++ b/WPrefs.app/MouseSettings.c
@@ -93,9 +93,9 @@ typedef struct _Panel {
 
 static char *modifierNames[8];
 
-static char *buttonActions[4];
+static char *buttonActions[8];
 
-static char *wheelActions[2];
+static char *wheelActions[3];
 
 #define DELAY(i)               ((i)*75+170)
 
@@ -192,6 +192,14 @@ static int getButtonAction(const char *str)
                return 2;
        else if (strcasecmp(str, "SelectWindows") == 0)
                return 3;
+       else if (strcasecmp(str, "MoveToPrevWorkspace") == 0)
+               return 4;
+       else if (strcasecmp(str, "MoveToNextWorkspace") == 0)
+               return 5;
+       else if (strcasecmp(str, "MoveToPrevWindow") == 0)
+               return 6;
+       else if (strcasecmp(str, "MoveToNextWindow") == 0)
+               return 7;
        else
                return -1;
 
@@ -206,6 +214,8 @@ static int getWheelAction(const char *str)
                return 0;
        else if (strcasecmp(str, "SwitchWorkspaces") == 0)
                return 1;
+       else if (strcasecmp(str, "SwitchWindows") == 0)
+               return 2;
        else
                return -1;
 
@@ -805,8 +815,9 @@ static void storeData(_Panel * panel)
        char buffer[64];
        int i;
        char *tmp, *p;
-       static char *button[4] = { "None", "OpenApplicationsMenu", 
"OpenWindowListMenu", "SelectWindows" };
-       static char *wheel[2] = { "None", "SwitchWorkspaces" };
+       static char *button[8] = { "None", "OpenApplicationsMenu", 
"OpenWindowListMenu", "SelectWindows",
+                                               "MoveToPrevWorkspace", 
"MoveToNextWorkspace", "MoveToPrevWindow", "MoveToNextWindow" };
+       static char *wheel[3] = { "None", "SwitchWorkspaces", "SwitchWindows" };
        WMUserDefaults *udb = WMGetStandardUserDefaults();
 
        if (!WMGetUDBoolForKey(udb, "NoXSetStuff")) {
@@ -878,9 +889,14 @@ Panel *InitMouseSettings(WMWidget *parent)
        buttonActions[1] = wstrdup(_("Applications Menu"));
        buttonActions[2] = wstrdup(_("Window List Menu"));
        buttonActions[3] = wstrdup(_("Select Windows"));
+       buttonActions[4] = wstrdup(_("Previous Workspace"));
+       buttonActions[5] = wstrdup(_("Next Workspace"));
+       buttonActions[6] = wstrdup(_("Previous Window"));
+       buttonActions[7] = wstrdup(_("Next Window"));
 
        wheelActions[0] = wstrdup(_("None"));
        wheelActions[1] = wstrdup(_("Switch Workspaces"));
+       wheelActions[2] = wstrdup(_("Switch Windows"));
 
        panel = wmalloc(sizeof(_Panel));
 

http://repo.or.cz/w/wmaker-crm.git/commit/072b3569111d3f77ca4b1fafbac29d74cddcef21

commit 072b3569111d3f77ca4b1fafbac29d74cddcef21
Author: David Maciejak <[email protected]>
Date:   Thu Sep 11 07:19:12 2014 +0700

    wmaker: add new button and wheel mouse actions
    
    This patch is adding atomic mouse actions to mouse buttons to:
    -focus on previous or next window
    -move to previous or next workspace
    
    and adding wheel action to
    -switch between windows

diff --git a/src/WindowMaker.h b/src/WindowMaker.h
index 5d850dbe..53d2eafb 100644
--- a/src/WindowMaker.h
+++ b/src/WindowMaker.h
@@ -206,6 +206,11 @@ typedef enum {
 #define WA_OPEN_APPMENU         2
 #define WA_OPEN_WINLISTMENU     3
 #define WA_SWITCH_WORKSPACES    4
+#define WA_MOVE_PREVWORKSPACE    5
+#define WA_MOVE_NEXTWORKSPACE    6
+#define WA_SWITCH_WINDOWS    7
+#define WA_MOVE_PREVWINDOW    8
+#define WA_MOVE_NEXTWINDOW    9
 
 /* workspace display position */
 #define WD_NONE                0
diff --git a/src/defaults.c b/src/defaults.c
index df7e9191..72c8b6f3 100644
--- a/src/defaults.c
+++ b/src/defaults.c
@@ -240,12 +240,17 @@ static WOptionEnumeration seMouseButtonActions[] = {
        {"SelectWindows", WA_SELECT_WINDOWS, 0},
        {"OpenApplicationsMenu", WA_OPEN_APPMENU, 0},
        {"OpenWindowListMenu", WA_OPEN_WINLISTMENU, 0},
+       {"MoveToPrevWorkspace", WA_MOVE_PREVWORKSPACE, 0},
+       {"MoveToNextWorkspace", WA_MOVE_NEXTWORKSPACE, 0},
+       {"MoveToPrevWindow", WA_MOVE_PREVWINDOW, 0},
+       {"MoveToNextWindow", WA_MOVE_NEXTWINDOW, 0},
        {NULL, 0, 0}
 };
 
 static WOptionEnumeration seMouseWheelActions[] = {
        {"None", WA_NONE, 0},
        {"SwitchWorkspaces", WA_SWITCH_WORKSPACES, 0},
+       {"SwitchWindows", WA_SWITCH_WINDOWS, 0},
        {NULL, 0, 0}
 };
 
diff --git a/src/event.c b/src/event.c
index 0ec1b770..55df69ba 100644
--- a/src/event.c
+++ b/src/event.c
@@ -702,8 +702,35 @@ static void handleExpose(XEvent * event)
        }
 }
 
-static void executeButtonAction(WScreen * scr, XEvent * event, int action)
+static void executeWheelAction(WScreen *scr, XEvent *event, int action)
 {
+       WWindow *wwin;
+       Bool next_direction = True;
+
+       if (event->xbutton.button == Button5 || event->xbutton.button == 
Button6)
+               next_direction = False;
+
+       switch (action) {
+       case WA_SWITCH_WORKSPACES:
+               if (next_direction)
+                       wWorkspaceRelativeChange(scr, 1);
+               else
+                       wWorkspaceRelativeChange(scr, -1);
+               break;
+       case WA_SWITCH_WINDOWS:
+               wwin = scr->focused_window;
+               if (next_direction)
+                       wWindowFocusNext(wwin, True);
+               else
+                       wWindowFocusPrev(wwin, True);
+               break;
+       }
+}
+
+static void executeButtonAction(WScreen *scr, XEvent *event, int action)
+{
+       WWindow *wwin;
+
        switch (action) {
        case WA_SELECT_WINDOWS:
                wUnselectWindows(scr);
@@ -728,7 +755,19 @@ static void executeButtonAction(WScreen * scr, XEvent * 
event, int action)
                                event->xbutton.window = 
scr->switch_menu->frame->core->window;
                }
                break;
-       default:
+       case WA_MOVE_PREVWORKSPACE:
+               wWorkspaceRelativeChange(scr, -1);
+               break;
+       case WA_MOVE_NEXTWORKSPACE:
+               wWorkspaceRelativeChange(scr, 1);
+               break;
+       case WA_MOVE_PREVWINDOW:
+               wwin = scr->focused_window;
+               wWindowFocusPrev(wwin, True);
+               break;
+       case WA_MOVE_NEXTWINDOW:
+               wwin = scr->focused_window;
+               wWindowFocusNext(wwin, True);
                break;
        }
 }
@@ -757,13 +796,13 @@ static void handleButtonPress(XEvent * event)
                }else if (event->xbutton.button == Button9 && 
wPreferences.mouse_button9 != WA_NONE) {
                        executeButtonAction(scr, event, 
wPreferences.mouse_button9);
                } else if (event->xbutton.button == Button4 && 
wPreferences.mouse_wheel_scroll != WA_NONE) {
-                       wWorkspaceRelativeChange(scr, 1);
+                       executeWheelAction(scr, event, 
wPreferences.mouse_wheel_scroll);
                } else if (event->xbutton.button == Button5 && 
wPreferences.mouse_wheel_scroll != WA_NONE) {
-                       wWorkspaceRelativeChange(scr, -1);
+                       executeWheelAction(scr, event, 
wPreferences.mouse_wheel_scroll);
                } else if (event->xbutton.button == Button6 && 
wPreferences.mouse_wheel_tilt != WA_NONE) {
-                       wWorkspaceRelativeChange(scr, -1);
+                       executeWheelAction(scr, event, 
wPreferences.mouse_wheel_tilt);
                } else if (event->xbutton.button == Button7 && 
wPreferences.mouse_wheel_tilt != WA_NONE) {
-                       wWorkspaceRelativeChange(scr, 1);
+                       executeWheelAction(scr, event, 
wPreferences.mouse_wheel_tilt);
                }
        }
 

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

commit a96c5c7f08f4df47a4a74fdd3599da316beb2699
Author: David Maciejak <[email protected]>
Date:   Thu Sep 11 07:15:53 2014 +0700

    wmaker: use defined wWindowSingleFocus() function
    
    This patch is cleaning focuswindow() local function to call
    wWindowSingleFocus() global function.

diff --git a/src/switchmenu.c b/src/switchmenu.c
index db7a40e2..ae37dd2a 100644
--- a/src/switchmenu.c
+++ b/src/switchmenu.c
@@ -62,26 +62,12 @@ static void wsobserver(void *self, WMNotification * notif);
 static void focusWindow(WMenu * menu, WMenuEntry * entry)
 {
        WWindow *wwin;
-       WScreen *scr;
-       int x, y, move = 0;
 
        /* Parameter not used, but tell the compiler that it is ok */
        (void) menu;
 
        wwin = (WWindow *) entry->clientdata;
-       scr = wwin->screen_ptr;
-
-       wMakeWindowVisible(wwin);
-
-       x = wwin->frame_x;
-       y = wwin->frame_y;
-
-       /* bring window back to visible area */
-       move = wScreenBringInside(scr, &x, &y, wwin->frame->core->width, 
wwin->frame->core->height);
-
-       if (move) {
-               wWindowConfigure(wwin, x, y, wwin->client.width, 
wwin->client.height);
-       }
+       wWindowSingleFocus(wwin);
 }
 
 void InitializeSwitchMenu(void)

http://repo.or.cz/w/wmaker-crm.git/commit/99465f87fb2e1454aa239b711a14bcb4f7c9c5c1

commit 99465f87fb2e1454aa239b711a14bcb4f7c9c5c1
Author: David Maciejak <[email protected]>
Date:   Thu Sep 11 07:12:53 2014 +0700

    wmaker: add next and previous window focus functions
    
    This patch is adding a wWindowFocusPrev() and wWindowFocusNext() functions.
    And copying switchmenu.c focusWindow() as wWindowSingleFocus().

diff --git a/src/window.c b/src/window.c
index a33747b8..82d41efe 100644
--- a/src/window.c
+++ b/src/window.c
@@ -1629,6 +1629,61 @@ void wWindowUnmap(WWindow *wwin)
        XUnmapWindow(dpy, wwin->frame->core->window);
 }
 
+void wWindowSingleFocus(WWindow *wwin)
+{
+       WScreen *scr;
+       int x, y, move = 0;
+
+       if (!wwin)
+               return;
+
+       scr = wwin->screen_ptr;
+       wMakeWindowVisible(wwin);
+
+       x = wwin->frame_x;
+       y = wwin->frame_y;
+
+       /* bring window back to visible area */
+       move = wScreenBringInside(scr, &x, &y, wwin->frame->core->width, 
wwin->frame->core->height);
+
+       if (move) {
+               wWindowConfigure(wwin, x, y, wwin->client.width, 
wwin->client.height);
+       }
+}
+
+void wWindowFocusPrev(WWindow *wwin, Bool inSameWorkspace)
+{
+       WWindow *tmp;
+
+       if (!wwin || !wwin->prev)
+               return;
+
+       tmp = wwin;
+       while (tmp->prev)
+               tmp = tmp->prev;
+
+       if (inSameWorkspace)
+               while (tmp && (tmp->frame->workspace != wwin->frame->workspace))
+                       tmp = tmp->next;
+
+       wWindowSingleFocus(tmp);
+}
+
+void wWindowFocusNext(WWindow *wwin, Bool inSameWorkspace)
+{
+       WWindow *tmp;
+
+       if (!wwin || !wwin->prev)
+               return;
+
+       tmp = wwin->prev;
+       if (inSameWorkspace)
+               while (tmp && (tmp->frame->workspace != wwin->frame->workspace))
+                       tmp = tmp->prev;
+
+       wWindowSingleFocus(tmp);
+}
+
 void wWindowFocus(WWindow *wwin, WWindow *owin)
 {
        WWindow *nowner;
diff --git a/src/window.h b/src/window.h
index ad6d5327..1a4de2cb 100644
--- a/src/window.h
+++ b/src/window.h
@@ -339,6 +339,9 @@ WWindow *wManageWindow(WScreen *scr, Window window);
 
 void wUnmanageWindow(WWindow *wwin, Bool restore, Bool destroyed);
 
+void wWindowSingleFocus(WWindow *wwin);
+void wWindowFocusPrev(WWindow *wwin, Bool inSameWorkspace);
+void wWindowFocusNext(WWindow *wwin, Bool inSameWorkspace);
 void wWindowFocus(WWindow *wwin, WWindow *owin);
 void wWindowUnfocus(WWindow *wwin);
 

http://repo.or.cz/w/wmaker-crm.git/commit/6c5fc1f6505531f71b7d2c1c4105700b2799279a

commit 6c5fc1f6505531f71b7d2c1c4105700b2799279a
Author: David Maciejak <[email protected]>
Date:   Thu Sep 11 07:04:12 2014 +0700

    wmaker: fix focused window list order
    
    This patch is fixing the focused next window list order.
    As now, the switching was only working for 2 windows.
    For example, taking 3 windows called A,B,C.
    If the windows list is A,B,C where A is the current focused window.
    Focusing on B will result on switching position A and B, thus C will
    never be the next window.
    For this example the patch is updating the linked list as B,C,A.

diff --git a/src/actions.c b/src/actions.c
index b8e4fc4e..ed77d3bd 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -189,15 +189,27 @@ void wSetFocusTo(WScreen *scr, WWindow *wwin)
 
        /* if this is not the focused window focus it */
        if (focused != wwin) {
-               /* change the focus window list order */
-               if (wwin->prev)
-                       wwin->prev->next = wwin->next;
+               WWindow *tmp = focused;
+               /* get the last one from the list */
+               while (tmp->prev)
+                       tmp = tmp->prev;
 
-               if (wwin->next)
-                       wwin->next->prev = wwin->prev;
+               /* change the focus window list order
+                  the current focused window and siblings are moved to the end 
*/
+               focused->next = tmp;
+               tmp->prev = focused;
+
+               /* cut the sibling link to the wwin window we want to focus
+                  as now the last sibling will become the last in the list */
+               tmp = focused;
+               while (tmp->prev) {
+                       if (tmp->prev == wwin)
+                               tmp->prev = NULL;
+                       else
+                               tmp = tmp->prev;
+               }
 
-               wwin->prev = focused;
-               focused->next = wwin;
+               /* wwin is becoming the first focused window */
                wwin->next = NULL;
                scr->focused_window = wwin;
 

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

Summary of changes:
 WPrefs.app/MouseSettings.c |   24 ++++++++++++++++---
 src/WindowMaker.h          |    5 ++++
 src/actions.c              |   28 ++++++++++++++++------
 src/defaults.c             |    5 ++++
 src/event.c                |   51 ++++++++++++++++++++++++++++++++++++----
 src/switchmenu.c           |   16 +------------
 src/window.c               |   55 ++++++++++++++++++++++++++++++++++++++++++++
 src/window.h               |    3 ++
 8 files changed, 154 insertions(+), 33 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