mirror of
https://github.com/gryf/wmaker.git
synced 2026-04-24 17:41:26 +02:00
Compare commits
4 Commits
258ffc8b97
...
18a539b372
| Author | SHA1 | Date | |
|---|---|---|---|
| 18a539b372 | |||
| eae9200c5d | |||
| 25cb9d208a | |||
| 23471b2e21 |
+4
-3
@@ -4,6 +4,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 2014-2023 Window Maker Team
|
* Copyright (c) 2014-2023 Window Maker Team
|
||||||
* Copyright (c) 1998-2003 Alfredo K. Kojima
|
* Copyright (c) 1998-2003 Alfredo K. Kojima
|
||||||
|
* Copyright (c) 2009-2023 Window Maker Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -88,7 +89,7 @@ static struct expert_option {
|
|||||||
/* default: */ False, OPTION_WMAKER, "KbdModeLock" },
|
/* default: */ False, OPTION_WMAKER, "KbdModeLock" },
|
||||||
#endif /* XKB_MODELOCK */
|
#endif /* XKB_MODELOCK */
|
||||||
|
|
||||||
{ N_("Maximize (snap) a window to edge or corner by dragging."),
|
{ N_("Snap a window to edge or corner by dragging."),
|
||||||
/* default: */ False, OPTION_WMAKER, "WindowSnapping" },
|
/* default: */ False, OPTION_WMAKER, "WindowSnapping" },
|
||||||
|
|
||||||
{ N_("Distance from edge to begin window snap."),
|
{ N_("Distance from edge to begin window snap."),
|
||||||
@@ -97,7 +98,7 @@ static struct expert_option {
|
|||||||
{ N_("Distance from corner to begin window snap."),
|
{ N_("Distance from corner to begin window snap."),
|
||||||
/* default: */ 10, OPTION_WMAKER_INT, "SnapCornerDetect" },
|
/* default: */ 10, OPTION_WMAKER_INT, "SnapCornerDetect" },
|
||||||
|
|
||||||
{ N_("Snapping a window to the top maximizes it to the full screen."),
|
{ N_("Snap a window to the top to maximize it to the full screen."),
|
||||||
/* default: */ False, OPTION_WMAKER, "SnapToTopMaximizesFullscreen" },
|
/* default: */ False, OPTION_WMAKER, "SnapToTopMaximizesFullscreen" },
|
||||||
|
|
||||||
{ N_("Allow move half-maximized windows between multiple screens."),
|
{ N_("Allow move half-maximized windows between multiple screens."),
|
||||||
@@ -115,7 +116,7 @@ static struct expert_option {
|
|||||||
{ 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."),
|
{ N_("Double click on titlebar maximizes/minimizes a window to/from full screen."),
|
||||||
/* default: */ False, OPTION_WMAKER, "DbClickFullScreen" },
|
/* default: */ False, OPTION_WMAKER, "DbClickFullScreen" },
|
||||||
|
|
||||||
{ N_("Close rootmenu when mouse (left or right) is clicked outside focus."),
|
{ N_("Close rootmenu when mouse (left or right) is clicked outside focus."),
|
||||||
|
|||||||
@@ -84,11 +84,11 @@ static struct keyOption {
|
|||||||
{ "RHMaximizeKey", N_("Maximize active window right half") },
|
{ "RHMaximizeKey", N_("Maximize active window right half") },
|
||||||
{ "THMaximizeKey", N_("Maximize active window top half") },
|
{ "THMaximizeKey", N_("Maximize active window top half") },
|
||||||
{ "BHMaximizeKey", N_("Maximize active window bottom half") },
|
{ "BHMaximizeKey", N_("Maximize active window bottom half") },
|
||||||
{ "LTCMaximizeKey", N_("Maximize active window left top corner") },
|
{ "TLCMaximizeKey", N_("Maximize active window top left corner") },
|
||||||
{ "RTCMaximizeKey", N_("Maximize active window right top corner") },
|
{ "TRCMaximizeKey", N_("Maximize active window top right corner") },
|
||||||
{ "LBCMaximizeKey", N_("Maximize active window left bottom corner") },
|
{ "BLCMaximizeKey", N_("Maximize active window bottom left corner") },
|
||||||
{ "RBCMaximizeKey", N_("Maximize active window right bottom corner") },
|
{ "BRCMaximizeKey", N_("Maximize active window bottom right corner") },
|
||||||
{ "MaximusKey", N_("Maximus: Tiled maximization ") },
|
{ "MaximusKey", N_("Tile active window") },
|
||||||
{ "KeepOnTopKey", N_("Toggle window on top status") },
|
{ "KeepOnTopKey", N_("Toggle window on top status") },
|
||||||
{ "KeepAtBottomKey",N_("Toggle window at bottom status") },
|
{ "KeepAtBottomKey",N_("Toggle window at bottom status") },
|
||||||
{ "OmnipresentKey", N_("Toggle window omnipresent status") },
|
{ "OmnipresentKey", N_("Toggle window omnipresent status") },
|
||||||
|
|||||||
@@ -171,10 +171,10 @@
|
|||||||
RHMaximizeKey = None;
|
RHMaximizeKey = None;
|
||||||
THMaximizeKey = None;
|
THMaximizeKey = None;
|
||||||
BHMaximizeKey = None;
|
BHMaximizeKey = None;
|
||||||
LTCMaximizeKey = None;
|
TLCMaximizeKey = None;
|
||||||
RTCMaximizeKey = None;
|
TRCMaximizeKey = None;
|
||||||
LBCMaximizeKey = None;
|
BLCMaximizeKey = None;
|
||||||
RBCMaximizeKey = None;
|
BRCMaximizeKey = None;
|
||||||
MaximusKey = None;
|
MaximusKey = None;
|
||||||
KeepOnTopKey = None;
|
KeepOnTopKey = None;
|
||||||
KeepAtBottomKey = None;
|
KeepAtBottomKey = None;
|
||||||
|
|||||||
+4
-4
@@ -662,13 +662,13 @@ WDefaultEntry optionList[] = {
|
|||||||
NULL, getKeybind, setKeyGrab, NULL, NULL},
|
NULL, getKeybind, setKeyGrab, NULL, NULL},
|
||||||
{"BHMaximizeKey", "None", (void*)WKBD_BHMAXIMIZE,
|
{"BHMaximizeKey", "None", (void*)WKBD_BHMAXIMIZE,
|
||||||
NULL, getKeybind, setKeyGrab, NULL, NULL},
|
NULL, getKeybind, setKeyGrab, NULL, NULL},
|
||||||
{"LTCMaximizeKey", "None", (void*)WKBD_LTCMAXIMIZE,
|
{"TLCMaximizeKey", "None", (void*)WKBD_LTCMAXIMIZE,
|
||||||
NULL, getKeybind, setKeyGrab, NULL, NULL},
|
NULL, getKeybind, setKeyGrab, NULL, NULL},
|
||||||
{"RTCMaximizeKey", "None", (void*)WKBD_RTCMAXIMIZE,
|
{"TRCMaximizeKey", "None", (void*)WKBD_RTCMAXIMIZE,
|
||||||
NULL, getKeybind, setKeyGrab, NULL, NULL},
|
NULL, getKeybind, setKeyGrab, NULL, NULL},
|
||||||
{"LBCMaximizeKey", "None", (void*)WKBD_LBCMAXIMIZE,
|
{"BLCMaximizeKey", "None", (void*)WKBD_LBCMAXIMIZE,
|
||||||
NULL, getKeybind, setKeyGrab, NULL, NULL},
|
NULL, getKeybind, setKeyGrab, NULL, NULL},
|
||||||
{"RBCMaximizeKey", "None", (void*)WKBD_RBCMAXIMIZE,
|
{"BRCMaximizeKey", "None", (void*)WKBD_RBCMAXIMIZE,
|
||||||
NULL, getKeybind, setKeyGrab, NULL, NULL},
|
NULL, getKeybind, setKeyGrab, NULL, NULL},
|
||||||
{"MaximusKey", "None", (void*)WKBD_MAXIMUS,
|
{"MaximusKey", "None", (void*)WKBD_MAXIMUS,
|
||||||
NULL, getKeybind, setKeyGrab, NULL, NULL},
|
NULL, getKeybind, setKeyGrab, NULL, NULL},
|
||||||
|
|||||||
+28
-28
@@ -3,6 +3,7 @@
|
|||||||
* Window Maker window manager
|
* Window Maker window manager
|
||||||
*
|
*
|
||||||
* Copyright (c) 1997-2003 Alfredo K. Kojima
|
* Copyright (c) 1997-2003 Alfredo K. Kojima
|
||||||
|
* Copyright (c) 2008-2023 Window Maker Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -1900,25 +1901,20 @@ void wWindowConstrainSize(WWindow *wwin, unsigned int *nwidth, unsigned int *nhe
|
|||||||
int baseW = 0;
|
int baseW = 0;
|
||||||
int baseH = 0;
|
int baseH = 0;
|
||||||
|
|
||||||
/*
|
|
||||||
* X11 proto defines width and height as a CARD16
|
|
||||||
* if window size is guaranteed to fail, failsafe to a reasonable size
|
|
||||||
*/
|
|
||||||
if (width > USHRT_MAX && height > USHRT_MAX) {
|
|
||||||
width = 640;
|
|
||||||
height = 480;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (wwin->normal_hints) {
|
if (wwin->normal_hints) {
|
||||||
if (!wwin->flags.maximized) {
|
if (!wwin->flags.maximized) {
|
||||||
winc = wwin->normal_hints->width_inc;
|
winc = wwin->normal_hints->width_inc;
|
||||||
hinc = wwin->normal_hints->height_inc;
|
hinc = wwin->normal_hints->height_inc;
|
||||||
}
|
}
|
||||||
minW = wwin->normal_hints->min_width;
|
if (wwin->normal_hints->min_width > minW)
|
||||||
minH = wwin->normal_hints->min_height;
|
minW = wwin->normal_hints->min_width;
|
||||||
maxW = wwin->normal_hints->max_width;
|
if (wwin->normal_hints->min_height > minH)
|
||||||
maxH = wwin->normal_hints->max_height;
|
minH = wwin->normal_hints->min_height;
|
||||||
|
if (wwin->normal_hints->max_width < maxW)
|
||||||
|
maxW = wwin->normal_hints->max_width;
|
||||||
|
if (wwin->normal_hints->max_height < maxH)
|
||||||
|
maxH = wwin->normal_hints->max_height;
|
||||||
|
|
||||||
if (wwin->normal_hints->flags & PAspect) {
|
if (wwin->normal_hints->flags & PAspect) {
|
||||||
minAX = wwin->normal_hints->min_aspect.x;
|
minAX = wwin->normal_hints->min_aspect.x;
|
||||||
minAY = wwin->normal_hints->min_aspect.y;
|
minAY = wwin->normal_hints->min_aspect.y;
|
||||||
@@ -1937,11 +1933,14 @@ void wWindowConstrainSize(WWindow *wwin, unsigned int *nwidth, unsigned int *nhe
|
|||||||
height = minH;
|
height = minH;
|
||||||
|
|
||||||
/* if only one dimension is over the top, set a default 4/3 ratio */
|
/* if only one dimension is over the top, set a default 4/3 ratio */
|
||||||
if (width > maxW && height < maxH) {
|
if (width > maxW && height < maxH)
|
||||||
width = height * 4 / 3;
|
width = height * 4 / 3;
|
||||||
} else {
|
else if(height > maxH && width < maxW)
|
||||||
if(height > maxH && width < maxW)
|
height = width * 3 / 4;
|
||||||
height = width * 3 / 4;
|
else if(width > maxW && height > maxH) {
|
||||||
|
/* if both are over the top, set size to almost fullscreen */
|
||||||
|
height = wwin->screen_ptr->scr_height - 2 * wPreferences.icon_size;
|
||||||
|
width = wwin->screen_ptr->scr_width - 2 * wPreferences.icon_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* aspect ratio code borrowed from olwm */
|
/* aspect ratio code borrowed from olwm */
|
||||||
@@ -2149,12 +2148,6 @@ void wWindowConfigure(WWindow *wwin, int req_x, int req_y, int req_width, int re
|
|||||||
int resize;
|
int resize;
|
||||||
|
|
||||||
resize = (req_width != wwin->client.width || req_height != wwin->client.height);
|
resize = (req_width != wwin->client.width || req_height != wwin->client.height);
|
||||||
/*
|
|
||||||
* if the window is being moved but not resized then
|
|
||||||
* send a synthetic ConfigureNotify
|
|
||||||
*/
|
|
||||||
if ((req_x != wwin->frame_x || req_y != wwin->frame_y) && !resize)
|
|
||||||
synth_notify = True;
|
|
||||||
|
|
||||||
if (WFLAGP(wwin, dont_move_off))
|
if (WFLAGP(wwin, dont_move_off))
|
||||||
wScreenBringInside(wwin->screen_ptr, &req_x, &req_y, req_width, req_height);
|
wScreenBringInside(wwin->screen_ptr, &req_x, &req_y, req_width, req_height);
|
||||||
@@ -2191,10 +2184,17 @@ void wWindowConfigure(WWindow *wwin, int req_x, int req_y, int req_width, int re
|
|||||||
wwin->client.width = req_width;
|
wwin->client.width = req_width;
|
||||||
wwin->client.height = req_height;
|
wwin->client.height = req_height;
|
||||||
} else {
|
} else {
|
||||||
wwin->client.x = req_x;
|
if (req_x != wwin->frame_x || req_y != wwin->frame_y) {
|
||||||
wwin->client.y = req_y + wwin->frame->top_width;
|
wwin->client.x = req_x;
|
||||||
|
wwin->client.y = req_y + wwin->frame->top_width;
|
||||||
XMoveWindow(dpy, wwin->frame->core->window, req_x, req_y);
|
XMoveWindow(dpy, wwin->frame->core->window, req_x, req_y);
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* if the window is being moved but not resized
|
||||||
|
* or if we change nothing then
|
||||||
|
* send a synthetic ConfigureNotify
|
||||||
|
*/
|
||||||
|
synth_notify = True;
|
||||||
}
|
}
|
||||||
wwin->frame_x = req_x;
|
wwin->frame_x = req_x;
|
||||||
wwin->frame_y = req_y;
|
wwin->frame_y = req_y;
|
||||||
|
|||||||
Reference in New Issue
Block a user