python - Get GDK Window from xid, under Wayland -
in nutshell: repeat of how gdk window xid?, under wayland.
code following worked fine until updated debian stretch buster:
#!/usr/bin/env python3 gi.repository import gdk gi.repository import gdkx11 gdk.window.process_all_updates() xlib_window = 0x2a00005 # example. wmctrl; xwininfo used in previous question. gdk_display = gdkx11.x11display.get_default() gdk_window = gdkx11.x11window.foreign_new_for_display(gdk_display, xlib_window) print gdk_window.get_geometry() unfortunately, gdk_display __gi__.gdkwaylanddisplay, gdkx11.x11window.foreign_new_for_display throws
typeerror: argument display: expected gdkx11.x11display, got __gi__.gdkwaylanddisplay so how gdkwindow now? (i couldn't see necessary docs online @ all, pointers appreciated.)
i'm happy gdkwindow pid or process name, since that's xid from.
as general answer, judging "for example. wmctrl" comment, there no solution.
by design, wayland doesn't allows applications meddle or inspect each other's windows security reasons.
x11 applications wmctrl run inside compatibility layer named xwayland , don't have permission meddle native wayland applications.
you're getting error because you're trying use gdkx11 inside application started native wayland application , it's not fundamentally different error you'd trying call win32 apis in c# application that's running natively on linux.
the way make work either how force relevant applications fall running via xwayland or write whatever you're trying accomplish patch wayland compositor itself.
Comments
Post a Comment