struts and open space

ivanova flamingivanova at punkass.com
Wed Aug 25 21:41:17 EDT 2004


I use the following script (not mine) to open some space at the top of my
desktop for some gDesklets. This works except that I cannot move the gDesklets
into this area. I thought I could modify the script to use _NET_WM_STRUT_PARTIAL
but this does not work. I used this same script in fluxbox without problems. Can
anyone explain what is going on and perhaps have a sollution?

Thanks
 
-------------------------------8<------------------------------------------------

#!/usr/bin/env python

left = 0
right = 0
top = 60
bottom = 0
left_start = 0
left_end = 960
right_start = 0
right_end = 960
top_start = 0
top_end = 600
bottom_start = 0
bottom_end = 1280

xpm = [
"1 1 1 1",
"       c None",
" "
]

import gtk

class Space:
    def delete_event(self, widget, event, data=None):
        return gtk.FALSE
    def destroy(self, widget, data=None):
        gtk.main_quit()
    def __init__(self):
        win = gtk.Window(gtk.WINDOW_TOPLEVEL)
        win.connect("delete_event", self.delete_event)
        win.connect("destroy", self.destroy)
        win.stick()
        win.show()

        xwin = win.window
        xwin.property_change("_NET_WM_STRUT", "CARDINAL", 32,
            gtk.gdk.PROP_MODE_REPLACE, [left, right, top, bottom])
#        xwin.property_change("_NET_WM_STRUT_PARTIAL", "CARDINAL", 32,
#            gtk.gdk.PROP_MODE_REPLACE, [left, right, top, bottom, left_start, left_end, \
#		right_start, right_end, top_start, top_end, bottom_start, bottom_end])
        xwin.property_change("_NET_WM_WINDOW_TYPE", "ATOM", 32,
            gtk.gdk.PROP_MODE_REPLACE,
            ["_NET_WM_WINDOW_TYPE_DESKTOP"])
        xwin.move_resize(0, 0, 16, 16)
        xwin.set_back_pixmap(None, False)

        style = win.get_style()
        pixmap, mask = gtk.create_pixmap_from_xpm_d(xwin, style.bg[gtk.STATE_NORMAL], xpm)
        win.shape_combine_mask(mask, 0, 0)

    def main(self):
        gtk.main()

if __name__ == "__main__":
    Space().main()




More information about the openbox mailing list