|
From: John L. <jo...@la...> - 2017-02-24 11:44:01
|
On 22/02/17 11:02, John Lane wrote:
> I'd like to set window properties, specifically window manager hints
> (such as _NET_WM_STRUT_PARTIAL). However, I cannot find an appropriate
> method on Gdk.Window to do this. I would expect to be able to write
> something like
>
> topw = toplevel.window
> topw.property_change("_NET_WM_STRUT","CARDINAL",32,
> Gdk::PROP_MODE_REPLACE,
> [0, 0, bar_size, 0])
> topw.property_change("_NET_WM_STRUT_PARTIAL","CARDINAL",32,
> Gdk::PROP_MODE_REPLACE,
> [0, 0, bar_size, 0, 0, 0, 0, 0, x, x+width-1, 0, 0])
>
>
> (I looked for methods like this `topw.methods.sort.each{|m| p m}`)
>
> I can see in the source code that there is a commented-out TODO block
> in file gdk3-no-gi/ext/gdk3-no-gi/rbgdkproperty.c with a call to
> `gdk_property_change`. That's the only mention I can find. I expect this
> means it's unimplemented ?
>
Further to this, I now realise that the 'property_change' function is
set in the Gtk C source code to be non-introspectable which means that
this method is not available in Gtk3 bindings.
However, I also cannot find it in Ruby Gtk2. It is definitely supported
by Gtk2 and it is present in the gem source 'ext/gtk2/rbgdkproperty.c'.
The underlying Gtk2 C function is `gdk_property_change`.
The below should be valid for Gtk2 Ruby. The constant
'Gdk::Property::MODE_REPLACE' does exist but I cannot find the
'property_change' method. I expected to find it at
'Gdk::Window.property_change'.
topw = toplevel.window
topw.property_change("_NET_WM_STRUT","CARDINAL",32,
Gdk::Property::MODE_REPLACE,
[0, 0, bar_size, 0])
topw.property_change("_NET_WM_STRUT_PARTIAL","CARDINAL",32,
Gdk::Property::MODE_REPLACE,
[0, 0, bar_size, 0, 0, 0, 0, 0, x, x+width-1, 0, 0])
I expected to find it at Gdk.Window.property_change
Is it there, if so, where?
|