Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 284777 - user gtk setting should be checked before adding "Input Methods" item to context menus
Summary: user gtk setting should be checked before adding "Input Methods" item to cont...
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.5   Edit
Hardware: PC Linux-GTK
: P3 normal with 2 votes (vote)
Target Milestone: 3.7 M2   Edit
Assignee: Felipe Heidrich CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-27 11:58 EDT by Grant Gayed CLA
Modified: 2010-09-15 16:54 EDT (History)
7 users (show)

See Also:


Attachments
disable im option as required (1.77 KB, patch)
2010-05-09 23:07 EDT, Ritesh Khadgaray CLA
no flags Details | Diff
patch (2.31 KB, patch)
2010-05-31 13:02 EDT, Felipe Heidrich CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Grant Gayed CLA 2009-07-27 11:58:44 EDT
The automatic adding of GTK's "Input Methods" menu item to context menus can be disabled as described in http://dev.eclipse.org/newslists/news.eclipse.newcomer/msg20408.html .  SWT inheirits this behaviour in most cases, but one place where it doesn't is StyledText, where the only criteria used is whether KeyDown or KeyUp is hooked.  Showing a context menu in a StyledText (and possibly other emulated controls) should check this property in addition to the KeyDown/KeyUp-is-hooked check when deciding whether to add this item.
Comment 1 Ulli Hafner CLA 2010-05-04 04:29:05 EDT
I think this is not only wrong in the StyledText widget. We use a GraphViewer from the zest framework and every context menu in the viewer shows the "Input Methods" menu even though this option has been disabled with the gconf-editor.
Comment 2 Felipe Heidrich CLA 2010-05-04 10:04:50 EDT
(In reply to comment #1)
> I think this is not only wrong in the StyledText widget. We use a GraphViewer
> from the zest framework and every context menu in the viewer shows the "Input
> Methods" menu even though this option has been disabled with the gconf-editor.

The fix would affect all custom controls.
Comment 3 Ritesh Khadgaray CLA 2010-05-09 23:07:04 EDT
Created attachment 167648 [details]
disable im option as required 

note: patch does not accept space in filename/directory. I have used the below to build rpm package.

Patch200: eclipse-gtk-im-menu-java.patch
Patch201: eclipse-gtk-im-os-java.patch 

pushd plugins/org.eclipse.swt/Eclipse\ SWT/gtk/org/eclipse/swt/widgets/
%patch200 -p0
popd

pushd plugins/org.eclipse.swt/Eclipse\ SWT\ PI/gtk/org/eclipse/swt/internal/gtk
%patch201
popd
Comment 4 Felipe Heidrich CLA 2010-05-11 11:37:19 EDT
This patch looks correct, but I was not able to verify the case where the menu should show.
The input method menu should show in StyledText always when it shows for the native text widget.

Do you know how I can change the gtk setting to force the input method menu to show for the native text control ?
Comment 5 Grant Gayed CLA 2010-05-13 11:51:16 EDT
Presumably adding the following lines in .gtkrc-2.0 would do it?

gtk-show-input-method-menu = 1
gtk-show-unicode-menu = 1
Comment 6 Ritesh Khadgaray CLA 2010-05-31 08:49:52 EDT
Hi @Felipe Heidrich

 This should do - https://bugzilla.redhat.com/show_bug.cgi?id=590519#c1
Comment 7 Felipe Heidrich CLA 2010-05-31 13:00:35 EDT
(In reply to comment #6)
> Hi @Felipe Heidrich
> 
>  This should do - https://bugzilla.redhat.com/show_bug.cgi?id=590519#c1

Thank you, that works.

The patch is correct, but it should be easy enough to rewrite the patch to handle dynamic changes in the preference (so eclipse can "see" the change without having to be restarted).
Comment 8 Felipe Heidrich CLA 2010-05-31 13:02:37 EDT
Created attachment 170565 [details]
patch

After 3.6 (at this point only very critical bugs can be included in the build)
Thanks for all the help
Comment 9 Felipe Heidrich CLA 2010-08-09 14:11:19 EDT
Fixed in HEAD > 20100809