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

Window shortcuts will apply to a group of selected windows, too.

This commit is contained in:
id
1999-05-04 21:03:11 +00:00
parent 37e669d1d8
commit f8918e85f7
3 changed files with 79 additions and 14 deletions

View File

@@ -44,6 +44,7 @@
#include "dialog.h"
#include "stacking.h"
#include "icon.h"
#include "list.h"
#define MC_MAXIMIZE 0
#define MC_MINIATURIZE 1
@@ -195,8 +196,24 @@ static void
makeShortcutCommand(WMenu *menu, WMenuEntry *entry)
{
WWindow *wwin = (WWindow*)entry->clientdata;
WScreen *scr = wwin->screen_ptr;
wwin->screen_ptr->shortcutWindow[entry->order-WO_ENTRIES] = wwin;
scr->shortcutWindow[entry->order-WO_ENTRIES] = wwin;
list_free(scr->shortcutSelectedWindows[entry->order-WO_ENTRIES]);
scr->shortcutSelectedWindows[entry->order-WO_ENTRIES] = NULL;
if (wwin->flags.selected /* && scr->selected_windows */ ) {
LinkedList *sl;
sl = scr->selected_windows;
while (sl) {
scr->shortcutSelectedWindows[entry->order-WO_ENTRIES] = list_cons(sl->head,scr->shortcutSelectedWindows[entry->order-WO_ENTRIES]);
sl = sl->tail;
}
}
else {
scr->shortcutSelectedWindows[entry->order-WO_ENTRIES] = NULL;
}
wSelectWindow(wwin, !wwin->flags.selected);
XFlush(dpy);
@@ -259,14 +276,16 @@ updateMakeShortcutMenu(WMenu *menu, WWindow *wwin)
sprintf(buffer, "%s %i", _("Set Shortcut"), shortcutNo+1);
if (!twin) {
if (!twin && !wwin->screen_ptr->shortcutSelectedWindows[shortcutNo]) {
entry->flags.indicator_on = 0;
} else {
entry->flags.indicator_on = 1;
if (twin != wwin)
entry->flags.indicator_type = MI_CHECK;
else
if (twin == wwin)
entry->flags.indicator_type = MI_DIAMOND;
else if (list_find(wwin->screen_ptr->shortcutSelectedWindows[shortcutNo], wwin))
entry->flags.indicator_type = MI_HIDDEN;
else
entry->flags.indicator_type = MI_CHECK;
}
if (strcmp(buffer, entry->text)!=0) {