GNOME Bugzilla – Bug 305508
Only one text selection per application allowed at a time.
Last modified: 2014-04-15 01:33:52 UTC
It appears that under win32, GTK+ only allows one text buffer per program instance to have selection at a time. For example, if I open the "Hypertext" and "Multiple Views" Text Widget examples of gtk-demo, I can select text in either window, but as soon as I select text in the other window, the original selection is lost. If I open another instance of gtk-demo, I can make a selection and the selection in the first instance won't be lost. I realize that the whole "single text selection" is how things have traditionally worked under X (with the whole middle button paste and etc.), and I'm guessing that this behavior is a throwback from that, but it seems to me like there isn't a good reason for not allowing multiple selections on win32. I haven't looked at the code for this at all and I don't know if it'd be possible to change how this works without huge changes, but I've had several reports of this from gaim users and I at least want to mark it as a GTK+ bug.
Hmm, being able to have selections active in multiple windows from separate applications at the same time is not possible on X11. But I guess we definitely don't want to introduce that restriction into GTK+ on Win32? Comparing to Firefox on Windows, in it it is possible to have several selections active at the same time, in different tabs or different top-level windows of the same application instance. So I definitely think that would be the user expectation, yes.
Note that it isn't really an X11 thing, it's more of a GTK+ thing under Linux. In Firefox on Linux, you can have several selections in different tabs or different top-level windows of the same application. However, since it makes it a little less obvious which one will be used when you hit middle button to paste, GTK+ (and some other X apps) only show a single selection. At least, I think that's the reasoning. Personally, I think GTK+ applications should allow multiple selections under Linux as Firefox does. Selections are useful for more than just middle-button paste.
One point is also that to the end-user it might not be that obvious that some top-level windows belong to the same application instance (and thus GTK+ allows only one of them to have a selection at a time). Another time the user might have two instances of the application running, and then suddenly she can have a selection in each top-level window. Should this bug's component be changed to "general", then?
Given that there is some native Windows behaviour, I should probably file a new bug about my more general concern, so that if it is rejected this bug still gets investigated for win32 :)
My memory is that with native window apps (Firefox is not native, in the end) it's rare or impossible to get two apps to show text selection at the same time. The exact behavior is not quite the same as the X grab-the-primary-selection model, however.
Well, Firefox was a bad (too complex, no entirely "native") example. With Notepad and Wordpad running, I certainly can have selections showing in both at the same time.
As an example of why this is problematic, think about selecting some text and then using the Color selector to assign a color to it: a) Using the RGB or HSV spin buttons causes the text selection to be lost (this may be a separate issue, it doesn't seem to happen with all spinners, just the ones in the GtkColorSelection). Or b) Select the text in the "Color Name" text box and overwrite it (a seemingly standard operation, but causes the text that you're trying to manipulate to be unslected).
closing out ancient bugs