Re: reserving a panel/taskbars space on the screen



On 18/06/13 04:49, Francis (Grizzly) Smit wrote:
Hi I'm trying to use gdk_property_change() to make my taskbar/panel I'm
writing to reserve it's space on the on the screen so that when thing
maximise they wont go beyond my widows boundary, does any one here know
how to do this?? this is what I have worked out but it's wrong some how.

      guchar data[4] = {0, 0, 0, height};
      gdk_property_change(gdk_window,
gdk_x11_xatom_to_atom(gdk_x11_get_xatom_by_name("_NET_WM_STRUT")),
gdk_x11_xatom_to_atom(gdk_x11_get_xatom_by_name("CARDINAL")), 32,
GDK_PROP_MODE_REPLACE, data, 4);


thanks in advance for any help.

Got it it should be

gint32 data[4] = {0, 0, 0, height};

gdk_property_change(gdk_window, gdk_x11_xatom_to_atom(gdk_x11_get_xatom_by_name("_NET_WM_STRUT")), gdk_x11_xatom_to_atom(gdk_x11_get_xatom_by_name("CARDINAL")), 32, GDK_PROP_MODE_REPLACE, (guchar*)data, sizeof(gint32)*4);

but apparently this is the old way the modern way is

gint32 data2[12] = {0, 0, 0, get_height(), 0, 0, 0, 0, 0, 0, 49, m_refscreen->get_width()}; gdk_property_change(get_window()->gobj(), gdk_x11_xatom_to_atom(gdk_x11_get_xatom_by_name("_NET_WM_STRUT_PARTIAL")), gdk_x11_xatom_to_atom(gdk_x11_get_xatom_by_name("CARDINAL")), 32, GDK_PROP_MODE_REPLACE, reinterpret_cast<guchar*>(data2), sizeof(gint32)*12);

I'm working in Gtkmm anyway hope this helps some one some time the page that helped me was

http://standards.freedesktop.org/wm-spec/wm-spec-1.3.html#id2732272
   this shows both _NET_WM_STRUT and
_NET_WM_STRUT_PARTIAL but it's somewhat cryptic basically these let you reserve a region a long one side of the screen the rest of the values should be 0, so as not to reserve that region the second or newer one _NET_WM_STRUT_PARTIAL is preferred as it leaves the area's you don't want alone





--


  .~.     In my life God comes first....
  /V\         but Linux is pretty high after that :-D
 /( )\    Francis (Grizzly) Smit
 ^^-^^    http://www.smit.id.au/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]