Hi Benedikt,

The current workaround for the quirk where GTK+ continually tries to
hide and then display the scrollbar allows for some pretty wacky
behavior in Compact List View.  For example, it is possible to resize
the window in such a way that:
1) it becomes impossible to scroll to certain files,
http://filebox.vt.edu/users/mmcclinc/layout-problem1.png
2) you can navigate to certain files, but they won't be displayed, or
http://filebox.vt.edu/users/mmcclinc/layout-problem2.png
3) you can scroll past the last column of files, leaving a blank window.
http://filebox.vt.edu/users/mmcclinc/layout-problem3.png

Therefore, I propose that the horizontal scrollbar in Compact List View
always be visible, whether it is necessary or not.  That would allow you
to get rid of the quirky workaround in libexo.  I have attached patches
for thunar and libexo that do this.


Matt McClinch

Index: exo/exo-icon-view.c
===================================================================
--- exo/exo-icon-view.c	(revision 22593)
+++ exo/exo-icon-view.c	(working copy)
@@ -425,7 +425,6 @@
 struct _ExoIconViewPrivate
 {
   gint width, height;
-  gint prev_width, prev_height; /* exo_icon_view_layout() contains a note about these ones */
 
   GtkSelectionMode selection_mode;
 
@@ -3256,27 +3255,11 @@
 
       x += icon_view->priv->margin;
 
-      /* We remember the previous height/width to make sure we don't run into an endless loop
-       * with GtkScrolledWindow trying to remove an automatic scrollbar, layouting the icons
-       * again, GtkScrolledWindow notices that the scrollbar is necessary, readds it, layouting
-       * again, GtkScrolledWindow tries to remove automatic scrollbar, and so on... GTK+ is really
-       * a mess sometimes.
-       */
-      if ((maximum_height != icon_view->priv->height && maximum_height != icon_view->priv->prev_height)
-          || (x != icon_view->priv->width && x != icon_view->priv->prev_width))
-        {
-          if (maximum_height != icon_view->priv->height)
-            {
-              icon_view->priv->prev_height = icon_view->priv->height;
-              icon_view->priv->height = maximum_height;
-            }
+      if (maximum_height != icon_view->priv->height)
+        icon_view->priv->height = maximum_height;
 
-          if (x != icon_view->priv->width)
-            {
-              icon_view->priv->prev_width = icon_view->priv->width;
-              icon_view->priv->width = x;
-            }
-        }
+      if (x != icon_view->priv->width)
+        icon_view->priv->width = x;
     }
 
   exo_icon_view_set_adjustment_upper (icon_view->priv->hadjustment, icon_view->priv->width);

Index: thunar/thunar-compact-view.c
===================================================================
--- thunar/thunar-compact-view.c	(revision 22593)
+++ thunar/thunar-compact-view.c	(working copy)
@@ -101,6 +101,10 @@
 static void
 thunar_compact_view_init (ThunarCompactView *compact_view)
 {
+  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (compact_view),
+                                  GTK_POLICY_ALWAYS,
+                                  GTK_POLICY_AUTOMATIC);
+
  /* initialize the icon view properties */
   exo_icon_view_set_margin (EXO_ICON_VIEW (GTK_BIN (compact_view)->child), 3);
   exo_icon_view_set_layout_mode (EXO_ICON_VIEW (GTK_BIN (compact_view)->child), EXO_ICON_VIEW_LAYOUT_COLS);

_______________________________________________
Thunar-dev mailing list
[email protected]
http://foo-projects.org/mailman/listinfo/thunar-dev

Reply via email to