1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-20 12:58:08 +01:00

shortcutWindows moved to w_global

The variable shortcutWindows is moved to w_global. Now, the shortcuts
are used in whole Window Maker, not only in the current screen.
This commit is contained in:
Rodolfo García Peñas (kix)
2013-10-08 00:56:44 +02:00
committed by Carlos R. Mafra
parent 6987d4aa40
commit 0de3e590ce
6 changed files with 40 additions and 43 deletions

View File

@@ -1634,8 +1634,8 @@ static void handleKeyPress(XEvent * event)
widx = command - WKBD_WINDOW1;
if (scr->shortcutWindows[widx]) {
WMArray *list = scr->shortcutWindows[widx];
if (w_global.shortcut.windows[widx]) {
WMArray *list = w_global.shortcut.windows[widx];
int cw;
int count = WMGetArrayItemCount(list);
WWindow *twin;
@@ -1661,18 +1661,16 @@ static void handleKeyPress(XEvent * event)
WMAddToArray(list, twin);
} else if (wwin && ISMAPPED(wwin) && ISFOCUSED(wwin)) {
if (scr->shortcutWindows[widx]) {
WMFreeArray(scr->shortcutWindows[widx]);
scr->shortcutWindows[widx] = NULL;
if (w_global.shortcut.windows[widx]) {
WMFreeArray(w_global.shortcut.windows[widx]);
w_global.shortcut.windows[widx] = NULL;
}
if (wwin->flags.selected && scr->selected_windows) {
scr->shortcutWindows[widx] = WMDuplicateArray(scr->selected_windows);
/*WMRemoveFromArray(scr->shortcutWindows[index], wwin);
WMInsertInArray(scr->shortcutWindows[index], 0, wwin); */
w_global.shortcut.windows[widx] = WMDuplicateArray(scr->selected_windows);
} else {
scr->shortcutWindows[widx] = WMCreateArray(4);
WMAddToArray(scr->shortcutWindows[widx], wwin);
w_global.shortcut.windows[widx] = WMCreateArray(4);
WMAddToArray(w_global.shortcut.windows[widx], wwin);
}
wSelectWindow(wwin, !wwin->flags.selected);
@@ -1682,12 +1680,11 @@ static void handleKeyPress(XEvent * event)
XFlush(dpy);
} else if (scr->selected_windows && WMGetArrayItemCount(scr->selected_windows)) {
if (wwin->flags.selected && scr->selected_windows) {
if (scr->shortcutWindows[widx]) {
WMFreeArray(scr->shortcutWindows[widx]);
}
scr->shortcutWindows[widx] = WMDuplicateArray(scr->selected_windows);
if (w_global.shortcut.windows[widx])
WMFreeArray(w_global.shortcut.windows[widx]);
w_global.shortcut.windows[widx] = WMDuplicateArray(scr->selected_windows);
}
}