1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 04:20:27 +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" },
{ 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 */
char cycle_active_head_only; /* Cycle only windows on the active head */
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 panel_only_open; /* Only open the switch panel; don't switch */
int minipreview_size; /* Size of Mini-Previews in pixels */

View File

@@ -825,7 +825,9 @@ WDefaultEntry optionList[] = {
{"CycleActiveHeadOnly", "NO", NULL,
&wPreferences.cycle_active_head_only, getBool, NULL, NULL, 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)

View File

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