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

Add key binding to minimize all windows

MinimizeAllKey - minimize all windows on current workspace.

Original-patch-by: Pavel S. Khmelinsky <hmepas@yauza.ru>
Signed-off-by: Alexey I. Froloff <raorn@altlinux.org>

[crmafra: AllMinimizeKey --> MinimizeAllKey]
This commit is contained in:
Alexey I. Froloff
2010-09-10 20:51:05 +04:00
committed by Carlos R. Mafra
parent ca1c29cd98
commit f41db5b5be
5 changed files with 56 additions and 0 deletions

View File

@@ -1216,6 +1216,54 @@ static void hideWindow(WIcon *icon, int icon_x, int icon_y, WWindow *wwin, int a
WMPostNotificationName(WMNChangedState, wwin, "hide");
}
void wHideAll(WScreen *scr)
{
WWindow *wwin;
WWindow **windows;
Window FocusedWin;
WMenu *menu;
unsigned int wcount = 0;
int FocusState;
int i;
if (!scr)
return;
menu = scr->switch_menu;
windows = malloc(sizeof(WWindow *));
if (menu != NULL) {
for (i = 0; i < menu->entry_no; i++) {
windows[wcount] = (WWindow *) menu->entries[i]->clientdata;
wcount++;
windows = realloc(windows, sizeof(WWindow *) * (wcount+1));
}
} else {
wwin = scr->focused_window;
while (wwin) {
windows[wcount] = wwin;
wcount++;
windows = realloc(windows, sizeof(WWindow *) * (wcount+1));
wwin = wwin->prev;
}
}
for (i = 0; i < wcount; i++) {
wwin = windows[i];
if (wwin->frame->workspace == scr->current_workspace
&& !(wwin->flags.miniaturized || wwin->flags.hidden)
&& !wwin->flags.internal_window
&& !WFLAGP(wwin, no_miniaturizable)
) {
wwin->flags.skip_next_animation = 1;
wIconifyWindow(wwin);
}
}
}
void wHideOtherApplications(WWindow *awin)
{
WWindow *wwin;

View File

@@ -53,6 +53,7 @@ void wUnselectWindows(WScreen *scr);
void wMaximizeWindow(WWindow *wwin, int directions);
void wUnmaximizeWindow(WWindow *wwin);
void wHideAll(WScreen *src);
void wHideOtherApplications(WWindow *wwin);
void wShowAllWindows(WScreen *scr);

View File

@@ -516,6 +516,8 @@ WDefaultEntry optionList[] = {
NULL, getKeybind, setKeyGrab, NULL, NULL},
{"MiniaturizeKey", "None", (void *)WKBD_MINIATURIZE,
NULL, getKeybind, setKeyGrab, NULL, NULL},
{"MinimizeAllKey", "None", (void *)WKBD_MINIMIZEALL,
NULL, getKeybind, setKeyGrab, NULL, NULL },
{"HideKey", "None", (void *)WKBD_HIDE,
NULL, getKeybind, setKeyGrab, NULL, NULL},
{"HideOthersKey", "None", (void *)WKBD_HIDE_OTHERS,

View File

@@ -1402,6 +1402,10 @@ static void handleKeyPress(XEvent * event)
if (ISMAPPED(wwin) && ISFOCUSED(wwin))
OpenWindowMenu(wwin, wwin->frame_x, wwin->frame_y + wwin->frame->top_width, True);
break;
case WKBD_MINIMIZEALL:
CloseWindowMenu(scr);
wHideAll(scr);
break;
case WKBD_MINIATURIZE:
if (ISMAPPED(wwin) && ISFOCUSED(wwin)
&& !WFLAGP(wwin, no_miniaturizable)) {

View File

@@ -30,6 +30,7 @@ enum {
/* window */
WKBD_MINIATURIZE,
WKBD_MINIMIZEALL,
WKBD_HIDE,
WKBD_HIDE_OTHERS,
WKBD_MAXIMIZE,