1
0
mirror of https://github.com/gryf/gryf-overlay.git synced 2025-12-28 09:22:33 +01:00

wmaker: Fixed toggling maximize. Added new way for detecting heads

This commit is contained in:
2017-01-16 21:34:11 +01:00
parent 3faa3516e4
commit d5821d7eee
2 changed files with 71 additions and 29 deletions

View File

@@ -1,4 +1,4 @@
AUX windowmaker-0.95.7-window_head_cycle.patch 7731 SHA256 0a4244a80143122aecfac2c475177dd5471019266d70ecf4942fe241fc73f247 SHA512 162cad0bf2a38201f0dec0160cab50cc15db487ef0bf433850a6106944edccea0e5a7f5a1ed0e852518a8156230e39c4c02cc5aba71349b38852dd1510bc7186 WHIRLPOOL d2e433b05ecc8a28d16a9a87ba3ae4e307949f301af220d39e0c4f685109d57e4511a0d08a0b1b4abc56b72a87303e1f7b62e004cb2d58e54c6b99cce4f3976a
AUX windowmaker-0.95.7-window_head_cycle.patch 8839 SHA256 bb0b443ee461aed24c088a07ab4e3ee7494d6709ea58771da6c26bc868a9f668 SHA512 5150c799afd7d031b80a5f977b6794bf9d9641c79b5fcb09d3fa412f1fceeb53154ac15b1be9ba027bc760b7244bcdb5afca87a189b8e6f8291e32cfb716f6ae WHIRLPOOL 876d2c033368e0bd22f98fe2168ec6ec0129be3f9d5ffe5f3611a6dae329559aebf5f434c2b89fb3328b0401ebd20cf7ad1ad3aad3da080f367be454bbda3df2
AUX wmaker.desktop 206 SHA256 b17a028d32c5b174ce5a64624b26f0830db4fec3bdc0b03c5c0870b936683f43 SHA512 d1dc99aa29047434e1265c8f93ce366b7c026f27eec8a166904fda1ab4144e0d6142807ac09ba6cbcb86480257893e5553046a0ba1a8e1d6315f23dd8468482b WHIRLPOOL d2bd3bbf8f262cccd838a3dd53c0017b500507e8a2a8e2dbaea4fa060084db078f0f6eef0a971cfda6fc4015a65ce4afa61de1a53b9115730014f3497ba77c0d
DIST WindowMaker-0.95.7.tar.gz 3238325 SHA256 842d486c4b212b19d10dbae2c315c6ff20c6e651471eaa45214b3b832d8097a9 SHA512 9c1190503efdc58c11a90d5ba80796979cdc9f2beb69a6d233ffc8d531a54c877c5270841bf6318738069098cd488e5ab77ac19f661ac888e892bf05ac22d93f WHIRLPOOL 090efc24fe47487b5f9ec68e821b0fea789ac4f7badccf639a5910f463613381701c6750db29f98e6777207387850e0c47324ffc8fcc1d1b4fe60ac05c05c25d
DIST WindowMaker-extra-0.1.tar.gz 238018 SHA256 acd6e1fb790485b107daf2b710da372367b41383c55d9c8bdfdac521d850edc4 SHA512 0fe9b3ffc093942db167d8a01e15c0f6741f3a40959d1434ea4f23e7b9d4a9c13935a61eabef9691e5fdfd4e407564caafce15c2d65d66499960a6764a874ab8 WHIRLPOOL f2c61b318f64a2debb727ae79dfa1bb8101888bc9492633a96ace0e704c731c383e92882c871622987d5971b919359c066638fba05c5dade330fe3bee21bb034

View File

