From 1d720b5dcf6a5f0e1c5e3048beab5a3d988a7ed4 Mon Sep 17 00:00:00 2001
From: Benedikt Meurer <benny@xfce.org>
Date: Fri, 24 Feb 2006 16:08:15 +0000
Subject: [PATCH] 2006-02-24	Benedikt Meurer <benny@xfce.org>

	* thunar/thunar-details-view.c(thunar_details_view_button_press_event),
	  thunar/thunar-shortcuts-view.c
	  (thunar_shortcuts_view_button_press_event): Properly verify the event
	  modifier state according to the default modifier mask.
	* thunar/thunar-icon-view.c: Add interactive search capabilities to the
	  ThunarIconView based on the latest changes to ExoIconView. Bug #1359.




(Old svn revision: 20029)
---
 ChangeLog                      |  9 +++++++++
 thunar/thunar-details-view.c   |  3 ++-
 thunar/thunar-icon-view.c      | 18 ++++++++++++++++++
 thunar/thunar-shortcuts-view.c |  4 ++--
 4 files changed, 31 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 0636c1122..e832655da 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2006-02-24	Benedikt Meurer <benny@xfce.org>
+
+	* thunar/thunar-details-view.c(thunar_details_view_button_press_event),
+	  thunar/thunar-shortcuts-view.c
+	  (thunar_shortcuts_view_button_press_event): Properly verify the event
+	  modifier state according to the default modifier mask.
+	* thunar/thunar-icon-view.c: Add interactive search capabilities to the
+	  ThunarIconView based on the latest changes to ExoIconView. Bug #1359.
+
 2006-02-24	Benedikt Meurer <benny@xfce.org>
 
 	* autogen.sh: Be sure to run svn info with LC_ALL=C.
diff --git a/thunar/thunar-details-view.c b/thunar/thunar-details-view.c
index 238d57ecd..20f430382 100644
--- a/thunar/thunar-details-view.c
+++ b/thunar/thunar-details-view.c
@@ -438,7 +438,8 @@ thunar_details_view_button_press_event (GtkTreeView       *tree_view,
   g_object_get (G_OBJECT (THUNAR_STANDARD_VIEW (details_view)->preferences), "misc-single-click", &single_click, NULL);
 
   /* check if the next button-release-event should activate the selected row (single click support) */
-  details_view->button_release_activates = (single_click && event->type == GDK_BUTTON_PRESS && event->button == 1 && event->state == 0);
+  details_view->button_release_activates = (single_click && event->type == GDK_BUTTON_PRESS && event->button == 1
+                                         && (event->state & gtk_accelerator_get_default_mod_mask ()) == 0);
 
   /* we unselect all selected items if the user clicks on an empty
    * area of the treeview and no modifier key is active.
diff --git a/thunar/thunar-icon-view.c b/thunar/thunar-icon-view.c
index a2d6e9ebf..79b8d42b3 100644
--- a/thunar/thunar-icon-view.c
+++ b/thunar/thunar-icon-view.c
@@ -69,6 +69,9 @@ static GtkAction   *thunar_icon_view_gesture_action         (ThunarIconView
 static void         thunar_icon_view_action_sort            (GtkAction           *action,
                                                              GtkAction           *current,
                                                              ThunarStandardView  *standard_view);
+static void         thunar_icon_view_notify_model           (ExoIconView         *view,
+                                                             GParamSpec          *pspec,
+                                                             ThunarIconView      *icon_view);
 static gboolean     thunar_icon_view_button_press_event     (ExoIconView         *view,
                                                              GdkEventButton      *event,
                                                              ThunarIconView      *icon_view);
@@ -227,6 +230,7 @@ thunar_icon_view_init (ThunarIconView *icon_view)
 
   /* create the real view */
   view = exo_icon_view_new ();
+  g_signal_connect (G_OBJECT (view), "notify::model", G_CALLBACK (thunar_icon_view_notify_model), icon_view);
   g_signal_connect (G_OBJECT (view), "button-press-event", G_CALLBACK (thunar_icon_view_button_press_event), icon_view);
   g_signal_connect (G_OBJECT (view), "key-press-event", G_CALLBACK (thunar_icon_view_key_press_event), icon_view);
   g_signal_connect (G_OBJECT (view), "item-activated", G_CALLBACK (thunar_icon_view_item_activated), icon_view);
@@ -236,6 +240,7 @@ thunar_icon_view_init (ThunarIconView *icon_view)
   gtk_widget_show (view);
 
   /* initialize the icon view properties */
+  exo_icon_view_set_enable_search (EXO_ICON_VIEW (view), TRUE);
   exo_icon_view_set_selection_mode (EXO_ICON_VIEW (view), GTK_SELECTION_MULTIPLE);
 
   /* add the icon renderer */
@@ -499,6 +504,19 @@ thunar_icon_view_action_sort (GtkAction          *action,
 
 
 
+static void
+thunar_icon_view_notify_model (ExoIconView    *view,
+                               GParamSpec     *pspec,
+                               ThunarIconView *icon_view)
+{
+  /* We need to set the search column here, as ExoIconView resets it
+   * whenever a new model is set.
+   */
+  exo_icon_view_set_search_column (view, THUNAR_COLUMN_NAME);
+}
+
+
+
 static gboolean
 thunar_icon_view_button_press_event (ExoIconView    *view,
                                      GdkEventButton *event,
diff --git a/thunar/thunar-shortcuts-view.c b/thunar/thunar-shortcuts-view.c
index 618dd7cbb..e8cc4e11f 100644
--- a/thunar/thunar-shortcuts-view.c
+++ b/thunar/thunar-shortcuts-view.c
@@ -335,8 +335,8 @@ thunar_shortcuts_view_button_press_event (GtkWidget      *widget,
   g_object_get (G_OBJECT (view->preferences), "misc-single-click", &single_click, NULL);
 
   /* check if the next button-release-event should activate the selected row (single click support) */
-  view->button_release_activates = (single_click && event->type == GDK_BUTTON_PRESS
-                                 && event->button == 1 && event->state == 0);
+  view->button_release_activates = (single_click && event->type == GDK_BUTTON_PRESS && event->button == 1
+                                 && (event->state & gtk_accelerator_get_default_mod_mask ()) == 0);
 
   /* ignore all kinds of double click events in single-click mode */
   if (G_UNLIKELY (single_click && event->type == GDK_2BUTTON_PRESS))
-- 
GitLab