After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 129537 - gok keyboards don't update when X/XKB keymap changes
gok keyboards don't update when X/XKB keymap changes
Status: RESOLVED FIXED
Product: gok
Classification: Deprecated
Component: general
unspecified
Other All
: High major
: ---
Assigned To: bill.haneman
bill.haneman
AP3
Depends on:
Blocks: 122112
 
 
Reported: 2003-12-17 12:32 UTC by bill.haneman
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (work in progress) which detects keymap switches and recreates compose keyboard. Don't switch while displaying the compose kbd itself! (2.98 KB, patch)
2004-01-28 20:35 UTC, bill.haneman
none Details | Review
better patch, used GdkKeymap instead of XKB for its change notifications. (19.84 KB, patch)
2004-01-29 00:09 UTC, bill.haneman
none Details | Review
latest patch, as committed to HEAD. (21.88 KB, patch)
2004-01-29 14:40 UTC, bill.haneman
none Details | Review

Description bill.haneman 2003-12-17 12:32:26 UTC
GOK "compose" keyboards which are generated from XKB don't currently react
to changes in the keymap.  XKB does emit such notifications (as does Xlib),
but GOK only reads the XKB configuration once, when creating the 'compose'
keyboard.  

In the i18n case, switching keymaps on the fly is not uncommon; in fact
GNOME  2.6 will include the 'gswitchit' applet which does this.  So GOK
needs to monitor the relevant XKB events and refresh its compose key labels
accordingly.

Possibly the best interim solution for this (though perhaps not the most
performant solution long-term) would be to tear down and re-create the GOK
compose keyboard on detection of a keymap-switch event.

(David, I probably ought to take this one, since I wrote the existing XKB
support for GOK).
Comment 1 bill.haneman 2004-01-06 19:18:22 UTC
I'd like to see this fixed for GNOME 2.6.  It can wait till after
feature freeze, since the current behavior is just a (serious) bug.  
Comment 2 bill.haneman 2004-01-26 22:54:09 UTC
bumping up priority.
Comment 3 bill.haneman 2004-01-28 20:35:41 UTC
Created attachment 23849 [details] [review]
patch (work in progress) which detects keymap switches and recreates compose keyboard. Don't switch while displaying the compose kbd itself!
Comment 4 bill.haneman 2004-01-28 20:38:30 UTC
above patch has some issues.  For one thing, many, many XKB events are
generated by a single xkb-switching operation from the gkb applet; and
gok is recreating its compose keyboard with every one.

also, it seems that the patch is toxic if you switch XKB keymaps while
the gok compose keyboard is onscreen.  Not great.

lastly, we don't seem to get proper notifications when switching to
the 'target' default keyboard as initially specified in the X config
file.  That's probably not gok's fault, possibly a bug elsewhere. 
Need to get more info on the events received from gkb, etc.
Comment 5 bill.haneman 2004-01-29 00:08:29 UTC
better patch which works whenever gkb switches keyboards; it uses
GdkKeymap notification instead of XKB events directly.

Still, for some keyboards we get too many keys-changed events; notably
GNOME Default and US-105.  For these keyboards there's a significant
performance issue since we end up re-reading the XKB data many times
when the switch occurs.

However, the patch is nearing the point where it can reasonably be
committed. Seems not to SEGV now.
Comment 6 bill.haneman 2004-01-29 00:09:39 UTC
Created attachment 23852 [details] [review]
better patch, used GdkKeymap instead of XKB for its change notifications.
Comment 7 bill.haneman 2004-01-29 14:33:51 UTC
OK, I have a version of this patch which I'm happy about; it detects
changes to GdkKeymaps.

However, the newer versions of the gnome keyboard switcher don't
change GdkKeymaps anymore :-/ they work by assigning groups and
switching keyboard groups on-the-fly.  This will require a bit more
work to GOK's logic in order to support, so I am filing a separate bug
for that work.
Comment 8 bill.haneman 2004-01-29 14:38:27 UTC
new related bug is bug 132853.
Comment 9 bill.haneman 2004-01-29 14:40:00 UTC
Created attachment 23875 [details] [review]
latest patch, as committed to HEAD.
Comment 10 bill.haneman 2004-01-29 14:51:45 UTC
fixed in cvs.