@@ -1,5 +1,5 @@
diff --git a/src/actions.c b/src/actions.c
index 5adfab4..5ac98c6 100644
index 5adfab4..f6bb009 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -354,7 +354,7 @@ void update_saved_geometry(WWindow *wwin)
@@ -33,7 +33,7 @@ index 5adfab4..5ac98c6 100644
/* Only save directions, not kbd or xinerama hints */
directions &= (MAX_HORIZONTAL | MAX_VERTICAL | MAX_LEFTHALF | MAX_RIGHTHALF | MAX_TOPHALF | MAX_BOTTOMHALF | MAX_MAXIMUS);
@@ -497,20 +484,51 @@ void handleMaximize(WWindow *wwin, int directions)
@@ -497,13 +484,38 @@ void handleMaximize(WWindow *wwin, int directions)
int requested = directions & (MAX_HORIZONTAL | MAX_VERTICAL | MAX_LEFTHALF | MAX_RIGHTHALF | MAX_TOPHALF | MAX_BOTTOMHALF | MAX_MAXIMUS);
int effective = requested ^ current;
int flags = directions & ~requested;
@@ -46,38 +46,35 @@ index 5adfab4..5ac98c6 100644
!(requested & MAX_MAXIMUS))
- wMaximizeWindow(wwin, MAX_MAXIMUS | flags);
- else
- wUnmaximizeWindow(wwin);
+ wMaximizeWindow(wwin, MAX_MAXIMUS | flags, head);
+ else {
+ if (requested & MAX_LEFTHALF && current & MAX_LEFTHALF) {
+ p.x = wwin->frame_x - 100;
+ p.y = 0;
+ else if (requested & MAX_LEFTHALF && current & MAX_LEFTHALF) {
+ p.x = wwin->frame_x - 100;
+ p.y = 0;
+
+ if (p.x > 0) {
+ head = wGetHeadForPoint(wwin->screen_ptr, p);
+ if (head != wGetHeadForWindow(wwin)) {
+ effective |= MAX_RIGHTHALF;
+ effective |= MAX_VERTICAL;
+ effective &= ~(MAX_HORIZONTAL | MAX_LEFTHALF);
+ wMaximizeWindow(wwin, effective | flags, head);
+ }
+ }
+ }
+ else if (requested & MAX_RIGHTHALF && current & MAX_RIGHTHALF) {
+ p.x = wwin->frame_x + wwin->frame->core->width + 100;
+ p.y = 0;
+ head = wGetHeadForPoint(wwin->screen_ptr, p);
+ if (head != wGetHeadForWindow(wwin)) {
+ effective |= MAX_LEFTHALF;
+ effective |= MAX_VERTICAL;
+ effective &= ~(MAX_HORIZONTAL | MAX_RIGHTHALF);
+ if (p.x > 0) {
+ head = wGetHeadForPointOrNegative(wwin->screen_ptr, p);
+ if (head != -1) {
+ effective |= MAX_RIGHTHALF;
+ effective |= MAX_VERTICAL;
+ effective &= ~(MAX_HORIZONTAL | MAX_LEFTHALF);
+ wMaximizeWindow(wwin, effective | flags, head);
+ }
+ }
+ }
+ } else if (requested & MAX_RIGHTHALF && current & MAX_RIGHTHALF) {
+ p.x = wwin->frame_x + wwin->frame->core->width + 100;
+ p.y = 0;
+ head = wGetHeadForPointOrNegative(wwin->screen_ptr, p);
+ if (head != -1) {
+ effective |= MAX_LEFTHALF;
+ effective |= MAX_VERTICAL;
+ effective &= ~(MAX_HORIZONTAL | MAX_RIGHTHALF);
+ wMaximizeWindow(wwin, effective | flags, head);
+ }
+ } else
wUnmaximizeWindow(wwin);
/* these alone mean vertical|horizontal toggle */
} else if ((effective == MAX_LEFTHALF) ||
(effective == MAX_RIGHTHALF) ||
@@ -511,6 +523,10 @@ void handleMaximize(WWindow *wwin, int directions)
(effective == MAX_TOPHALF) ||
(effective == MAX_BOTTOMHALF))
wUnmaximizeWindow(wwin);
@@ -88,7 +85,7 @@ index 5adfab4..5ac98c6 100644
else {
if ((requested == (MAX_HORIZONTAL | MAX_VERTICAL)) ||
(requested == MAX_MAXIMUS))
@@ -552,7 +570,7 @@ void handleMaximize(WWindow *wwin, int directions)
@@ -552,7 +568,7 @@ void handleMaximize(WWindow *wwin, int directions)
effective &= ~(MAX_TOPHALF | MAX_BOTTOMHALF);
effective &= ~MAX_MAXIMUS;
}
@@ -202,3 +199,48 @@ index 9b56f96..96ba984 100644
}
}
updateStateHint(wwin, False, False);
diff --git a/src/xinerama.c b/src/xinerama.c
index 3d26139..4acbc3e 100644
--- a/src/xinerama.c
+++ b/src/xinerama.c
@@ -236,7 +236,7 @@ int wGetHeadForWindow(WWindow * wwin)
return wGetHeadForRect(wwin->screen_ptr, rect);
}
-int wGetHeadForPoint(WScreen * scr, WMPoint point)
+int wGetHeadForPointOrNegative(WScreen * scr, WMPoint point)
{
int i;
@@ -247,7 +247,17 @@ int wGetHeadForPoint(WScreen * scr, WMPoint point)
(unsigned)(point.y - rect->pos.y) < rect->size.height)
return i;
}
- return scr->xine_info.primary_head;
+ return -1;
+}
+
+int wGetHeadForPoint(WScreen * scr, WMPoint point)
+{
+ int head = wGetHeadForPointOrNegative(scr, point);
+
+ if (head < 0)
+ return scr->xine_info.primary_head;
+
+ return head;
}
int wGetHeadForPointerLocation(WScreen * scr)
diff --git a/src/xinerama.h b/src/xinerama.h
index fd1d469..88a3580 100644
--- a/src/xinerama.h
+++ b/src/xinerama.h
@@ -41,6 +41,8 @@ int wGetHeadForRect(WScreen *scr, WMRect rect);
int wGetHeadForWindow(WWindow *wwin);
+int wGetHeadForPointOrNegative(WScreen * scr, WMPoint point);
+
int wGetHeadForPoint(WScreen *scr, WMPoint point);
int wGetHeadForPointerLocation(WScreen *scr);