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 170268 - cannot input Japanese filenames in "Run Application"
cannot input Japanese filenames in "Run Application"
Status: RESOLVED OBSOLETE
Product: gnome-panel
Classification: Other
Component: run dialog
2.28.x
Other opensolaris
: High normal
: ---
Assigned To: Panel Maintainers
Panel Maintainers
Depends on:
Blocks:
 
 
Reported: 2005-03-14 05:16 UTC by Takao Fujiwara
Modified: 2020-11-06 20:22 UTC
See Also:
GNOME target: ---
GNOME version: 2.27/2.28


Attachments
patch for gnome-panel/gnome-panel-screenshot.c and panel-run-dialog.c (2.50 KB, patch)
2005-03-14 05:18 UTC, Takao Fujiwara
reviewed Details | Review
patch for panel-run-dialog.c (1.29 KB, patch)
2005-04-02 13:23 UTC, Takao Fujiwara
reviewed Details | Review
patch for panel-run-dialog.c (1.37 KB, patch)
2005-04-03 05:37 UTC, Takao Fujiwara
reviewed Details | Review
patch for panel-run-dialog.c (1.38 KB, patch)
2005-04-19 09:15 UTC, Takao Fujiwara
needs-work Details | Review
Patch for panel-run-dialog.c with the request (1.72 KB, patch)
2007-02-06 05:24 UTC, Takao Fujiwara
none Details | Review

Description Takao Fujiwara 2005-03-14 05:16:45 UTC
I cannot input Japanese filenames in "Run Program" and "Screenshot"

To reproduce:
1. Invoke gnome-panel-screenshot and launch [Save Screehshot] dialog.
2. Change IM to Kanji-mode, input Japanese filename on the text entry and input
Return key to commit Japanese strings.

Then the dialog is closed.

[Launch] -> [Run Applications...] also has the same problem.


I'm attaching the patch.
Comment 1 Takao Fujiwara 2005-03-14 05:18:00 UTC
Created attachment 38674 [details] [review]
patch for gnome-panel/gnome-panel-screenshot.c and panel-run-dialog.c

Attached the patch.
Comment 2 Vincent Untz 2005-04-02 09:37:34 UTC
Takao: thanks for the patch.

Here are some comments:

 + the screenshot part of the patch should go to gnome-utils since we moved the
code there

 + I'm not sure about this:
       result = panel_run_dialog_show_url (dialog, url_locale, escaped_locale);
   I don't think we should use escaped_locale since it's only used to display an
error message. I'm also not sure about url_locale: does gnome_vfs_show_uri()
need a non UTF-8 string?

 + also, the gtk_im_context_filter_keypress() should probably be at the
beginning of entry_event, shouldn't it?
Comment 3 Takao Fujiwara 2005-04-02 13:23:21 UTC
Created attachment 39595 [details] [review]
patch for panel-run-dialog.c

Revised patch 38674
Comment 4 Takao Fujiwara 2005-04-02 13:25:06 UTC
Thanks for your comments All comments are right so I revised the patch.
I'll file another bug for screenshot app.
Comment 5 Vincent Untz 2005-04-02 13:57:08 UTC
Comment on attachment 39595 [details] [review]
patch for panel-run-dialog.c

Small comment on the entry_event part of the patch patch:

>+	/* commit the string with Enter key */
>+	if (GTK_ENTRY (entry)->editable) {
>+    		if (gtk_im_context_filter_keypress (GTK_ENTRY (entry)->im_context, event)) {

Is it okay to use GTK_ENTRY (entry)->im_context? It's marked as private in
gtkentry.h. But I can't find any other way to do this...

>+			return TRUE;

This should probably return FALSE (we did not handle the keypress ourselves).

>+		}
>+	}

I'm just worried about the im_context that is private. I'll commit your patch
if you are sure there's no other way to do this or if you know it's okay to do
this :-)
Comment 6 Takao Fujiwara 2005-04-02 19:48:48 UTC
> Is it okay to use GTK_ENTRY (entry)->im_context? It's marked as private in
gtkentry.h. But I can't find any other way to do this...

I don't have other ways to get im_context. I think it's ok.

> This should probably return FALSE (we did not handle the keypress ourselves).

gtk_im_context_filter_keypress will commit the preedit string so need to return
TRUE. I copied the comment in gtkimcontext.c:

