Question

My OS is Ubuntu 11.10, I started Sublime Text 2 from the terminal, everytime when I operated it, this Gdk-warning will be shown on the terminal, it's very annoying. How to fix it?

$ subl . &
[1] 4294
$ 
(subl:4294): Gdk-WARNING **: /build/buildd/gtk+2.0-2.24.6/gdk/x11/gdkdrawable-x11.c:952 drawable is not a pixmap or window
(subl:4294): Gdk-WARNING **: /build/buildd/gtk+2.0-2.24.6/gdk/x11/gdkdrawable-x11.c:952 drawable is not a pixmap or window
(subl:4294): Gdk-WARNING **: /build/buildd/gtk+2.0-2.24.6/gdk/x11/gdkdrawable-x11.c:952 drawable is not a pixmap or window
Was it helpful?

Solution

To fix this, you have to look at the source code of the application, fix it and recompile it. Gdk is giving a warning, but it's probably because the application is misusing the library.

Unfortunately it's a little common to see these errors on Gtk+ applications... Too bad some developers don't care about fixing them...

Another solution is to launch the app redirecting it's stdout and/or stderr to somewhere else: subl . > /dev/null 2>&1 &

OTHER TIPS

Old question I know, but in case anyone else got stung by this bug. It happens because the program uses gtk's input methods api which, roughly, allows you to enter Chinese and Japanese characters into input widgets. The api is not easy to use and there are many pitfalls in it. See http://lists.maemo.org/pipermail//maemo-developers/2006-January/002337.html

In this case, the program is most likely not calling gtk_im_context_set_client_window with a realized gdk window. It's a requirement to use the api correctly, but the documentation isn't so clear about that. Then you get the above warning on every keypress, but only if you actualy have the IBus daemon running. Most people don't have any use for it because they don't need to enter Asian characters so they never see the warning.

Another answer to a very old question but I came across the same issue, after upgrading from wxpython 2.8 to wxpython 3.0.
The issue seems to stem from gtk.gtk.Drawable() which may have changed slightly the way it handles the Identity of the window or how wxpython 3.0 deals with the request for the window Id.
To access the window Id (on Linux) GetHandle() used to work, it no longer does, instead you get the error in the question above. You now have to use GetId().

To quote from the gtk manual:

Attributes
"handle"    Read    The handle of the MS Windows window associated with the drawable. Not supported on X11.
"xid"   Read    The id of the X window available with the drawable. Not supported on MS Windows

I appreciate that this isn't a wxpython question but the same rule will apply, if using gtk in some other way.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top