You are not logged in.

#1 2022-06-03 17:11:39

mrvladus
Member
Registered: 2021-12-19
Posts: 3

[SOLVED] Can't change window position in Xlib after gnome-shell update

I'm trying to create a panel-like application using python, gtk4 and xlib. After last gnome-shell update this code doesn't work anymore:

# Get xid
xid = GdkX11.X11Surface.get_xid(self.get_surface())
# Get display
display = Xlib.display.Display()
# Get window
window = display.create_resource_object('window', xid)
# Move window to position
window.configure(x=0, y=0) # This doesn't work anymore !!!
# Add 'dock' property
window.change_property(display.intern_atom('_NET_WM_WINDOW_TYPE'), display.intern_atom('ATOM'), 32, [display.intern_atom('_NET_WM_WINDOW_TYPE_DOCK')], X.PropModeReplace)
# Reserve space for panel
window.change_property(display.intern_atom('_NET_WM_STRUT_PARTIAL'), display.intern_atom('CARDINAL'), 32, [0, 0, height, 0, 0, 0, 0, 0, 0, width, 0, 0], X.PropModeReplace)
# Sync changes
display.sync()

wmctrl doesn't work either.

Last edited by mrvladus (2022-06-04 15:44:06)

Offline

#2 2022-06-04 06:08:27

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,244

Re: [SOLVED] Can't change window position in Xlib after gnome-shell update

wmctrl doesn't work either

Are you perhaps running gnome on wayland?
Can xdotool move the window around?

gnome-shell (mutter) might simply ignore config requests what would be either a bug or a new low in gnome telling you how to use your system…

Offline

#3 2022-06-04 15:28:30

mrvladus
Member
Registered: 2021-12-19
Posts: 3

Re: [SOLVED] Can't change window position in Xlib after gnome-shell update

wmctrl and xdotool can't properly move window in x-direction. It's hanging in around 50px from the screen left edge, like something broken in the coordinates. Launching custom session with mutter, my panel app and without gnome-shell works fine.

Offline

#4 2022-06-04 15:31:25

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,497
Website

Re: [SOLVED] Can't change window position in Xlib after gnome-shell update

Can you clarify the symptoms (which may require some testing): is it just that moves to within 50px of the left edge fail?  Do all moves outside of that range work?

If so, it sounds like there is a margin / strutt set by the WM.  Does gnome still use the left edge for it's dock / panel / whatever-that's-called?

Last edited by Trilby (2022-06-04 15:31:54)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#5 2022-06-04 15:38:40

mrvladus
Member
Registered: 2021-12-19
Posts: 3

Re: [SOLVED] Can't change window position in Xlib after gnome-shell update

I just found the problem! I was using libadwaita to create and style windows and panel. I rewrote whole thing just using gtk4 and problem is gone. It's strange... I guess no libadwaita then.

Offline

#6 2022-06-04 15:47:47

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,244

Re: [SOLVED] Can't change window position in Xlib after gnome-shell update

Chek the props of your panel and see whether adwaita blesses it w/ some CSD margin/shadows

Offline

Board footer

Powered by FluxBB