Closed capn-damo closed 5 years ago
Can you test this, too? :smile: I think it is fixed, but I'm not sure how you reproduce this issue exactly.
Now that I switched to using the parent window (https://github.com/Unia/bunsen-utilities/commit/5bc730a6eaacb89ce92ae6ffc2b4bd0cae17c982), this issue is back:
~/code/bunsen-utilities master $= 12:54:57
> ./bl-aerosnap --right
Restoring to: 201 115 852 615
~/code/bunsen-utilities master $= 12:54:58
> cat /tmp/bl-aerosnap-1000
{}
~/code/bunsen-utilities master $= 12:55:01
> ./bl-aerosnap --right
Snapping window from : 201 115 852 629
Snapping window to: 683.0 0 683.0
~/code/bunsen-utilities master $= 12:55:03
> cat /tmp/bl-aerosnap-1000
{"<class 'Xlib.display.Window'>(0x00200543)-0": [201, 115, 852, 629]}
~/code/bunsen-utilities master $= 12:55:09
> ./bl-aerosnap --right
Restoring to: 201 115 852 629
~/code/bunsen-utilities master $= 12:55:15
> cat /tmp/bl-aerosnap-1000
{}
~/code/bunsen-utilities master $= 12:55:25
> ./bl-aerosnap --right
Snapping window from : 201 114 852 643
Snapping window to: 683.0 0 683.0
Cumulative snapping increases the height by (in my case, perhaps this is my window frame's height) 14 pixels every time.
Indeed, this ugly hack resolves my issue:
diff --git a/bl-aerosnap b/bl-aerosnap
index 785b16c..de7cb6f 100755
--- a/bl-aerosnap
+++ b/bl-aerosnap
@@ -198,7 +198,7 @@ def get_window_geometry(win):
:param win: the X Window object"""
geom = win.get_geometry()
- return [geom.x, geom.y, geom.width, geom.height]
+ return [geom.x, geom.y, geom.width, geom.height-14]
def get_window_id(ewmh, win):
"""Returns a unique identifier for an X Window, made up of its "to string" and proces' PID.
Not sure what to do about this. Perhaps I need to use the x,y from the parent but the width,height from the actual window. Will test this now.
It is definitely the window frames that are messing things up: undecorated windows work fine still.
@Hjdskes is your code now ready to merge into deuterium?
No, it's not done yet.
For lack of interest, bl-aerosnap has been removed from bunsen-utilities.
Repeated snapping results in X/Y position of active window increasing by several px each time, after using ToggleMaximize.