Giter VIP home page Giter VIP logo

Comments (8)

Hjdskes avatar Hjdskes commented on September 24, 2024

Can you test this, too? 😄 I think it is fixed, but I'm not sure how you reproduce this issue exactly.

from bunsen-utilities.

Hjdskes avatar Hjdskes commented on September 24, 2024

Now that I switched to using the parent window (Hjdskes@5bc730a), 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.

from bunsen-utilities.

Hjdskes avatar Hjdskes commented on September 24, 2024

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.

from bunsen-utilities.

Hjdskes avatar Hjdskes commented on September 24, 2024

It is definitely the window frames that are messing things up: undecorated windows work fine still.

from bunsen-utilities.

Hjdskes avatar Hjdskes commented on September 24, 2024

Latest push seems to have fixed the issue. However, I occasionally get this (bl-aerosnap says it is moving the window to the right half of the screen, but as you can see it does not occupy the full right half, even though the coordinates and dimensions reported are correct):
Photo hosted by zimagez.com

from bunsen-utilities.

johnraff avatar johnraff commented on September 24, 2024

@Hjdskes is your code now ready to merge into deuterium?

from bunsen-utilities.

Hjdskes avatar Hjdskes commented on September 24, 2024

No, it's not done yet.

from bunsen-utilities.

johnraff avatar johnraff commented on September 24, 2024

For lack of interest, bl-aerosnap has been removed from bunsen-utilities.

from bunsen-utilities.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.