mirror of
https://github.com/gryf/wmaker.git
synced 2026-01-14 02:24:18 +01:00
Factorize duplicate run command code
Run command from the menu and run command from the key shortcut are from two different codes. Merge them into one function instead.
This commit is contained in:
committed by
Carlos R. Mafra
parent
14d1b8197a
commit
630e9292c2
@@ -148,20 +148,7 @@ static Shortcut *shortcutList = NULL;
|
||||
|
||||
static void execCommand(WMenu * menu, WMenuEntry * entry)
|
||||
{
|
||||
char *cmdline;
|
||||
|
||||
cmdline = ExpandOptions(menu->frame->screen_ptr, (char *)entry->clientdata);
|
||||
|
||||
XGrabPointer(dpy, menu->frame->screen_ptr->root_win, True, 0,
|
||||
GrabModeAsync, GrabModeAsync, None, wPreferences.cursor[WCUR_WAIT], CurrentTime);
|
||||
XSync(dpy, 0);
|
||||
|
||||
if (cmdline) {
|
||||
ExecuteShellCommand(menu->frame->screen_ptr, cmdline);
|
||||
wfree(cmdline);
|
||||
}
|
||||
XUngrabPointer(dpy, CurrentTime);
|
||||
XSync(dpy, 0);
|
||||
ExecuteInputCommand(menu->frame->screen_ptr, (char *)entry->clientdata);
|
||||
}
|
||||
|
||||
static void exitCommand(WMenu * menu, WMenuEntry * entry)
|
||||
|
||||
Reference in New Issue
Block a user