FileChooserDialog de-selects text during autocompletion under Xorg
In GTK from git master, the auto-completion in the GtkFileChooserDialog behaves oddly under Xorg. This can be demonstrated with the testfilechooser program included with GTK. Run testfilechooser and type "/ho". Typing '/' brings up the filename entry and inserts a slash. Typing 'h' begins auto-completion for "/home/" with the "ome/" selected. Typing 'o' de-selects the text and moves the cursor to the end of the entry. I would expect the characters to stay selected until they are typed. As it works currently, if I type "/home" into the entry it will end up containing "/home/me".
I'm not certain of how X11 works, but I think the text becomes de-selected because a XFixesSelectionNotify event clears the primary selection. File gdk/x11/gdkclipboard-x11.c includes this section to handle SelectionNotify events:
if (sn->owner == GDK_X11_DISPLAY (display)->leader_window)
{
GDK_DISPLAY_NOTE (display, CLIPBOARD,
g_printerr ("%s: Ignoring XFixesSelectionNotify for ourselves\n", cb->selection));
return FALSE;
}
Is it possible that this should say sn->window
instead of sn->owner
? Changing that one statement seems to fix this behavior.