mirror of
https://github.com/gryf/wmaker.git
synced 2026-01-17 20:34: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
16
src/event.c
16
src/event.c
@@ -1852,21 +1852,7 @@ static void handleKeyPress(XEvent * event)
|
||||
|
||||
case WKBD_RUN:
|
||||
{
|
||||
char *cmdline;
|
||||
|
||||
cmdline = ExpandOptions(scr, _("exec %A(Run,Type command to run:)"));
|
||||
|
||||
if (cmdline) {
|
||||
XGrabPointer(dpy, scr->root_win, True, 0,
|
||||
GrabModeAsync, GrabModeAsync, None, wPreferences.cursor[WCUR_WAIT], CurrentTime);
|
||||
XSync(dpy, False);
|
||||
|
||||
ExecuteShellCommand(scr, cmdline);
|
||||
wfree(cmdline);
|
||||
|
||||
XUngrabPointer(dpy, CurrentTime);
|
||||
XSync(dpy, False);
|
||||
}
|
||||
ExecuteInputCommand(scr, _("exec %A(Run, Type command:)"));
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user