From 52714f60fc41b4ae12b390127c2d7855551b408f Mon Sep 17 00:00:00 2001
From: Benedikt Meurer <benny@xfce.org>
Date: Mon, 6 Feb 2006 18:21:06 +0000
Subject: [PATCH] 2006-02-06	Benedikt Meurer <benny@xfce.org>

	* thunar/thunar-templates-action.c: Use "show" instead of "map" to
	  create the Templates menu, to make sure the menu position is
	  determined properly.
	* README, configure.in.in, thunar/thunar-icon-view.c: Use cairo only
	  with Gtk+ >= 2.7.1.
	* thunar/thunar-shortcuts-view.c(thunar_shortcuts_view_init): Display
	  typeahead search for the shortcuts view.




(Old svn revision: 19769)
---
 ChangeLog                        | 10 +++++++
 README                           |  1 -
 configure.in.in                  |  5 ----
 thunar/thunar-icon-view.c        | 45 +++-----------------------------
 thunar/thunar-shortcuts-view.c   |  1 +
 thunar/thunar-templates-action.c | 10 +++----
 6 files changed, 19 insertions(+), 53 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index bf0fb3047..7df92ecf3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2006-02-06	Benedikt Meurer <benny@xfce.org>
+
+	* thunar/thunar-templates-action.c: Use "show" instead of "map" to
+	  create the Templates menu, to make sure the menu position is
+	  determined properly.
+	* README, configure.in.in, thunar/thunar-icon-view.c: Use cairo only
+	  with Gtk+ >= 2.7.1.
+	* thunar/thunar-shortcuts-view.c(thunar_shortcuts_view_init): Display
+	  typeahead search for the shortcuts view.
+
 2006-02-06	Benedikt Meurer <benny@xfce.org>
 
 	* thunar-vfs/thunar-vfs-transfer-job.c(thunar_vfs_transfer_job_execute):
diff --git a/README b/README
index 50c50a8f4..00263d74f 100644
--- a/README
+++ b/README
@@ -20,7 +20,6 @@ Thunar depends on the following packages:
 
 Thunar can optionally use the following packages:
 
- - cairo 0.5 or above
  - gamin 0.1.0 or above
  - gconf 2.4 or above
  - libjpeg 6 or above
diff --git a/configure.in.in b/configure.in.in
index 56849d184..d03ea4105 100644
--- a/configure.in.in
+++ b/configure.in.in
@@ -162,11 +162,6 @@ XDT_CHECK_PACKAGE([GTHREAD], [gthread-2.0], [2.6.4])
 XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.6.0])
 XDT_CHECK_PACKAGE([LIBPNG], [libpng12], [1.2.0])
 
-dnl **********************************
-dnl *** Optional support for cairo ***
-dnl **********************************
-XDT_CHECK_OPTIONAL_PACKAGE([CAIRO], [cairo], [0.5], [cairo], [Cairo])
-
 dnl *******************************************************
 dnl *** Optional support for gconf (GNOME thumbnailers) ***
 dnl *******************************************************
diff --git a/thunar/thunar-icon-view.c b/thunar/thunar-icon-view.c
index 110923622..b55b6700d 100644
--- a/thunar/thunar-icon-view.c
+++ b/thunar/thunar-icon-view.c
@@ -27,11 +27,6 @@
 #include <thunar/thunar-icon-view.h>
 #include <thunar/thunar-icon-view-ui.h>
 
-#if !GTK_CHECK_VERSION(2,7,1) && defined(GDK_WINDOWING_X11) && defined(HAVE_CAIRO)
-#include <cairo/cairo-xlib.h>
-#include <gdk/gdkx.h>
-#endif
-
 
 
 /* Property identifiers */
