Ok, i rewrite the patch, it was so bad in fact, i think.

Please have a look at this one and tell me if it seems good.

Cedric
--- compiz_orig/plugins/switcher.c	2006-11-12 13:07:13.002956444 +0100
+++ compiz/plugins/switcher.c	2006-11-12 13:08:11.867007747 +0100
@@ -83,6 +83,8 @@
 
 #define SWITCH_MINIMIZED_DEFAULT TRUE
 
+#define SWITCH_SHOW_WINDOW_LIST_DEFAULT TRUE
+
 static char *winType[] = {
     N_("Toolbar"),
     N_("Utility"),
@@ -110,18 +112,19 @@
     Atom selectWinAtom;
 } SwitchDisplay;
 
-#define SWITCH_SCREEN_OPTION_SPEED	  0
-#define SWITCH_SCREEN_OPTION_TIMESTEP	  1
-#define SWITCH_SCREEN_OPTION_WINDOW_TYPE  2
-#define SWITCH_SCREEN_OPTION_MIPMAP	  3
-#define SWITCH_SCREEN_OPTION_SATURATION	  4
-#define SWITCH_SCREEN_OPTION_BRIGHTNESS	  5
-#define SWITCH_SCREEN_OPTION_OPACITY	  6
-#define SWITCH_SCREEN_OPTION_BRINGTOFRONT 7
-#define SWITCH_SCREEN_OPTION_ZOOM	  8
-#define SWITCH_SCREEN_OPTION_ICON	  9
-#define SWITCH_SCREEN_OPTION_MINIMIZED	  10
-#define SWITCH_SCREEN_OPTION_NUM	  11
+#define SWITCH_SCREEN_OPTION_SPEED	  	0
+#define SWITCH_SCREEN_OPTION_TIMESTEP	  	1
+#define SWITCH_SCREEN_OPTION_WINDOW_TYPE  	2
+#define SWITCH_SCREEN_OPTION_MIPMAP	  	3
+#define SWITCH_SCREEN_OPTION_SATURATION	  	4
+#define SWITCH_SCREEN_OPTION_BRIGHTNESS	  	5
+#define SWITCH_SCREEN_OPTION_OPACITY	  	6
+#define SWITCH_SCREEN_OPTION_BRINGTOFRONT 	7
+#define SWITCH_SCREEN_OPTION_ZOOM	  	8
+#define SWITCH_SCREEN_OPTION_ICON	  	9
+#define SWITCH_SCREEN_OPTION_MINIMIZED	  	10
+#define SWITCH_SCREEN_OPTION_SHOW_WINDOW_LIST	11
+#define SWITCH_SCREEN_OPTION_NUM	  	12
 
 typedef struct _SwitchScreen {
     PreparePaintScreenProc preparePaintScreen;
@@ -171,6 +174,7 @@
 
     Bool bringToFront;
     Bool allWindows;
+    Bool showWindowList;
 } SwitchScreen;
 
 #define MwmHintsDecorations (1L << 1)
@@ -252,7 +256,7 @@
     int	        index;
 
     SWITCH_SCREEN (screen);
-
+	                
     o = compFindOption (ss->opt, NUM_OPTIONS (ss), name, &index);
     if (!o)
 	return FALSE;
@@ -285,6 +289,13 @@
 	if (compSetBoolOption (o, value))
 	    return TRUE;
 	break;
+    case SWITCH_SCREEN_OPTION_SHOW_WINDOW_LIST:
+	if (compSetBoolOption (o, value))
+	{
+	    ss->showWindowList = o->value.b;
+            return TRUE;
+        }
+	break;	
     case SWITCH_SCREEN_OPTION_SATURATION:
 	if (compSetIntOption (o, value))
 	{
@@ -443,6 +454,13 @@
     o->longDesc	  = N_("Show minimized windows");
     o->type	  = CompOptionTypeBool;
     o->value.b    = SWITCH_MINIMIZED_DEFAULT;
+
+    o = &ss->opt[SWITCH_SCREEN_OPTION_SHOW_WINDOW_LIST];
+    o->name	  = "window_list";
+    o->shortDesc  = N_("Window list");
+    o->longDesc	  = N_("Show window list");
+    o->type	  = CompOptionTypeBool;
+    o->value.b    = SWITCH_SHOW_WINDOW_LIST_DEFAULT;
 }
 
 static void
@@ -741,7 +759,13 @@
     if (count < 1)
 	return;
 
-    if (!ss->popupWindow)
+    if (!ss->showWindowList && ss->popupWindow)
+    {
+        XDestroyWindow (s->display->display, ss->popupWindow);
+        ss->popupWindow=FALSE;
+    }
+
+    if (ss->showWindowList && !ss->popupWindow)
     {
 	Display		     *dpy = s->display->display;
 	XSizeHints	     xsh;
@@ -843,7 +867,8 @@
 		}
 	    }
 
-	    setSelectedWindowHint (s);
+	    if (ss->showWindowList)
+                setSelectedWindowHint (s);
 	}
 
 	damageScreen (s);
@@ -2039,9 +2064,10 @@
     ss->brightness = (0xffff * SWITCH_BRIGHTNESS_DEFAULT) / 100;
     ss->opacity    = (OPAQUE * SWITCH_OPACITY_DEFAULT)    / 100;
 
-    ss->bringToFront = SWITCH_BRINGTOFRONT_DEFAULT;
-    ss->allWindows   = FALSE;
-
+    ss->bringToFront   = SWITCH_BRINGTOFRONT_DEFAULT;
+    ss->allWindows     = FALSE;
+    ss->showWindowList = SWITCH_SHOW_WINDOW_LIST_DEFAULT;
+    
     switchScreenInitOptions (ss);
 
     addScreenAction (s, &sd->opt[SWITCH_DISPLAY_OPTION_NEXT].value.action);
_______________________________________________
compiz mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/compiz

Reply via email to