I usually select some text from a terminal, ready to have to pasted via pressing MMB(middle mouse button) into the Find dialog's "Search for" field, and then I go to another terminal, press Ctrl+Shift+F to open Find dialog and the previously searched text there is already pre-selected (eg. Select All) automatically which also clears my PRIMARY selection, thus pressing MMB will just paste the contents of what it selected instead of what I've already had in my PRIMARY selection before opening the Find dialog. In other words, if I've every searched for something before, re-opening Find dialog will copy the text from "Search for" into my PRIMARY selection, so now I can paste it via MMB for example, but that also means it overwrites whatever else I've had ready to paste into "Search for" before opening Find dialog, which is a bummer :) I can't really find out where the code that does this is, or else I would've patched it locally and not bother you with bug reports. Any pointers? Thanks. Some info for future me: What is PRIMARY selection: https://unix.stackexchange.com/questions/139191/whats-the-difference-between-primary-selection-and-clipboard-buffer#139193
oh, it must be a gtk3 feauture, because I've just seen it happen somewhere else. it must be happening when the default element(or what) is selected, when a dialog appears. I saw it happen in Session and Startup -> on a program click Edit button, the 'Edit application' window/dialog pops up with 'Name:' input field auto-selected and thus overwrote my PRIMARY selection
this is gtk3, it simply selects all text when grab focus is used, and it so happens that selecting text (maybe just for me?!) automatically overwrites PRIMARY selection(seems like it's working as it should, by the name). Anyway I patched gtk3 to not select text of focused entry, thus keeping my previous selection in PRIMARY selection: https://bugzilla.xfce.org/show_bug.cgi?id=14814#c5 Technically there's something xfce4-terminal can do to "fix" this like that, but I'm pretty sure this isn't a wanted feature: there's a gtk property that presumably can be set to false on the entry, since it's set to true by default, but I don't know how to use it(I don't know how to gtk) here's from gtk source code( gtk/gtksettings.c) where I already set it to FALSE just to be safe(for my own uses): result = settings_install_property_parser (class, g_param_spec_boolean ("gtk-entry-select-on-focus", P_("Select on focus"), P_("Whether to select the contents of an entry when it is focused "), //TRUE, //overwrites PRIMARY selection ie. Ctrl+F opens Find dialog and you lose what you had previously selected! FALSE, // so let's not select by default, unless the app specifically overrides it! GTK_PARAM_READWRITE), NULL); g_assert (result == PROP_ENTRY_SELECT_ON_FOCUS);
Igor referenced this bugreport in commit 734dbe386b4aa24a2d952cb3c29bd22612c597e1 Do not select text in Search dialog https://git.xfce.org/apps/xfce4-terminal/commit?id=734dbe386b4aa24a2d952cb3c29bd22612c597e1
Thanks for the report! While overwriting PRIMARY buffer with selected text is proper behavior, I've fixed the issue by preventing auto selecting text in the search dialog.