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 056a290a7deec098de72f81a48edbb83b1faf42f (commit)
via 51c9f2a852c1f699671a42da4348de194832efcd (commit)
via 3d01e5c8797a2a59a60e71e9d50a6abccaf14e62 (commit)
via 8352c9ef606c5a89ae28715265748cf21b308b51 (commit)
via 528d97b5975313816ee4ebc42d2f2ba5fa0905fe (commit)
from 42a78ee73f70e70f1e3d7d8d4751846352f216be (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/056a290a7deec098de72f81a48edbb83b1faf42f
commit 056a290a7deec098de72f81a48edbb83b1faf42f
Author: Iain Patterson <[email protected]>
Date: Mon Apr 2 11:11:30 2012 +0100
Also relaunch from appicon with Ctrl + DblClick.
Zoltan Balaton points out that Control + Doubleclick on docked app will
launch a new instance. For consistency with that behaviour we now allow
Control + Doubleclick on an undocked appicon to invoke the new
relaunching functionality.
We also now restrict doubleclick handling to the left mouse button in
order to avoid relaunching the application twice when the middle button
is used.
diff --git a/src/appicon.c b/src/appicon.c
index 19f5614..80f08f4 100644
--- a/src/appicon.c
+++ b/src/appicon.c
@@ -497,8 +497,13 @@ static void iconDblClick(WObjDescriptor * desc, XEvent *
event)
assert(aicon->icon->owner != NULL);
wapp = wApplicationOf(aicon->icon->owner->main_window);
- unhideHere = (event->xbutton.state & ShiftMask);
+ if (event->xbutton.state & ControlMask) {
+ relaunchApplication(wapp);
+ return;
+ }
+
+ unhideHere = (event->xbutton.state & ShiftMask);
/* go to the last workspace that the user worked on the app */
if (!unhideHere && wapp->last_workspace != scr->current_workspace)
wWorkspaceChange(scr, wapp->last_workspace);
@@ -535,7 +540,9 @@ void appIconMouseDown(WObjDescriptor * desc, XEvent * event)
return;
if (IsDoubleClick(scr, event)) {
- iconDblClick(desc, event);
+ /* Middle or right mouse actions were handled on first click */
+ if (event->xbutton.button == Button1)
+ iconDblClick(desc, event);
return;
}
http://repo.or.cz/w/wmaker-crm.git/commit/51c9f2a852c1f699671a42da4348de194832efcd
commit 51c9f2a852c1f699671a42da4348de194832efcd
Author: Iain Patterson <[email protected]>
Date: Fri Mar 30 17:36:12 2012 +0100
Also allow relaunching from appicon.
Allow relaunching an application with a middle mouse click to its
appicon or the Launch option of its appicon menu.
diff --git a/src/appicon.c b/src/appicon.c
index d05413b..19f5614 100644
--- a/src/appicon.c
+++ b/src/appicon.c
@@ -295,6 +295,39 @@ Bool wAppIconSave(WAppIcon *aicon)
#define canBeDocked(wwin) ((wwin) && ((wwin)->wm_class||(wwin)->wm_instance))
+/* main_window may not have the full command line; try to find one which does
*/
+static void relaunchApplication(WApplication *wapp)
+{
+ WScreen *scr;
+ WWindow *wlist, *next;
+
+ scr = wapp->main_window_desc->screen_ptr;
+ wlist = scr->focused_window;
+ if (! wlist)
+ return;
+
+ while (wlist->prev)
+ wlist = wlist->prev;
+
+ while (wlist) {
+ next = wlist->next;
+
+ if (wlist->main_window == wapp->main_window) {
+ if (RelaunchWindow(wlist))
+ return;
+ }
+
+ wlist = next;
+ }
+}
+
+static void relaunchCallback(WMenu * menu, WMenuEntry * entry)
+{
+ WApplication *wapp = (WApplication *) entry->clientdata;
+
+ relaunchApplication(wapp);
+}
+
static void hideCallback(WMenu * menu, WMenuEntry * entry)
{
WApplication *wapp = (WApplication *) entry->clientdata;
@@ -403,6 +436,7 @@ static WMenu *createApplicationMenu(WScreen * scr)
WMenu *menu;
menu = wMenuCreate(scr, NULL, False);
+ wMenuAddCallback(menu, _("Launch"), relaunchCallback, NULL);
wMenuAddCallback(menu, _("Unhide Here"), unhideHereCallback, NULL);
wMenuAddCallback(menu, _("Hide"), hideCallback, NULL);
wMenuAddCallback(menu, _("Set Icon..."), setIconCallback, NULL);
@@ -505,6 +539,16 @@ void appIconMouseDown(WObjDescriptor * desc, XEvent *
event)
return;
}
+ if (event->xbutton.button == Button2) {
+ WApplication *wapp =
wApplicationOf(aicon->icon->owner->main_window);
+
+ if (!wapp)
+ return;
+
+ relaunchApplication(wapp);
+ return;
+ }
+
if (event->xbutton.button == Button3) {
WObjDescriptor *desc;
WApplication *wapp =
wApplicationOf(aicon->icon->owner->main_window);
http://repo.or.cz/w/wmaker-crm.git/commit/3d01e5c8797a2a59a60e71e9d50a6abccaf14e62
commit 3d01e5c8797a2a59a60e71e9d50a6abccaf14e62
Author: Iain Patterson <[email protected]>
Date: Fri Mar 30 17:36:07 2012 +0100
Also allow relaunching from the window menu.
Allow relaunching an application from its window menu.
diff --git a/src/winmenu.c b/src/winmenu.c
index 8e657e6..ef97126 100644
--- a/src/winmenu.c
+++ b/src/winmenu.c
@@ -55,9 +55,10 @@
#define MC_PROPERTIES 7
#define MC_OPTIONS 8
#define MC_SHORTCUT 8
+#define MC_RELAUNCH 9
-#define MC_CLOSE 9
-#define MC_KILL 10
+#define MC_CLOSE 10
+#define MC_KILL 11
#define WO_KEEP_ON_TOP 0
#define WO_KEEP_AT_BOTTOM 1
@@ -167,6 +168,10 @@ static void execMenuCommand(WMenu * menu, WMenuEntry *
entry)
wShowInspectorForWindow(wwin);
break;
+ case MC_RELAUNCH:
+ (void) RelaunchWindow(wwin);
+ break;
+
case MC_HIDE:
wapp = wApplicationOf(wwin->main_window);
wHideApplication(wapp);
@@ -454,6 +459,9 @@ static WMenu *createWindowMenu(WScreen * scr)
wMenuEntrySetCascade(menu, entry, makeMakeShortcutMenu(scr));
*/
+ entry = wMenuAddCallback(menu, _("Launch"), execMenuCommand, NULL);
+ entry->rtext = getShortcutString(wKeyBindings[WKBD_RELAUNCH]);
+
entry = wMenuAddCallback(menu, _("Close"), execMenuCommand, NULL);
entry->rtext = getShortcutString(wKeyBindings[WKBD_CLOSE]);
http://repo.or.cz/w/wmaker-crm.git/commit/8352c9ef606c5a89ae28715265748cf21b308b51
commit 8352c9ef606c5a89ae28715265748cf21b308b51
Author: Iain Patterson <[email protected]>
Date: Fri Mar 30 17:35:57 2012 +0100
Allow relaunch with shortcut key.
Use the WindowRelaunchKey shortcut to examine the WM_COMMAND property of
the active application's main window and launch a new instance of the
application using the retrieved command line.
diff --git a/WPrefs.app/KeyboardShortcuts.c b/WPrefs.app/KeyboardShortcuts.c
index 4fd5305..aad8f33 100644
--- a/WPrefs.app/KeyboardShortcuts.c
+++ b/WPrefs.app/KeyboardShortcuts.c
@@ -112,6 +112,7 @@ static char *keyOptions[] = {
"WindowShortcut8Key",
"WindowShortcut9Key",
"WindowShortcut10Key",
+ "WindowRelaunchKey",
"ScreenSwitchKey",
"DockRaiseLowerKey",
#ifndef XKB_MODELOCK
@@ -499,6 +500,7 @@ static void createPanel(Panel * p)
WMAddListItem(panel->actLs, _("Shortcut for window 8"));
WMAddListItem(panel->actLs, _("Shortcut for window 9"));
WMAddListItem(panel->actLs, _("Shortcut for window 10"));
+ WMAddListItem(panel->actLs, _("Launch new instance of application"));
WMAddListItem(panel->actLs, _("Switch to Next Screen/Monitor"));
WMAddListItem(panel->actLs, _("Raise/Lower Dock"));
WMAddListItem(panel->actLs, _("Raise/Lower Clip"));
diff --git a/src/defaults.c b/src/defaults.c
index 5b5269b..dba325a 100644
--- a/src/defaults.c
+++ b/src/defaults.c
@@ -639,6 +639,8 @@ WDefaultEntry optionList[] = {
NULL, getKeybind, setKeyGrab, NULL, NULL},
{"WindowShortcut10Key", "None", (void *)WKBD_WINDOW10,
NULL, getKeybind, setKeyGrab, NULL, NULL},
+ {"WindowRelaunchKey", "None", (void *)WKBD_RELAUNCH,
+ NULL, getKeybind, setKeyGrab, NULL, NULL},
{"ScreenSwitchKey", "None", (void *)WKBD_SWITCH_SCREEN,
NULL, getKeybind, setKeyGrab, NULL, NULL},
diff --git a/src/event.c b/src/event.c
index 3bc3c40..50c5a56 100644
--- a/src/event.c
+++ b/src/event.c
@@ -1651,6 +1651,12 @@ static void handleKeyPress(XEvent * event)
break;
+ case WKBD_RELAUNCH:
+ if (ISMAPPED(wwin) && ISFOCUSED(wwin))
+ (void) RelaunchWindow(wwin);
+
+ break;
+
case WKBD_SWITCH_SCREEN:
if (wScreenCount > 1) {
WScreen *scr2;
diff --git a/src/funcs.h b/src/funcs.h
index 6d2c552..ce9a99d 100644
--- a/src/funcs.h
+++ b/src/funcs.h
@@ -98,6 +98,8 @@ char *ExpandOptions(WScreen *scr, char *cmdline);
void ExecuteShellCommand(WScreen *scr, char *command);
+Bool RelaunchWindow(WWindow *wwin);
+
Bool IsDoubleClick(WScreen *scr, XEvent *event);
WWindow *NextToFocusAfter(WWindow *wwin);
diff --git a/src/keybind.h b/src/keybind.h
index e8b503c..99137d8 100644
--- a/src/keybind.h
+++ b/src/keybind.h
@@ -86,6 +86,9 @@ enum {
WKBD_WINDOW9,
WKBD_WINDOW10,
+ /* launch a new instance of the active window */
+ WKBD_RELAUNCH,
+
/* screen */
WKBD_SWITCH_SCREEN,
diff --git a/src/main.c b/src/main.c
index 9fc9976..7d44983 100644
--- a/src/main.c
+++ b/src/main.c
@@ -400,6 +400,68 @@ void ExecuteShellCommand(WScreen * scr, char *command)
/*
*---------------------------------------------------------------------
+ * RelaunchWindow--
+ * Launch a new instance of the active window
+ *
+ *----------------------------------------------------------------------
+ */
+Bool RelaunchWindow(WWindow *wwin)
+{
+ if (! wwin || ! wwin->client_win) {
+ werror("no window to relaunch");
+ return False;
+ }
+
+ char **argv;
+ int argc;
+
+ if (! XGetCommand(dpy, wwin->client_win, &argv, &argc) || argc == 0 ||
argv == NULL) {
+ werror("cannot relaunch the application because no WM_COMMAND
property is set");
+ return False;
+ }
+
+ pid_t pid = fork();
+
+ if (pid == 0) {
+ SetupEnvironment(wwin->screen_ptr);
+#ifdef HAVE_SETSID
+ setsid();
+#endif
+ /* argv is not null-terminated */
+ char **a = (char **) malloc(argc + 1);
+ if (! a) {
+ werror("out of memory trying to relaunch the
application");
+ Exit(-1);
+ }
+
+ int i;
+ for (i = 0; i < argc; i++) a[i] = argv[i];
+ a[i] = NULL;
+
+ execvp(a[0], a);
+ Exit(-1);
+ } else if (pid < 0) {
+ werror("cannot fork a new process");
+
+ XFreeStringList(argv);
+ return False;
+ } else {
+ _tuple *data = wmalloc(sizeof(_tuple));
+
+ data->scr = wwin->screen_ptr;
+ data->command = wtokenjoin(argv, argc);
+
+ /* not actually a shell command */
+ wAddDeathHandler(pid, (WDeathHandler *) shellCommandHandler,
data);
+
+ XFreeStringList(argv);
+ return True;
+ }
+
+}
+
+/*
+ *---------------------------------------------------------------------
* wAbort--
* Do a major cleanup and exit the program
*
http://repo.or.cz/w/wmaker-crm.git/commit/528d97b5975313816ee4ebc42d2f2ba5fa0905fe
commit 528d97b5975313816ee4ebc42d2f2ba5fa0905fe
Author: Rodolfo GarcÃa Peñas (kix) <[email protected]>
Date: Fri Mar 30 16:24:39 2012 +0200
canReceiveFocus() should check no_focusable first
The function canReceiveFocus should check if the window is no_focusable
first.
If the window is not focusable but is miniaturized, the window is shown in
the
switchpanel.
How to reproduce the problem:
- Open an application
- Open the window properties, advanced options
- Set that the application can not get the focus and save
- Test the switchpanel (Alt+Tab) the window doesn't appear
- Minimize the window
- Test the switchpanel (Alt+Tab), the window appears
- If the window is selected (restored), and test again the switchpanel, the
window doesn't appear!
diff --git a/src/switchpanel.c b/src/switchpanel.c
index 8f9eec1..23972a1 100644
--- a/src/switchpanel.c
+++ b/src/switchpanel.c
@@ -83,14 +83,16 @@ static int canReceiveFocus(WWindow * wwin)
wGetHeadForWindow(wwin) !=
wGetHeadForPointerLocation(wwin->screen_ptr))
return 0;
+ if (WFLAGP(wwin, no_focusable))
+ return 0;
+
if (!wwin->flags.mapped) {
if (!wwin->flags.shaded && !wwin->flags.miniaturized &&
!wwin->flags.hidden)
return 0;
else
return -1;
}
- if (WFLAGP(wwin, no_focusable))
- return 0;
+
return 1;
}
-----------------------------------------------------------------------
Summary of changes:
WPrefs.app/KeyboardShortcuts.c | 2 +
src/appicon.c | 55 ++++++++++++++++++++++++++++++++++-
src/defaults.c | 2 +
src/event.c | 6 ++++
src/funcs.h | 2 +
src/keybind.h | 3 ++
src/main.c | 62 ++++++++++++++++++++++++++++++++++++++++
src/switchpanel.c | 6 ++-
src/winmenu.c | 12 ++++++-
9 files changed, 144 insertions(+), 6 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].