[libgd] view: Check results of "selection-mode-request"



commit 98957371ba66af99e56eda43a2d8722bd370606b
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Jan 14 15:33:10 2014 +0100

    view: Check results of "selection-mode-request"
    
    If the signal handler for "selection-mode-request" didn't set
    the view in selection mode, don't start poking at rows and changing
    the selected state that we won't show.

 libgd/gd-main-view.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/libgd/gd-main-view.c b/libgd/gd-main-view.c
index 9a9781f..4211122 100644
--- a/libgd/gd-main-view.c
+++ b/libgd/gd-main-view.c
@@ -621,6 +621,11 @@ on_button_release_event (GtkWidget *view,
        {
          if (!self->priv->selection_mode)
            g_signal_emit (self, signals[SELECTION_MODE_REQUEST], 0);
+         if (!self->priv->selection_mode)
+           {
+             res = FALSE;
+             goto out;
+           }
 
          start_path = gtk_tree_path_copy (self->priv->rubberband_select_first_path);
          end_path = gtk_tree_path_copy (self->priv->rubberband_select_last_path);
@@ -673,7 +678,12 @@ on_button_release_event (GtkWidget *view,
       if (event_triggers_selection_mode (event))
         {
           g_signal_emit (self, signals[SELECTION_MODE_REQUEST], 0);
-          selection_mode = TRUE;
+          if (!self->priv->selection_mode)
+            {
+              res = FALSE;
+              goto out;
+            }
+          selection_mode = self->priv->selection_mode;
         }
     }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]