I would like to ask a question about the strange behavior of
GtkEntry widgets. It seems that only one widget of these types can contain a selected area. Two typical scenarios:
(1) We have two text editors that use
GtkSourceView) widgets. We select a piece of text in one editor and switch to another one. As long as we process the text in the second editor nothing happens in the first one. But once we have selected a piece of text in the second editor, the selection in the first, unfocused editor disappears.
(2) We select a piece of text in the main window of a text editor and then open the
GtkFileChooserDialog in the Save File version. This dialog provides a
GtkEntry field that contains the file name which is selected by default. Creating the dialog removes the selection in the main window of the text editor. The same effect occurs by using the Find dialog.
Removing selection does not mean that the selected text disappears but that the the state being selected is deleted. The standard mark “selection_bound” is moved to the position of the cursor (and the signal “mark-set” is emitted).
I see this effect in many different versions of one popular Linux distribution.
Is this a bug or a feature? If this is a feature, what is it good for? What is its purpose?