[SF#999] Fix unwanted unselection of items when right-clicked the desktop.
authorAndriy Grytsenko <andrej@rep.kiev.ua>
Sat, 3 Dec 2016 21:43:01 +0000 (23:43 +0200)
committerAndriy Grytsenko <andrej@rep.kiev.ua>
Sat, 3 Dec 2016 21:43:01 +0000 (23:43 +0200)
NEWS
src/desktop.c

diff --git a/NEWS b/NEWS
index d23deab..808e72f 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,10 @@
 * Removed 'Open in terminal' from context menu on folder on the desktop
     that cannot be opened in terminal.
 
+* Fixed invalid unref on CSS provider (GTK+ 3.0).
+
+* Fixed unwanted unselection of items when right-clicked the desktop.
+
 
 Changes on 1.2.4 since 1.2.3:
 
index ce42ce3..2458330 100644 (file)
@@ -3374,8 +3374,14 @@ static gboolean on_button_press(GtkWidget* w, GdkEventButton* evt)
         /* FIXME: do [un]selection on button release */
         if(! (evt->state & (GDK_SHIFT_MASK | GDK_CONTROL_MASK)))
         {
+            if (clicked_item == NULL)
+            {
+                if (evt->button == 1)
+                    /* SF bug #999: unselect all only on left button */
+                    _unselect_all(FM_FOLDER_VIEW(self));
+            }
             /* don't cancel selection if clicking on selected items */
-            if(!((evt->button == 1 || evt->button == 3) && clicked_item && clicked_item->is_selected))
+            else if (!((evt->button == 1 || evt->button == 3) && clicked_item->is_selected))
                 _unselect_all(FM_FOLDER_VIEW(self));
         }