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 741959 - text input broken on OS X 10.5 from 2.24.19 onwards
text input broken on OS X 10.5 from 2.24.19 onwards
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Quartz
2.24.x
Other Mac OS
: Normal normal
: ---
Assigned To: gtk-quartz maintainers
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2014-12-25 10:49 UTC by holin
Modified: 2015-01-05 02:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fix quartz input handling on OS X 10.5 (759 bytes, patch)
2014-12-25 10:49 UTC, holin
committed Details | Review

Description holin 2014-12-25 10:49:21 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.
Comment 1 John Ralls 2015-01-04 21:04:04 UTC
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.
Comment 2 holin 2015-01-04 21:39:44 UTC
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.
Comment 3 John Ralls 2015-01-04 21:46:16 UTC
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 4 John Ralls 2015-01-05 02:24:17 UTC
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.