1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-03-26 15:03:34 +01:00

4 Commits

Author SHA1 Message Date
David Maciejak
18a539b372 Add some more cases to handle window unusual size request
As discussed on the ML, the test to check for CARD16 limit is probably innacurate.
Check instead for maxH and maxW which are set by default to twice the size
of the screen or to the max values passed by the window normal hints property.
2023-03-16 15:02:18 +00:00
David Maciejak
eae9200c5d Fix ICCM ConfigureNotify request
According to ICCM specs at [1]

*Not changing the size, location, border width, or stacking order of the window at all.
A client will receive a synthetic ConfigureNotify event that describes the (unchanged)
geometry of the window. The (x,y) coordinates will be in the root coordinate system,
adjusted for the border width the client requested, irrespective of any reparenting
that has taken place. The border_width will be the border width the client requested.
The client will not receive a real ConfigureNotify event because no change has actually
taken place.

*Moving or restacking the window without resizing it or changing its border width.
A client will receive a synthetic ConfigureNotify event following the change that
describes the new geometry of the window. The event's (x,y) coordinates will be in
the root coordinate system adjusted for the border width the client requested.
The border_width will be the border width the client requested. The client may not
receive a real ConfigureNotify event that describes this change because the window
manager may have reparented the top-level window. If the client does receive a
real event, the synthetic event will follow the real one.

*Resizing the window or changing its border width
(regardless of whether the window was also moved or restacked).
A client that has selected for StructureNotify events will receive a real
ConfigureNotify event.
Note that the coordinates in this event are relative to the parent,
which may not be the root if the window has been reparented. The coordinates will
reflect the actual border width of the window (which the window manager may have
changed). The TranslateCoordinates request can be used to convert the coordinates
if required.

In Window Maker, the first case is not implemented: doing a synthetic ConfigureNotify
to notify no changes were done. That's creating some issues with app like Citrix icaclient
when sometime windows are blank and need to be moved to be refreshed.

[1]https://x.org/releases/X11R7.6/doc/xorg-docs/specs/ICCCM/icccm.html#configuring_the_window
2023-03-16 15:02:18 +00:00
David Maciejak
25cb9d208a Update window.c copyright
Just updating the copyright line in the file header.
2023-03-16 15:02:18 +00:00
David Maciejak
23471b2e21 WPrefs: update maximization feature descriptions
Align the old maximization descriptions to the new visual indicator
names. The internal shortcut names had also been updated, meaning a
reconfiguration of the shortcuts in WPrefs is required.
2023-03-16 11:36:02 +00:00
5 changed files with 45 additions and 44 deletions

View File

