GNOME Bugzilla – Bug 613331
keymap.get_entries_for_keyval returns None when run inside an nxserver
Last modified: 2018-02-10 03:43:06 UTC
Ubuntu 9.10 python-gtk2 2.16.0-0ubuntu1 freenx-server: 0.7.3+teambzr104-0ubuntu1~karmic1 michael@frigg:~$ python Python 2.6.4 (r264:75706, Dec 7 2009, 18:45:15) [GCC 4.4.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import gtk keyXlib: extension "Generic Event Extension" missing on display ":1000.0". Xlib: extension "Generic Event Extension" missing on display ":1000.0". Xlib: extension "Generic Event Extension" missing on display ":1000.0". Xlib: extension "Generic Event Extension" missing on display ":1000.0". Xlib: extension "Generic Event Extension" missing on display ":1000.0". ma>>> keymap = gtk.gdk.keymap_get_default() >>> print gtk.keysyms.Insert, keymap.get_entries_for_keyval(gtk.keysyms.Insert) 65379 None >>> This may be an xlib bug, this may be a freenx bug, this may be a gtk or pygtk bug... This is when running an X session with freenx-server and connecting remotely. If I ssh to the machine, export my display to :0 (even though the machine is in a headless vm) and run the same test, it returns a proper value. I'm filing the bug under pygtk since that's the highest level package I can think of. This is causing gajim (as of the latest development versions) to crash on startup, with the traceback pointing to the keymap.get_entries_for_keyval command.
This happens not only with freenx-server 0.7.3 found in the freenx launchpad ppa, but with Google's 'neatx' nxserver (0.3.1 from the freenx launchpad ppa) as well.
I suspect it's not a pygtk bug, but rather it's lower level in gdk or below
(In reply to comment #2) > I suspect it's not a pygtk bug, but rather it's lower level in gdk or below Any suggestions about where to move/re-file/re-classify the bug to get it in front of someone else's eyes? I'm currently plowing through the dozens of possible duplicate bugs on the gnome bugzilla but I'm not holding my breath... Same result with No Machine's commercial nxserver, for anyone keeping score. The nxserver obviously has something to do with it, and it doesn't matter whose nxserver implementation we use.
sorry, now that I've moved this to gtk: libgtk2.0-0: 2.18.3-1ubuntu2.2
Sounds like these X servers might have buggy xkb implementations. Your best bet is to step though gdk_keymap_get_entries_for_keycode in a debugger and see what is going on.
sorry, I could have included the traceback. Here's my attempt at debugging: Traceback (most recent call last):
+ Trace 221184
pdb._runscript(mainpyfile)
self.run(statement)
exec cmd in globals, locals
import gtkexcepthook
import dialogs
import disco
import search_window
import config
import chat_control
class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools):
keycode_ins = keymap.get_entries_for_keyval(gtk.keysyms.Insert)[0][0]
Uncaught exception. Entering post mortem debugging Running 'cont' or 'step' will restart the program > /usr/share/gajim/src/chat_control.py(99)ChatControlBase()->None -> keycode_ins = keymap.get_entries_for_keyval(gtk.keysyms.Insert)[0][0] (Pdb) l 94 A base class containing a banner, ConversationTextview, MessageTextView 95 """ 96 97 keymap = gtk.gdk.keymap_get_default() 98 keycode_c = keymap.get_entries_for_keyval(gtk.keysyms.c)[0][0] 99 -> keycode_ins = keymap.get_entries_for_keyval(gtk.keysyms.Insert)[0][0] and the output that confused the gajim developer ('that shouldn't return None!') michael@frigg:~$ python Python 2.6.4 (r264:75706, Dec 7 2009, 18:45:15) [GCC 4.4.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import gtk >>> keymap = gtk.gdk.keymap_get_default() >>> print gtk.keysyms.Insert, keymap.get_entries_for_keyval(gtk.keysyms.Insert) 65379 None >>> please let me know what other information I can provide.
Hi, Have you installed the xkb-data package? I have just had a similar issue with xpra because that package was missing it was missing. Also when you run python manually be sure to choose the right X server using the DISPLAY variable. "$ python" and "$ DISPLAY=:5 python" won't give the same results Cheers, Pierre
I do have the xkb-data package installed, which provides the xkb rules you mention on the gajim bug tracker ( http://trac.gajim.org/ticket/5636 ). Yes, I do run python from a terminal within the remote desktop. If I connect with a terminal program to run the test, I make sure to export the DISPLAY variable to one the nx server session. It's interesting to note that if I export my DISPLAY variable to the :0 display (which just constantly runs gdm on my vm), the python test returns a sane value every time. I have been noticing that, since upgrading to ubuntu 10, this error is intermittent. I'll try to track down the differences between when it works and when it doesn't, but I haven't noticed them yet. For example, gajim works, the python test returns a sane response instead of an error, I reboot the vm without upgrading any pacakges, and gajim will no longer work, and the python test will return the error above.
We're moving to gitlab! As part of this move, we are closing bugs that haven't seen activity in more than 5 years. If this issue is still imporant to you and still relevant with GTK+ 3.22 or master, please consider creating a gitlab issue for it.