mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-20 04:48:06 +01:00
added shortcut to switch screens
This commit is contained in:
@@ -83,7 +83,6 @@ extern proplist_t ReadProplistFromFile(char *file);
|
|||||||
|
|
||||||
extern WDDomain *WDWindowMaker;
|
extern WDDomain *WDWindowMaker;
|
||||||
extern WDDomain *WDWindowAttributes;
|
extern WDDomain *WDWindowAttributes;
|
||||||
extern WDDomain *WDRootMenu;
|
|
||||||
|
|
||||||
extern int wScreenCount;
|
extern int wScreenCount;
|
||||||
|
|
||||||
@@ -182,8 +181,9 @@ static int setClipTitleFont();
|
|||||||
static int setClipTitleColor();
|
static int setClipTitleColor();
|
||||||
|
|
||||||
static int setMenuStyle();
|
static int setMenuStyle();
|
||||||
|
#if 0
|
||||||
static int setMultiByte();
|
static int setMultiByte();
|
||||||
|
#endif
|
||||||
static int updateUsableArea();
|
static int updateUsableArea();
|
||||||
|
|
||||||
#ifdef DEFINABLE_CURSOR
|
#ifdef DEFINABLE_CURSOR
|
||||||
@@ -374,10 +374,12 @@ WDefaultEntry staticOptionList[] = {
|
|||||||
},
|
},
|
||||||
{"DisableMiniwindows", "NO", NULL,
|
{"DisableMiniwindows", "NO", NULL,
|
||||||
&wPreferences.disable_miniwindows, getBool, NULL
|
&wPreferences.disable_miniwindows, getBool, NULL
|
||||||
},
|
}
|
||||||
{"MultiByteText", "NO", NULL,
|
#if 0
|
||||||
|
,{"MultiByteText", "NO", NULL,
|
||||||
&wPreferences.multi_byte_text, getBool, setMultiByte
|
&wPreferences.multi_byte_text, getBool, setMultiByte
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -786,7 +788,6 @@ WDefaultEntry optionList[] = {
|
|||||||
{"WindowShortcut4Key","None", (void*)WKBD_WINDOW4,
|
{"WindowShortcut4Key","None", (void*)WKBD_WINDOW4,
|
||||||
NULL, getKeybind, setKeyGrab
|
NULL, getKeybind, setKeyGrab
|
||||||
}
|
}
|
||||||
#ifdef EXTEND_WINDOWSHORTCUT
|
|
||||||
,{"WindowShortcut5Key","None", (void*)WKBD_WINDOW5,
|
,{"WindowShortcut5Key","None", (void*)WKBD_WINDOW5,
|
||||||
NULL, getKeybind, setKeyGrab
|
NULL, getKeybind, setKeyGrab
|
||||||
},
|
},
|
||||||
@@ -804,8 +805,10 @@ WDefaultEntry optionList[] = {
|
|||||||
},
|
},
|
||||||
{"WindowShortcut10Key","None", (void*)WKBD_WINDOW10,
|
{"WindowShortcut10Key","None", (void*)WKBD_WINDOW10,
|
||||||
NULL, getKeybind, setKeyGrab
|
NULL, getKeybind, setKeyGrab
|
||||||
}
|
},
|
||||||
#endif /* EXTEND_WINDOWSHORTCUT */
|
{"ScreenSwitchKey", "None", (void*)WKBD_SWITCH_SCREEN,
|
||||||
|
NULL, getKeybind, setKeyGrab
|
||||||
|
},
|
||||||
|
|
||||||
#ifdef KEEP_XKB_LOCK_STATUS
|
#ifdef KEEP_XKB_LOCK_STATUS
|
||||||
,{"ToggleKbdModeKey", "None", (void*)WKBD_TOGGLE,
|
,{"ToggleKbdModeKey", "None", (void*)WKBD_TOGGLE,
|
||||||
@@ -1148,33 +1151,6 @@ wDefaultsCheckDomains(void *foo)
|
|||||||
WDWindowAttributes->timestamp = stbuf.st_mtime;
|
WDWindowAttributes->timestamp = stbuf.st_mtime;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef LITE
|
|
||||||
if (stat(WDRootMenu->path, &stbuf)>=0
|
|
||||||
&& WDRootMenu->timestamp < stbuf.st_mtime) {
|
|
||||||
dict = ReadProplistFromFile(WDRootMenu->path);
|
|
||||||
#ifdef HEARTBEAT
|
|
||||||
puts("Checking WMRootMenu domain");
|
|
||||||
#endif
|
|
||||||
if (dict) {
|
|
||||||
if (!PLIsArray(dict) && !PLIsString(dict)) {
|
|
||||||
PLRelease(dict);
|
|
||||||
dict = NULL;
|
|
||||||
wwarning(_("Domain %s (%s) of defaults database is corrupted!"),
|
|
||||||
"WMRootMenu", WDRootMenu->path);
|
|
||||||
} else {
|
|
||||||
if (WDRootMenu->dictionary) {
|
|
||||||
PLRelease(WDRootMenu->dictionary);
|
|
||||||
}
|
|
||||||
WDRootMenu->dictionary = dict;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
wwarning(_("could not load domain %s from user defaults database"),
|
|
||||||
"WMRootMenu");
|
|
||||||
}
|
|
||||||
WDRootMenu->timestamp = stbuf.st_mtime;
|
|
||||||
}
|
|
||||||
#endif /* !LITE */
|
|
||||||
|
|
||||||
if (!foo)
|
if (!foo)
|
||||||
WMAddTimerHandler(DEFAULTS_CHECK_INTERVAL, wDefaultsCheckDomains, foo);
|
WMAddTimerHandler(DEFAULTS_CHECK_INTERVAL, wDefaultsCheckDomains, foo);
|
||||||
}
|
}
|
||||||
@@ -3471,7 +3447,7 @@ setDoubleClick(WScreen *scr, WDefaultEntry *entry, int *value, void *foo)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if 0
|
||||||
static int
|
static int
|
||||||
setMultiByte(WScreen *scr, WDefaultEntry *entry, char *value, void *foo)
|
setMultiByte(WScreen *scr, WDefaultEntry *entry, char *value, void *foo)
|
||||||
{
|
{
|
||||||
@@ -3481,7 +3457,7 @@ setMultiByte(WScreen *scr, WDefaultEntry *entry, char *value, void *foo)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef DEFINABLE_CURSOR
|
#ifdef DEFINABLE_CURSOR
|
||||||
static int
|
static int
|
||||||
|
|||||||
26
src/event.c
26
src/event.c
@@ -1521,14 +1521,12 @@ handleKeyPress(XEvent *event)
|
|||||||
case WKBD_WINDOW2:
|
case WKBD_WINDOW2:
|
||||||
case WKBD_WINDOW3:
|
case WKBD_WINDOW3:
|
||||||
case WKBD_WINDOW4:
|
case WKBD_WINDOW4:
|
||||||
#ifdef EXTEND_WINDOWSHORTCUT
|
|
||||||
case WKBD_WINDOW5:
|
case WKBD_WINDOW5:
|
||||||
case WKBD_WINDOW6:
|
case WKBD_WINDOW6:
|
||||||
case WKBD_WINDOW7:
|
case WKBD_WINDOW7:
|
||||||
case WKBD_WINDOW8:
|
case WKBD_WINDOW8:
|
||||||
case WKBD_WINDOW9:
|
case WKBD_WINDOW9:
|
||||||
case WKBD_WINDOW10:
|
case WKBD_WINDOW10:
|
||||||
#endif
|
|
||||||
|
|
||||||
#define INITBAG(bag) if (bag) WMEmptyBag(bag); else bag = WMCreateBag(4)
|
#define INITBAG(bag) if (bag) WMEmptyBag(bag); else bag = WMCreateBag(4)
|
||||||
|
|
||||||
@@ -1604,6 +1602,30 @@ handleKeyPress(XEvent *event)
|
|||||||
#undef INITBAG
|
#undef INITBAG
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case WKBD_SWITCH_SCREEN:
|
||||||
|
if (wScreenCount > 1) {
|
||||||
|
WScreen *scr2;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
/* find index of this screen */
|
||||||
|
for (i = 0; < wScreenCount; i++) {
|
||||||
|
if (wScreenWithNumber(i) == scr)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
if (i >= wScreenCount) {
|
||||||
|
i = 0;
|
||||||
|
}
|
||||||
|
scr2 = wScreenWithNumber(i);
|
||||||
|
|
||||||
|
if (scr2) {
|
||||||
|
XWarpPointer(dpy, scr->root_win, scr2->root_win, 0, 0, 0, 0,
|
||||||
|
scr2->scr_width/2, scr2->scr_height/2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case WKBD_NEXTWSLAYER:
|
case WKBD_NEXTWSLAYER:
|
||||||
case WKBD_PREVWSLAYER:
|
case WKBD_PREVWSLAYER:
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -69,25 +69,19 @@
|
|||||||
#define WKBD_WINDOW4 37
|
#define WKBD_WINDOW4 37
|
||||||
#define WKBD_WINDOW5 38
|
#define WKBD_WINDOW5 38
|
||||||
#define WKBD_WINDOW6 39
|
#define WKBD_WINDOW6 39
|
||||||
#ifdef EXTEND_WINDOWSHORTCUT
|
#define WKBD_WINDOW7 40
|
||||||
# define WKBD_WINDOW7 40
|
#define WKBD_WINDOW8 41
|
||||||
# define WKBD_WINDOW8 41
|
#define WKBD_WINDOW9 42
|
||||||
# define WKBD_WINDOW9 42
|
#define WKBD_WINDOW10 43
|
||||||
# define WKBD_WINDOW10 43
|
|
||||||
# ifdef KEEP_XKB_LOCK_STATUS
|
#define WKBD_SWITCH_SCREEN 44
|
||||||
# define WKBD_TOGGLE 44
|
|
||||||
|
#ifdef KEEP_XKB_LOCK_STATUS
|
||||||
|
# define WKBD_TOGGLE 45
|
||||||
|
# define WKBD_LAST 46
|
||||||
|
#else
|
||||||
# define WKBD_LAST 45
|
# define WKBD_LAST 45
|
||||||
# else
|
#endif /* KEEP_XKB_LOCK_STATUS */
|
||||||
# define WKBD_LAST 44
|
|
||||||
# endif /* KEEP_XKB_LOCK_STATUS */
|
|
||||||
#else /* !EXTEND_WINDOWSHORTCUT */
|
|
||||||
# ifdef KEEP_XKB_LOCK_STATUS
|
|
||||||
# define WKBD_TOGGLE 40
|
|
||||||
# define WKBD_LAST 41
|
|
||||||
# else
|
|
||||||
# define WKBD_LAST 42
|
|
||||||
# endif /* KEEP_XKB_LOCK_STATUS */
|
|
||||||
#endif /* !EXTEND_WINDOWSHORTCUT */
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct WShortKey {
|
typedef struct WShortKey {
|
||||||
|
|||||||
Reference in New Issue
Block a user