Re: gdk_screen_get_active_window’ is deprecated Alternative ?

Matthew Brush mbrush at codebrainz.ca
Sun Feb 25 20:11:27 CET 2018


On 2018-02-24 10:58 PM, Wim Stockman wrote:
> Hello
> 
> I'm making a tiling plugin for xfce4 panel
> I need to get the focused window to resize it. I'm using the deprecated
> function for the moment.
> but I would like to use a non deprecated function and I looked into the
> wnck but it is so heavy on resources. I'd prefare a gdk (x11) way.
> Can somebody point me in a direction?
> 

Hi,

If it were me, I'd use the deprecated function since it won't be removed 
in GTK+3 and by the time your code is ported to GTK+4, you'll have much 
larger things to worry about.

Another solution would be to just use Xlib directly and read the 
_NET_ACTIVE_WINDOW[0] property on your own, and/or copy the code from 
the deprecated function's implementation[1].

As far as wnck being heavy on resources, I'm not sure what that means, 
but since Xfwm4 is already using it[2], I don't think it will add any 
additional memory overhead (unless you're not using Xfwm4 or anything 
else that uses libwnck), if that's what you meant.

Regards,
Matthew Brush

[0]: 
https://standards.freedesktop.org/wm-spec/wm-spec-latest.html#idm140200472702304
[1]: 
https://gitlab.gnome.org/GNOME/gtk/blob/gtk-3-22/gdk/x11/gdkscreen-x11.c#L1185
[2]: https://git.xfce.org/xfce/xfwm4/tree/configure.ac.in?h=xfce-4.12#n95


More information about the Xfce4-dev mailing list