[Gambas-user] Trouble with X11.GetWindowProperty()

Benoît Minisini benoit.minisini at gambas-basic.org
Sun Sep 24 21:47:37 CEST 2023


Le 24/09/2023 à 21:34, Martin Fischer a écrit :
> Hi fellow gambassins,
> 
> I want to read the value of the WM_CLASS X11 atom by using
>    X11.GetWindowProperty(winId, "WM_CLASS")
> 
> WM_CLASS is a string-atom, so GetWindowProperty should return a Variant
> containing a String[] (one string for instanceName, one for className).
> 
> BUT what I get is a Variant containing a single String that contains the
> NULL bytes that terminate the C-strings.
> In the debugger such a string (for the Firefox window) looks like:
>    "Navigator\x00firefox\x00"
> 
> Now: is this a bug or a feature?
> 
> Sure. I can read this string as stream like so:
> 

It seems that the WM_CLASS property has a special format, as there are 
special dedicated X11 methods to read or write it.

Apparently it's two null terminated strings sticked, the first one being 
the application class, the second one the application name.

Regards,

-- 
Benoît Minisini.



More information about the User mailing list