Index: display.c
===================================================================
RCS file: /cvsroot/rox/rox/ROX-Filer/src/display.c,v
retrieving revision 1.127
diff -u -r1.127 display.c
--- display.c	27 Apr 2004 10:34:30 -0000	1.127
+++ display.c	20 May 2004 08:42:30 -0000
@@ -273,10 +273,17 @@
 #define IS_A_DIR(item) (item->base_type == TYPE_DIRECTORY && \
 			!(item->flags & ITEM_FLAG_APPDIR))
 
+#define IS_APPDIR(item) (item->base_type == TYPE_DIRECTORY && \
+		         (item->flags & ITEM_FLAG_APPDIR))
+
 #define SORT_DIRS	\
 	if (o_display_dirs_first.int_value) {	\
-		gboolean id1 = IS_A_DIR(i1);	\
-		gboolean id2 = IS_A_DIR(i2);	\
+		gboolean id1 = (IS_APPDIR(i1) && (i1->leafname[0] == '!')); \
+		gboolean id2 = (IS_APPDIR(i2) && (i2->leafname[0] == '!')); \
+		if (id1 && !id2) return -1;     \
+		if (id2 && !id1) return 1;      \
+		id1 = IS_A_DIR(i1);	        \
+		id2 = IS_A_DIR(i2);	        \
 		if (id1 && !id2) return -1;				\
 		if (id2 && !id1) return 1;				\
 	}