@@ -4,6 +4,7 @@
*
* Copyright (c) 2014-2023 Window Maker Team
* 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
* 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" },
#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" },
{ N_("Distance from edge to begin window snap."),
@@ -97,7 +98,7 @@ static struct expert_option {
{ N_("Distance from corner to begin window snap."),
/* 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" },
{ 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."),
/* 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" },
{ N_("Close rootmenu when mouse (left or right) is clicked outside focus."),

View File

@@ -84,11 +84,11 @@ static struct keyOption {
{ "RHMaximizeKey", N_("Maximize active window right half") },
{ "THMaximizeKey", N_("Maximize active window top half") },
{ "BHMaximizeKey", N_("Maximize active window bottom half") },
{ "LTCMaximizeKey", N_("Maximize active window left top corner") },
{ "RTCMaximizeKey", N_("Maximize active window right top corner") },
{ "LBCMaximizeKey", N_("Maximize active window left bottom corner") },
{ "RBCMaximizeKey", N_("Maximize active window right bottom corner") },
{ "MaximusKey", N_("Maximus: Tiled maximization ") },
{ "TLCMaximizeKey", N_("Maximize active window top left corner") },
{ "TRCMaximizeKey", N_("Maximize active window top right corner") },
{ "BLCMaximizeKey", N_("Maximize active window bottom left corner") },
{ "BRCMaximizeKey", N_("Maximize active window bottom right corner") },
{ "MaximusKey", N_("Tile active window") },
{ "KeepOnTopKey", N_("Toggle window on top status") },
{ "KeepAtBottomKey",N_("Toggle window at bottom status") },
{ "OmnipresentKey", N_("Toggle window omnipresent status") },

View File

@@ -171,10 +171,10 @@
RHMaximizeKey = None;
THMaximizeKey = None;
BHMaximizeKey = None;
LTCMaximizeKey = None;
RTCMaximizeKey = None;
LBCMaximizeKey = None;
RBCMaximizeKey = None;
TLCMaximizeKey = None;
TRCMaximizeKey = None;
BLCMaximizeKey = None;
BRCMaximizeKey = None;
MaximusKey = None;
KeepOnTopKey = None;
KeepAtBottomKey = None;

View File

@@ -662,13 +662,13 @@ WDefaultEntry optionList[] = {
NULL, getKeybind, setKeyGrab, NULL, NULL},
{"BHMaximizeKey", "None", (void*)WKBD_BHMAXIMIZE,
NULL, getKeybind, setKeyGrab, NULL, NULL},
{"LTCMaximizeKey", "None", (void*)WKBD_LTCMAXIMIZE,
{"TLCMaximizeKey", "None", (void*)WKBD_LTCMAXIMIZE,
NULL, getKeybind, setKeyGrab, NULL, NULL},
{"RTCMaximizeKey", "None", (void*)WKBD_RTCMAXIMIZE,
{"TRCMaximizeKey", "None", (void*)WKBD_RTCMAXIMIZE,
NULL, getKeybind, setKeyGrab, NULL, NULL},
{"LBCMaximizeKey", "None", (void*)WKBD_LBCMAXIMIZE,
{"BLCMaximizeKey", "None", (void*)WKBD_LBCMAXIMIZE,
NULL, getKeybind, setKeyGrab, NULL, NULL},
{"RBCMaximizeKey", "None", (void*)WKBD_RBCMAXIMIZE,
{"BRCMaximizeKey", "None", (void*)WKBD_RBCMAXIMIZE,
NULL, getKeybind, setKeyGrab, NULL, NULL},
{"MaximusKey", "None", (void*)WKBD_MAXIMUS,
NULL, getKeybind, setKeyGrab, NULL, NULL},

View File

@@ -3,6 +3,7 @@
* Window Maker window manager
*
* 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
* 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 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->flags.maximized) {
winc = wwin->normal_hints->width_inc;
hinc = wwin->normal_hints->height_inc;
}
minW = wwin->normal_hints->min_width;
minH = wwin->normal_hints->min_height;
maxW = wwin->normal_hints->max_width;
maxH = wwin->normal_hints->max_height;
if (wwin->normal_hints->min_width > minW)
minW = wwin->normal_hints->min_width;
if (wwin->normal_hints->min_height > minH)
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) {
minAX = wwin->normal_hints->min_aspect.x;
minAY = wwin->normal_hints->min_aspect.y;
@@ -1937,11 +1933,14 @@ void wWindowConstrainSize(WWindow *wwin, unsigned int *nwidth, unsigned int *nhe
height = minH;
/* 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;
} else {
if(height > maxH && width < maxW)
height = width * 3 / 4;
else if(height > maxH && width < maxW)
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 */
@@ -2149,12 +2148,6 @@ void wWindowConfigure(WWindow *wwin, int req_x, int req_y, int req_width, int re
int resize;
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))
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.height = req_height;
} else {
wwin->client.x = req_x;
wwin->client.y = req_y + wwin->frame->top_width;
XMoveWindow(dpy, wwin->frame->core->window, req_x, req_y);
if (req_x != wwin->frame_x || req_y != wwin->frame_y) {
wwin->client.x = req_x;
wwin->client.y = req_y + wwin->frame->top_width;
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_y = req_y;