mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-30 10:22:34 +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
18
src/misc.c
18
src/misc.c
@@ -679,6 +679,24 @@ char *ExpandOptions(WScreen *scr, const char *cmdline)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void ExecuteInputCommand(WScreen *scr, const char *cmdline)
|
||||
{
|
||||
char *cmd;
|
||||
|
||||
cmd = ExpandOptions(scr, cmdline);
|
||||
if (cmd) {
|
||||
XGrabPointer(dpy, scr->root_win, True, 0,
|
||||
GrabModeAsync, GrabModeAsync, None, wPreferences.cursor[WCUR_WAIT], CurrentTime);
|
||||
XSync(dpy, False);
|
||||
|
||||
ExecuteShellCommand(scr, cmd);
|
||||
wfree(cmd);
|
||||
|
||||
XUngrabPointer(dpy, CurrentTime);
|
||||
XSync(dpy, False);
|
||||
}
|
||||
}
|
||||
|
||||
void ParseWindowName(WMPropList *value, char **winstance, char **wclass, const char *where)
|
||||
{
|
||||
char *name;
|
||||
|
||||
Reference in New Issue
Block a user