From 3f6439ae665de2ea492c4f8ada519e9364499f51 Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Fri, 23 Mar 2012 16:50:13 +0000 Subject: [PATCH] avoid reported problem with RHEL 5 GTK+ 2.10 where selection is reset by a clipboard callback, closes #13277 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70989 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/textentry.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/gtk/textentry.cpp b/src/gtk/textentry.cpp index ef3a08bd27..d631d58899 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 -- 2.45.2