Community
Participate
Working Groups
This bug is related to : https://bugs.eclipse.org/bugs/show_bug.cgi?id=386931 This patch uses new GTK+ API gtk_entry_im_context_filter_keypress() method thus avoiding use of gtk_im_context_filter_keypress () that tries to directly access im_context in GtkEntry class: http://fedorapeople.org/cgit/aspektor/public_git/eclipse.platform.swt.git/log/?h=gtk_im_context_filter_keypress
There are still 2 cases left where gtk_im_context_filter_keypress () not covered by the patch, they are in Text Widget. I have tried both gtk_entry_im_context... and gtk_text_view_im_context... to replace functions in Text, but I keep getting wrong result together with the critical warnings about not GTK_ENTRY or not GTK_IM_CONTEXT. If someone could take a look at these cases, It would be highly appreciated. Regards, Anatoly
(In reply to comment #1) > There are still 2 cases left where gtk_im_context_filter_keypress () not > covered by the patch, they are in Text Widget. I have tried both > gtk_entry_im_context... and gtk_text_view_im_context... to replace functions > in Text, but I keep getting wrong result together with the critical warnings > about not GTK_ENTRY or not GTK_IM_CONTEXT. > > > If someone could take a look at these cases, It would be highly appreciated. > > Regards, > > > Anatoly One more comment regarding gtk_im_context_filter_keypress In Control widget there is this code : int /*long*/ imHandle = imHandle (); if (imHandle != 0) { if (OS.gtk_im_context_filter_keypress (imHandle, event)) return 1; } and imHandle: int /*long*/ imHandle () { return 0; } So if imHandle always returns zero, filter_keypress can't be reached. Is this done intentionally, for some special purposes, or it is part of some old code and filter_keypress can be removed ? Thanks, Anatoly
(In reply to comment #2) > So if imHandle always returns zero, filter_keypress can't be reached. Is > this done intentionally, for some special purposes, or it is part of some > old code and filter_keypress can be removed ? The method imHandle() is re-implemented in Composite. StyledText has an imHandle for example.
Created attachment 220855 [details] possible fix Here is way of getting the IM Context of GtkEntry and GtkTextView widgets. It works, but it is very "hack". It overwrites the GtkIMMulticontext constructor to get a hold of the one created by the text widgets. Another option is to use gtk_entry_im_context_filter_keypress() (your patch). And the new "preedit-changed" signal to replace what it is done with the "commit" signal. We would have to some how send key events from gtk_insert_text() which is called when the native commit signal is handled. I played around with this solution, but it became more hack than the one above and it did not get it to work since I could not reliably determine when to send key events. Maybe we could make this work, but I think we are going to use the hack above.
(In reply to comment #4) > Created attachment 220855 [details] > possible fix > This seems to be the patch from bug 382812.
(In reply to comment #5) > This seems to be the patch from bug 382812. It fixes this bug as well.
(In reply to comment #6) > (In reply to comment #5) > > This seems to be the patch from bug 382812. > > It fixes this bug as well. I am sorry. I just realized I attached a completely unrelated patch.
*** Bug 386931 has been marked as a duplicate of this bug. ***
Unfortunately, I lost the patch. I will rewrite it, but for now I just removed the compile error: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=7412358a7a63a2695a4ecdf1d3a7d47db7890ea9
Fixed http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=af054a0a011d7fb2ae5e53f517022bb49231bb94