4

I am writing some code where I need to drop down from GTK+ to Xlib. Specifically, I would like to set the icon of a toplevel window to be a window itself, rather than a pixmap, in order to write a GTK+ Window Maker dockapp.

I got this to work in C as follows:

gdkDockapp = gtk_widget_get_window(dockapp);
xDockapp = GDK_WINDOW_XID(gdkDockapp);

gdkDisplay = gdk_window_get_display(gdkDockapp);
xDisplay = GDK_DISPLAY_XDISPLAY(gdkDisplay);

wmhints.icon_window = xDockapp;
wmhints.flags = IconWindowHint;
XSetWMHints(xDisplay, xDockapp, &wmhints);  

However, I am hoping to actually code my application in Python. When I try to convert the code, e.g.,

gdkDockapp = dockapp.get_window()
xDockapp = gdkDockapp.get_xid()

a long is returned rather than a Window, so I can't perform any of the Xlib functions. Any suggestions?

profzoom
  • 297
  • 1
  • 2
  • 10

2 Answers2

2

You can get Xlib.Display.Window object with this function: d.create_resource_object("window", xid), where d is Xlib.display.Display object.

0

Not sure using Xlib is a wise move in times where the X server is meant to disappear in favor of a Wayland compositor.

liberforce
  • 11,189
  • 37
  • 48
  • 1
    As I mentioned in the question, my goal is to write a Window Maker dockapp. As far as I know, there has been no discussion about running Window Maker itself under Wayland. In fact, pretty much all of the existing Window Maker dockapps are written using pure Xlib without any toolkits. – profzoom Nov 19 '12 at 19:13