X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/574479e8db6ac77d1f94183cddecd688e012504c..3503581b33fe1294ab45cbd762e09a655fabd81e:/src/gtk/textentry.cpp diff --git a/src/gtk/textentry.cpp b/src/gtk/textentry.cpp index ef3a08bd27..7d543738a3 100644 --- a/src/gtk/textentry.cpp +++ b/src/gtk/textentry.cpp @@ -204,6 +204,16 @@ void wxTextEntry::SetSelection(long from, long to) // insertion point is set to the start of the selection and not its end as // GTK+ does by default gtk_editable_select_region(GetEditable(), to, from); + + // avoid reported problem with RHEL 5 GTK+ 2.10 where selection is reset by + // a clipboard callback, see #13277 + if (gtk_check_version(2,12,0)) + { + GtkEntry* entry = GTK_ENTRY(GetEditable()); + if (to < 0) + to = entry->text_length; + entry->selection_bound = to; + } } void wxTextEntry::GetSelection(long *from, long *to) const @@ -269,7 +279,7 @@ bool wxTextEntry::DoAutoCompleteStrings(const wxArrayString& choices) bool wxTextEntry::IsEditable() const { - return gtk_editable_get_editable(GetEditable()); + return gtk_editable_get_editable(GetEditable()) != 0; } void wxTextEntry::SetEditable(bool editable)