[gnome-documents] view: eat double/triple click button events in selection mode



commit b58724bd8318c27022e44718b73a5bbb98091d39
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Mon Nov 14 19:43:38 2011 -0500

    view: eat double/triple click button events in selection mode
    
    While in selection mode, a single click toggles selection for the
    clicked item; GTK+ emits this press events sequence for a double click
    - GTK_BUTTON_PRESS
    - GTK_BUTTON_PRESS
    - GTK_2BUTTON_PRESS
    Since we treat all clicks equally, if we don't do this we end up in the
    wrong state by processing three events instead of two.

 src/view.js |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/view.js b/src/view.js
index 6123b4f..ea6ab1c 100644
--- a/src/view.js
+++ b/src/view.js
@@ -233,6 +233,11 @@ View.prototype = {
             }
         }
 
+        // eat double/triple click events
+        let clickCount = event.get_click_count()[1];
+        if (clickCount > 1)
+            return true;
+
         let coords = [ event.get_coords()[1] , event.get_coords()[2] ];
         let path = this.getPathAtPos(coords);
 



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