@@ -635,40 +630,6 @@ thunar_icon_view_button_release_event (ExoIconView    *view,
 
 
 
-#if GTK_CHECK_VERSION(2,7,1)
-static cairo_t*
-get_cairo_context (GdkWindow *window)
-{
-  return gdk_cairo_create (window);
-}
-#elif defined(GDK_WINDOWING_X11) && defined(HAVE_CAIRO)
-static cairo_t*
-get_cairo_context (GdkWindow *window)
-{
-  cairo_surface_t *surface;
-  GdkDrawable     *drawable;
-  cairo_t         *cr;
-  gint             w;
-  gint             h;
-  gint             x;
-  gint             y;
-
-  gdk_window_get_internal_paint_info (window, &drawable, &x, &y);
-  gdk_drawable_get_size (drawable, &w, &h);
-
-  surface = cairo_xlib_surface_create (GDK_DRAWABLE_XDISPLAY (drawable), GDK_DRAWABLE_XID (drawable),
-                                       gdk_x11_visual_get_xvisual (gdk_drawable_get_visual (drawable)), w, h);
-  cr = cairo_create (surface);
-  cairo_surface_destroy (surface);
-
-  cairo_translate (cr, -x, -y);
-
-  return cr;
-}
-#endif
-
-
-
 static gboolean
 thunar_icon_view_expose_event (ExoIconView    *view,
                                GdkEventExpose *event,
@@ -678,7 +639,7 @@ thunar_icon_view_expose_event (ExoIconView    *view,
   GtkAction  *action = NULL;
   GdkPixbuf  *stock_icon = NULL;
   gchar      *stock_id;
-#if GTK_CHECK_VERSION(2,7,1) || (defined(GDK_WINDOWING_X11) && defined(HAVE_CAIRO))
+#if GTK_CHECK_VERSION(2,7,1)
   GdkColor    bg;
   cairo_t    *cr;
 #endif
@@ -690,8 +651,8 @@ thunar_icon_view_expose_event (ExoIconView    *view,
   g_return_val_if_fail (icon_view->gesture_release_id > 0, FALSE);
 
   /* shade the icon view content while performing mouse gestures */
-#if GTK_CHECK_VERSION(2,7,1) || (defined(GDK_WINDOWING_X11) && defined(HAVE_CAIRO))
-  cr = get_cairo_context (event->window);
+#if GTK_CHECK_VERSION(2,7,1)
+  cr = gdk_cairo_create (event->window);
   bg = GTK_WIDGET (view)->style->base[GTK_STATE_NORMAL];
   cairo_set_source_rgba (cr, bg.red / 65535.0, bg.green / 65535.0, bg.blue / 65535.0, 0.7);
   cairo_rectangle (cr, event->area.x, event->area.y, event->area.width, event->area.height);
diff --git a/thunar/thunar-shortcuts-view.c b/thunar/thunar-shortcuts-view.c
index 314a733c8..29b6a6342 100644
--- a/thunar/thunar-shortcuts-view.c
+++ b/thunar/thunar-shortcuts-view.c
@@ -213,6 +213,7 @@ thunar_shortcuts_view_init (ThunarShortcutsView *view)
   GtkCellRenderer   *renderer;
 
   /* configure the tree view */
+  gtk_tree_view_set_enable_search (GTK_TREE_VIEW (view), FALSE);
   gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (view), FALSE);
 
   /* grab a reference on the preferences; be sure to redraw the view
diff --git a/thunar/thunar-templates-action.c b/thunar/thunar-templates-action.c
index 1fddde6cd..af05a6b46 100644
--- a/thunar/thunar-templates-action.c
+++ b/thunar/thunar-templates-action.c
@@ -42,7 +42,7 @@ static GtkWidget *thunar_templates_action_create_menu_item  (GtkAction
 static void       thunar_templates_action_fill_menu         (ThunarTemplatesAction      *templates_action,
                                                              ThunarVfsPath              *templates_path,
                                                              GtkWidget                  *menu);
-static void       thunar_templates_action_menu_mapped       (GtkWidget                  *menu,
+static void       thunar_templates_action_menu_shown        (GtkWidget                  *menu,
                                                              ThunarTemplatesAction      *templates_action);
 
 
@@ -154,9 +154,9 @@ thunar_templates_action_create_menu_item (GtkAction *action)
   /* let GtkAction allocate the menu item */
   item = (*GTK_ACTION_CLASS (thunar_templates_action_parent_class)->create_menu_item) (action);
 
-  /* associate an empty submenu with the item (will be filled when mapped) */
+  /* associate an empty submenu with the item (will be filled when shown) */
   menu = gtk_menu_new ();
-  g_signal_connect (G_OBJECT (menu), "map", G_CALLBACK (thunar_templates_action_menu_mapped), action);
+  g_signal_connect (G_OBJECT (menu), "show", G_CALLBACK (thunar_templates_action_menu_shown), action);
   gtk_menu_item_set_submenu (GTK_MENU_ITEM (item), menu);
 
   return item;
@@ -343,8 +343,8 @@ thunar_templates_action_fill_menu (ThunarTemplatesAction *templates_action,
 
 
 static void
-thunar_templates_action_menu_mapped (GtkWidget             *menu,
-                                     ThunarTemplatesAction *templates_action)
+thunar_templates_action_menu_shown (GtkWidget             *menu,
+                                    ThunarTemplatesAction *templates_action)
 {
   ThunarVfsPath *templates_path;
   ThunarVfsPath *home_path;
-- 
GitLab