parkouss / pyewmh

An implementation of EWMH (Extended Window Manager Hints) for python, based on Xlib.
GNU Lesser General Public License v3.0
40 stars 15 forks source link

Desktop Geometry/WorkArea Issue #18

Open ncvescera opened 2 years ago

ncvescera commented 2 years ago

I have some problems with DesktoGeometry and WorkArea values: I am trying to get the active window and resize it to fill the entire screen but when I use the function setMoveResizeWindow with the WorkArea values it put the window in a different position.

This is my code:

from ewmh import EWMH

ewmh = EWMH()

# get desktop geometry and workarea
w, h = ewmh.getDesktopGeometry()
xr, yr, wr, hr = ewmh.getWorkArea()[:4]

print("Desktop Geometry: ", w, h)
print("Desktop WorkArea:", xr, yr, wr, hr)

# get active window
win = ewmh.getActiveWindow()

# resize window
ewmh.setMoveResizeWindow(
    win,
    x=xr,
    y=yr,
    w=wr,
    h=hr
)

ewmh.display.flush()

I've tested this script on my ArchLinux + XFCE system and on a Ubuntu 20.4 WM, same problem but in different ways:

arch On Arch the window height is bigger than screen height.

ubunut_wm On Ubunut the window is in a weird position.