diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2015-06-12 12:45:03 +0200 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2015-06-12 12:45:03 +0200 |
commit | c11906fcdbe12bab387ae74830703bcd919249a2 (patch) | |
tree | ffa8e11e772296f417b60b8d65f016343932acd4 /gtk/gtktextview.c | |
parent | 2be6d09c9ea7341478ac699c144178c2a001a197 (diff) | |
download | gtk+-c11906fcdbe12bab387ae74830703bcd919249a2.tar.gz |
textview: Perform tougher handle visibility checks after hiding the popover
The handles might fall outside the visible area, and shouldn't be shown
then. Just call gtk_text_view_update_handles() which will perform these
checks, and keep the handle conveniently hidden.
This was leading to unexpectedly visible handles (and in the
wrong/previous position, the handle code doesn't relocate the widget
it's about to hide) when "select all" was selected in the popover on
a textview needing scrollbars.
and extending the selection beyond the view above and/or below.
Diffstat (limited to 'gtk/gtktextview.c')
-rw-r--r-- | gtk/gtktextview.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c index 7edb925e64..29d0648ba8 100644 --- a/gtk/gtktextview.c +++ b/gtk/gtktextview.c @@ -9202,14 +9202,12 @@ show_or_hide_handles (GtkWidget *popover, handle = text_view->priv->text_handle; mode = _gtk_text_handle_get_mode (handle); - if (mode == GTK_TEXT_HANDLE_MODE_CURSOR) - { - _gtk_text_handle_set_visible (handle, GTK_TEXT_HANDLE_POSITION_CURSOR, !visible); - } - else if (mode == GTK_TEXT_HANDLE_MODE_SELECTION) + if (!visible) + gtk_text_view_update_handles (text_view, mode); + else { - _gtk_text_handle_set_visible (handle, GTK_TEXT_HANDLE_POSITION_SELECTION_START, !visible); - _gtk_text_handle_set_visible (handle, GTK_TEXT_HANDLE_POSITION_SELECTION_END, !visible); + _gtk_text_handle_set_visible (handle, GTK_TEXT_HANDLE_POSITION_SELECTION_START, FALSE); + _gtk_text_handle_set_visible (handle, GTK_TEXT_HANDLE_POSITION_SELECTION_END, FALSE); } } |