Determining a Wayland window ID from Python

Marius Gedminas marius at gedmin.as
Fri Jul 5 08:37:03 UTC 2019


On Wed, Jul 03, 2019 at 02:42:16PM -0700, David Strauss wrote:
> On Wed, Jul 3, 2019 at 2:11 PM Matthias Clasen <[1]mclasen at redhat.com> wrote:
> 
>     Wayland surfaces don't have a public ID unless you explicitly create one
>     using the zxdg_exporter protocol.
>     The client-side api for this is gdk_wayland_window_export_handle. If this
>     seems too much hassle, just
>     passing an empty string will work fine for most purposes.
> 
> 
> I'm currently using an empty string as a workaround, but I'd still like to get
> this more correct for the long-term. Do you know if there is any Python
> equivalent of gdk_wayland_window_export_handle()? I haven't had luck finding
> one. (I can barely find any use of the symbol even in its original C form.)

Try window.get_property("window").export_handle()?  Your previous
example (and error message) shows that window.get_property("window")
gives you a GdkWaylandWindow, and usually Python method names match C
function names without the type prefix.

(I cannot find any mention of GdkWayland on https://lazka.github.io/pgi-docs,
which is usually my go-to site for Python GTK binding questions.)

Marius Gedminas
-- 
Linux don't need no steenkin' viruses. The users can destroy the
system all by themselves....
                -- Peter Dalgaard in comp.os.linux.misc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/flatpak/attachments/20190705/fd324a8d/attachment.sig>


More information about the Flatpak mailing list