GNOME Bugzilla – Bug 741959
text input broken on OS X 10.5 from 2.24.19 onwards
Last modified: 2015-01-05 02:24:39 UTC
Created attachment 293336 [details] [review] fix quartz input handling on OS X 10.5 After the NSTextInputClient additions in 2.24.19, text input hasn't really worked on 10.5 anymore (2.24.20 being an exception, because it had errors in naming the input module config file and hence didn't use the module). In GdkQuartzView, keyDown gets called, but after it calls interpretKeyEvents, nothing happens. It looks like the 10.5 NSInputManager likes to call the non-NSTextInputClient version of insertText. Later OS X versions call the NSTextInputClient version of insertText as one would expect. The attached patch fixes the behaviour on 10.5 and shouldn't break later versions either (tested on 10.6). The functionality was moved to the older insertText function because this way, if replacementRange is ever starting to get used, this organization hopefully forces to handle 10.5 compatibility at the same time.
Review of attachment 293336 [details] [review]: This is seriously weird: When built on a PPC with Xcode 3.1.4 on a PowerPC, imquartz works without this patch and fails with it. On a i386 with Xcode 3.1.3, it's the reverse: imquartz fails without the patch and works with it as the author intends. Both machines are running 10.5.8.
That is really weird. I had the problem on ppc and that's what I set to fix. Running a GTK+ app right now, built with the patch, that works on Leopard/ppc (and ppc64, too). Also tested with Japanese input. I also tested the patch on 10.6/x86 and it didn't seem to break that. Could you maybe insert some debug printfs to keyDown and both of the insertText methods to see what's going on? I never saw the replacementRange version of insertText getting called on Leopard. AFAIK my Leopard installs are fully upgraded and running the same latest Xcode available for them (3.1.4). However, I'll still recheck the binary on my clean install machine.
I'll see if I can figure out what's going on my PPC system. In the meantime, please build the current gtk-2-24 on yours. Note that the last two commits are your patch and reverting it. Another possible source of trouble: Are you using MacPorts, Homebrew, Gtk-OSX, or some other package manager?
Comment on attachment 293336 [details] [review] fix quartz input handling on OS X 10.5 After more building and testing I can't reproduce my earlier results. I must have done something wrong, perhaps gotten imquartz misconfigured somehow. Both systems are now behaving the way you originally reported. So I've re-applied it and pushed it to gtk-2-24. I don't think that master needs it, but I'll test some more to be sure and if it does, apply it there as well.