bad test in gtk_entry_real_set_position?
Submitted by Jim Paris
Link to original bug (#650998)
Description
In gtk_entry_real_set_position:
if (position != priv->current_pos || position != priv->selection_bound) { _gtk_entry_reset_im_context (entry); gtk_entry_set_positions (entry, position, position); }
That if() statement is always true if there is a selection, and so the selection gets unconditionally cleared by a call to gtk_entry_real_set_position. It looks to me like the intention was to NOT clear the selection if the requested position is already at either the beginning or the end of the selection, i.e. change || to &&. Typo?
This behavior was introduced in 2001 (27bf39f9). Prior to that, the selection was specifically NOT cleared if the requested position was at the beginning of the selection: if (position != entry->current_pos)
Now the selection IS cleared in the same situation.
Version: 3.22.x