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

Double click on titlebar maximize a window to fullscreen

This commit is contained in:
Alexander Komarov
2020-08-10 13:47:23 +03:00
committed by Carlos R. Mafra
parent 5d2fd7bf7e
commit 6e2075f3df
4 changed files with 26 additions and 6 deletions

View File

@@ -113,7 +113,10 @@ static const struct {
/* default: */ False, OPTION_WMAKER, "OpenTransientOnOwnerWorkspace" }, /* default: */ False, OPTION_WMAKER, "OpenTransientOnOwnerWorkspace" },
{ N_("Wrap dock-attached icons around the screen edges."), { N_("Wrap dock-attached icons around the screen edges."),
/* default: */ True, OPTION_WMAKER, "WrapAppiconsInDock" } /* default: */ True, OPTION_WMAKER, "WrapAppiconsInDock" },
{ N_("Double click on titlebar maximize a window to full screen."),
/* default: */ False, OPTION_WMAKER, "DbClickFullScreen" }
}; };

View File

@@ -453,6 +453,7 @@ extern struct WPreferences {
int history_lines; /* history of "Run..." dialog */ int history_lines; /* history of "Run..." dialog */
char cycle_active_head_only; /* Cycle only windows on the active head */ char cycle_active_head_only; /* Cycle only windows on the active head */
char cycle_ignore_minimized; /* Ignore minimized windows when cycling */ char cycle_ignore_minimized; /* Ignore minimized windows when cycling */
char double_click_fullscreen; /* Double click on titlebar maximize a window to full screen*/
char strict_windoze_cycle; /* don't close switch panel when shift is released */ char strict_windoze_cycle; /* don't close switch panel when shift is released */
char panel_only_open; /* Only open the switch panel; don't switch */ char panel_only_open; /* Only open the switch panel; don't switch */
int minipreview_size; /* Size of Mini-Previews in pixels */ int minipreview_size; /* Size of Mini-Previews in pixels */

View File

@@ -825,7 +825,9 @@ WDefaultEntry optionList[] = {
{"CycleActiveHeadOnly", "NO", NULL, {"CycleActiveHeadOnly", "NO", NULL,
&wPreferences.cycle_active_head_only, getBool, NULL, NULL, NULL}, &wPreferences.cycle_active_head_only, getBool, NULL, NULL, NULL},
{"CycleIgnoreMinimized", "NO", NULL, {"CycleIgnoreMinimized", "NO", NULL,
&wPreferences.cycle_ignore_minimized, getBool, NULL, NULL, NULL} &wPreferences.cycle_ignore_minimized, getBool, NULL, NULL, NULL},
{"DbClickFullScreen", "NO", NULL,
&wPreferences.double_click_fullscreen, getBool, NULL, NULL, NULL}
}; };
static void initDefaults(void) static void initDefaults(void)

View File

@@ -2849,15 +2849,28 @@ static void titlebarDblClick(WCoreWindow *sender, void *data, XEvent *event)
event->xbutton.state &= w_global.shortcut.modifiers_mask; event->xbutton.state &= w_global.shortcut.modifiers_mask;
if (event->xbutton.button == Button1) { if (event->xbutton.button == Button1 ) {
if (event->xbutton.state == 0) { if (event->xbutton.state == 0 ) {
if (!WFLAGP(wwin, no_shadeable)) { if (!WFLAGP(wwin, no_shadeable) & !wPreferences.double_click_fullscreen) {
/* shade window */ /* shade window */
if (wwin->flags.shaded) if (wwin->flags.shaded)
wUnshadeWindow(wwin); wUnshadeWindow(wwin);
else else
wShadeWindow(wwin); wShadeWindow(wwin);
} }
}
if (wPreferences.double_click_fullscreen){
int dir = 0;
if (event->xbutton.state == 0) {
/* maximize window full screen*/
dir |= (MAX_VERTICAL|MAX_HORIZONTAL);
int ndir = dir ^ wwin->flags.maximized;
wMaximizeWindow(wwin, ndir, wGetHeadForWindow(wwin));
}
} else { } else {
int dir = 0; int dir = 0;
@@ -2871,6 +2884,7 @@ static void titlebarDblClick(WCoreWindow *sender, void *data, XEvent *event)
} }
/* maximize window */ /* maximize window */
if (dir != 0 && IS_RESIZABLE(wwin)) { if (dir != 0 && IS_RESIZABLE(wwin)) {
int ndir = dir ^ wwin->flags.maximized; int ndir = dir ^ wwin->flags.maximized;