From c11906fcdbe12bab387ae74830703bcd919249a2 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Fri, 12 Jun 2015 12:45:03 +0200 Subject: 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. --- gtk/gtktextview.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'gtk/gtktextview.c') 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); } } -- cgit v1.2.1