/**
 * gtk_im_context_filter_keypress:
 * @context: a #GtkIMContext
 * @event: the key event
 *
 * Allow an input method to internally handle a key press event.
 * If this function returns %TRUE, then no further processing
 * should be done for this keystroke.
 *
 * Return value: %TRUE if the input method handled the keystroke.
 *
 **/

So it's ok to return TRUE in this API.
Comment 7 Vincent Untz 2005-04-02 23:09:06 UTC
Takao: thanks for your answers!

I just tested the patch again and it seems to break the autocompletion here:
gtk_im_context_filter_keypress() always returns TRUE. I'm not using any IM and
I'm just typing some ascii text.

Does this happen for you too? Do you have any idea on how to fix this?

I'm wondering if we really need to call gtk_im_context_filter_keypress() here:
it's already called in gtk_entry_key_press().

(I'll probably commit the first part of the patch soon)
Comment 8 Takao Fujiwara 2005-04-03 05:37:02 UTC
Created attachment 39615 [details] [review]
patch for panel-run-dialog.c

Reverted patch 38674.
Comment 9 Takao Fujiwara 2005-04-03 05:51:12 UTC
Vincent, 

Sorry for confusing you. I found some problems in the second patch so reverted
the the original patch. 

> Does this happen for you too? Do you have any idea on how to fix this?

I could not reproduce it. Could you try if your problem is happened with the
third patch. If you can, could you give me more information about the problem?
I checked the gconf value /apps/gnome-settings/gnome-panel is saved correctly.

I remembered the original bug. Yes, gtk_im_context_filter_keypress is needed. 
If the api is missed, I cannot input multibyte chars in the first column. I
think  the behavior is overrided by gtk_entry_set_text in gtk_entry.

I filed bug 172435 for gnome-panel-screenshot.
Comment 10 Vincent Untz 2005-04-10 12:10:37 UTC
Takao: the first part of the patch is committed.
What I don't understand is why the call to gtk_im_context_filter_keypress()
doesn't work at the beginning of entry_event(). If it doesn't work there, then
it surely breaks things to call it later in the function, doesn't it?
Comment 11 Takao Fujiwara 2005-04-19 09:15:52 UTC
Created attachment 45432 [details] [review]
patch for panel-run-dialog.c

Revised patch 39595.
Comment 12 Takao Fujiwara 2005-04-19 09:17:55 UTC
Vincent,

Sorry for my late response. I was on a biz trip last week.
Yes, your mention is right and I noticed the problem at the beginning of
entry_event(). I revised the patch. It's ok with me.

Comment 13 Kjartan Maraas 2005-05-16 11:05:53 UTC
Vincent, should we apply the rest of this fix now or do you still have issues
with it?
Comment 14 Matt Keenan (IRC:MattMan) 2006-09-18 16:19:05 UTC
Vincent, just following up on this patch, the last secton of the patch to
panel-run-dialog.c in : entry_event(), can this be applyed or is there
still isses ?
Comment 15 Takao Fujiwara 2006-10-25 07:47:08 UTC
The entry_event problem exists in 2.16.1
Could you integrate the fix for gtk_im_context_filter_keypress?
Comment 16 Vincent Untz 2007-01-17 20:30:07 UTC
Sorry for the late reply. I tried again, and it still breaks autocompletion for me.

It looks to me like there's no easy way to fix this. So what about finding another way to do this? We save the string we have in the entry before the event, and we compare with what we have after the im handling. This way we can know if the string changed and update the selection accordingly.
Comment 17 Takao Fujiwara 2007-02-06 05:24:58 UTC
Created attachment 81978 [details] [review]
Patch for panel-run-dialog.c with the request

I don't know what is your problem in the autocompletion.
Could you explain how to reproduce your problem?

I'm also attaching the different patch which don't return the function soon.
What about this patch?
Comment 18 André Klapper 2009-12-19 21:58:36 UTC
Is this still an issue in a correct GNOME version, like 2.28?
Comment 19 Takao Fujiwara 2009-12-21 04:10:13 UTC
Yes, I still can reproduce this problem in 2.28.
Comment 20 André Klapper 2020-11-06 20:22:21 UTC
bugzilla.gnome.org is being replaced by gitlab.gnome.org. We are closing all old bug reports in Bugzilla which have not seen updates for many years.

If you can still reproduce this issue in a currently supported version of GNOME (currently that would be 3.38), then please feel free to report it at https://gitlab.gnome.org/GNOME/gnome-panel/-/issues/

Thank you for reporting this issue and we are sorry it could not be fixed.