User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.1) Gecko/20070124 BonEcho/2.0.0.1 Build Identifier: When I start xfrun4 (the Run program dialog), sometimes it pre-selects the text already in the input box, sometimes it doesn't. When it doesn't, the input box still gets the focus, but I have to delete the previously entered command (instead of just typing over it). Reproducible: Sometimes Steps to Reproduce: 1. Run xfrun4 Actual Results: Sometimes, the text in the input box isn't preselected (highlighted). Expected Results: It should always be pre-selected, so I can just type over it.
Forgot to mention. I'm using gtk2 2.10.6 if it might have something to do with this.
I confirm that the bug exists and annoys me sometimes. I use gtk+-2.12.1 and xfce-base/xfce-utils-4.4.2 Usually I can reproduce it if I open xfrun4, run firefox, open xfrun4, press escape to close it, *wait some seconds (20-30)*, open xfrun4 again and "firefox" is not selected. But it's not steps to ALWAYS reproduce it. Looks like race condition somewhere. It always pre-selects command when xfrun4 is "cache-hot" (at least I can't prove opposite) and rather often does not when it's "cache-cold".
I can reproduce this too on both my laptop (svn) and my AMD64 machine (4.4.2). I patched xfrun with attachment from bug #3820 and it works nice.
(In reply to comment #3) > I can reproduce this too on both my laptop (svn) and my AMD64 machine (4.4.2). > I patched xfrun with attachment from bug #3820 and it works nice. > Or not. It just didn't select the text right now.
There is an additional problem with xfrun: The arrow-down key is more often than not ignored. So I have to walk from bottom-up with the arrow-up key to select an entry.
I'm also seeing this bug. I'm running Xfce v4.4.2.
For me it's pretty obvious: if I select text in any application before running xfrun4, the entry does not select all text as it should. I suppose I'm lucky to rarely select something in the window I have open right before hitting Alt+F2.
I see the same problem and can confirm that you can reproduce the bug like this: Select some text in Firefox (probably an other Gtk-Application will do as well, but it seems it is specific for Gtk-Applications) and start xfrun4. The last item will not be highlighted. While I am writing this text inside the Bugzilla text box in Firefox, I can reproduce the effect as well, so it is probably a question of keyboard focus. Maybe one needs to call something like a "gtk_grab_keyboard_focus" (I made this function up, but maybe there is something like this)
Ah-ha! I had no idea it had to do with whether or not text was selected in another app. This is useful, thanks.
The problem can be fixed easily by adding the line gtk_editable_select_region(GTK_EDITABLE(GTK_ENTRY(gtk_bin_get_child(GTK_BIN(comboboxentry)))),0,-1); in xfrun_dialog_init() after if(gtk_tree_model_get_iter_first(dialog->priv->completion_model, &itr)) { ... }
The comment below was for 4.6. In 4.4 the same works, too. --- xfce-utils-4.4.2/xfrun.orig/xfrun-dialog.c 2007-11-17 20:31:32.000000000 +0100 +++ xfce-utils-4.4.2/xfrun/xfrun-dialog.c 2008-10-31 13:23:05.000000000 +0100 @@ -233,6 +233,7 @@ gtk_widget_show(btn); gtk_box_pack_end(GTK_BOX(bbox), btn, FALSE, FALSE, 0); GTK_WIDGET_SET_FLAGS(btn, GTK_CAN_DEFAULT); + gtk_editable_select_region(GTK_ENTRY(entry),0,-1); gtk_widget_grab_default(btn); g_signal_connect(G_OBJECT(btn), "clicked", G_CALLBACK(xfrun_run_clicked), dialog);
Sorry for the noise, but the proposed method doesn't work in all cases. However, I think I now have found both the real cause of the problem and it's solution. If xfrun is build with dbus support, what happens is that the text in the edit (4.4) or comboboxedit (4.6) is set as selected when the Dialog is left. If between this point and the next invocation text is selected in some other Gtk application, the selection is lost. Therefore you have to select the text immediately before the dialog is shown. For Xfce 4.4 I have prepared a patch which have tested now for quite a length of time and all my prevoius recipes for triggering the bug are fixed now.
Created attachment 1935 Patch against 4.4 which fixes the bug Select the text before showing the dialog
I doubt there will be any more releases in the 4.4 series. Does the patch apply to 4.6?
It applies with offset. I add one against 4.5.91 which I just tested
Created attachment 1937 Patch against 4.5.91 which fixes the bug
Works for me.
Has it been applied for 99.1? I don't seem to be able to reproduce it anymore :)
No, it hadn't been, but I just checked it in.
Cool! And yeah I ment the patch works for me, I had this bug every now and then. Thanks Brian :)