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

Added "Hide Others" to the window menu

This commit is contained in:
dan
2002-01-04 05:44:20 +00:00
parent a8c7375623
commit 96f8ab167f
8 changed files with 56 additions and 29 deletions

View File

@@ -8,6 +8,7 @@ Changes since version 0.80.0:
- Fixed problem with keyboard shortcuts executed an every screen for
multihead systems.
- Fixed problem with kcalc not having a miniaturize button.
- Added "Hide Others" to the window menu.
Changes since version 0.70.0:

View File

@@ -69,7 +69,8 @@ static char *keyOptions[] = {
"WindowListKey",
"WindowMenuKey",
"HideKey",
"MiniaturizeKey",
"HideOthersKey",
"MiniaturizeKey",
"CloseKey",
"MaximizeKey",
"VMaximizeKey",
@@ -380,6 +381,7 @@ createPanel(Panel *p)
WMAddListItem(panel->actLs, _("Open window list menu"));
WMAddListItem(panel->actLs, _("Open window commands menu"));
WMAddListItem(panel->actLs, _("Hide active application"));
WMAddListItem(panel->actLs, _("Hide other applications"));
WMAddListItem(panel->actLs, _("Miniaturize active window"));
WMAddListItem(panel->actLs, _("Close active window"));
WMAddListItem(panel->actLs, _("Maximize active window"));

View File

@@ -681,6 +681,9 @@ WDefaultEntry optionList[] = {
{"HideKey", "None", (void*)WKBD_HIDE,
NULL, getKeybind, setKeyGrab
},
{"HideOthersKey", "None", (void*)WKBD_HIDE_OTHERS,
NULL, getKeybind, setKeyGrab
},
{"MoveResizeKey", "None", (void*)WKBD_MOVERESIZE,
NULL, getKeybind, setKeyGrab
},

View File

@@ -1437,6 +1437,13 @@ handleKeyPress(XEvent *event)
}
}
break;
case WKBD_HIDE_OTHERS:
if (ISMAPPED(wwin) && ISFOCUSED(wwin)) {
CloseWindowMenu(scr);
wHideOtherApplications(wwin);
}
break;
case WKBD_MAXIMIZE:
if (ISMAPPED(wwin) && ISFOCUSED(wwin) && !WFLAGP(wwin, no_resizable)) {
CloseWindowMenu(scr);

View File

@@ -28,25 +28,26 @@
/* window */
#define WKBD_MINIATURIZE 3
#define WKBD_HIDE 4
#define WKBD_MAXIMIZE 5
#define WKBD_VMAXIMIZE 6
#define WKBD_HMAXIMIZE 7
#define WKBD_SELECT 8
#define WKBD_HIDE_OTHERS 5
#define WKBD_MAXIMIZE 6
#define WKBD_VMAXIMIZE 7
#define WKBD_HMAXIMIZE 8
#define WKBD_SELECT 9
/* Clip */
#define WKBD_CLIPLOWER 9
#define WKBD_CLIPRAISE 10
#define WKBD_CLIPRAISELOWER 11
#define WKBD_CLIPLOWER 10
#define WKBD_CLIPRAISE 11
#define WKBD_CLIPRAISELOWER 12
/* window */
#define WKBD_RAISE 12
#define WKBD_LOWER 13
#define WKBD_RAISELOWER 14
#define WKBD_MOVERESIZE 15
#define WKBD_SHADE 16
#define WKBD_RAISE 13
#define WKBD_LOWER 14
#define WKBD_RAISELOWER 15
#define WKBD_MOVERESIZE 16
#define WKBD_SHADE 17
/* window, menu */
#define WKBD_CLOSE 17
#define WKBD_CLOSE 18
/* window */
#define WKBD_FOCUSNEXT 18
#define WKBD_FOCUSPREV 19
#define WKBD_FOCUSNEXT 19
#define WKBD_FOCUSPREV 20
#define WKBD_WORKSPACE1 21
#define WKBD_WORKSPACE2 22
@@ -78,10 +79,10 @@
#define WKBD_SWITCH_SCREEN 45
#ifdef KEEP_XKB_LOCK_STATUS
# define WKBD_TOGGLE 46
# define WKBD_LAST 47
# define WKBD_TOGGLE 46
# define WKBD_LAST 47
#else
# define WKBD_LAST 46
# define WKBD_LAST 46
#endif /* KEEP_XKB_LOCK_STATUS */

View File

@@ -338,6 +338,7 @@ static void
clearSessionCommand(WMenu *menu, WMenuEntry *entry)
{
wSessionClearState(menu->frame->screen_ptr);
wScreenSaveState(menu->frame->screen_ptr);
}

View File

@@ -29,7 +29,7 @@
#include <WINGs/WUtil.h>
#ifdef XINERAMA
#include <X11/Xinerama.h>
#include <X11/extensions/Xinerama.h>
#endif

View File

@@ -50,15 +50,16 @@
#define MC_MINIATURIZE 1
#define MC_SHADE 2
#define MC_HIDE 3
#define MC_MOVERESIZE 4
#define MC_SELECT 5
#define MC_DUMMY_MOVETO 6
#define MC_PROPERTIES 7
#define MC_OPTIONS 8
#define MC_SHORTCUT 8
#define MC_HIDE_OTHERS 4
#define MC_MOVERESIZE 5
#define MC_SELECT 6
#define MC_DUMMY_MOVETO 7
#define MC_PROPERTIES 8
#define MC_OPTIONS 9
#define MC_SHORTCUT 9
#define MC_CLOSE 9
#define MC_KILL 10
#define MC_CLOSE 10
#define MC_KILL 11
#define WO_KEEP_ON_TOP 0
@@ -177,6 +178,10 @@ execMenuCommand(WMenu *menu, WMenuEntry *entry)
wHideApplication(wapp);
break;
case MC_HIDE_OTHERS:
wHideOtherApplications(wwin);
break;
}
}
@@ -442,7 +447,6 @@ createWindowMenu(WScreen *scr)
}
entry = wMenuAddCallback(menu, _("Miniaturize"), execMenuCommand, NULL);
if (wKeyBindings[WKBD_MINIATURIZE].keycode!=0) {
kcode = wKeyBindings[WKBD_MINIATURIZE].keycode;
@@ -466,6 +470,14 @@ createWindowMenu(WScreen *scr)
entry->rtext = wstrdup(tmp);
}
entry = wMenuAddCallback(menu, _("Hide Others"), execMenuCommand, NULL);
if (wKeyBindings[WKBD_HIDE_OTHERS].keycode!=0) {
kcode = wKeyBindings[WKBD_HIDE_OTHERS].keycode;
if (kcode && (tmp = XKeysymToString(XKeycodeToKeysym(dpy, kcode, 0))))
entry->rtext = wstrdup(tmp);
}
entry = wMenuAddCallback(menu, _("Resize/Move"), execMenuCommand, NULL);
if (wKeyBindings[WKBD_MOVERESIZE].keycode!=0) {
kcode = wKeyBindings[WKBD_MOVERESIZE].keycode;