You cannot really draw multiple quads with GL_TRIANGLE_STRIP, so convert
to using GL_TRIANGLES instead.

Fixes the highlight box, previously it occluded the selected window
thumbnail.

Signed-off-by: Pekka Paalanen <[email protected]>
---
 plugins/switcher/src/switcher.cpp |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/plugins/switcher/src/switcher.cpp 
b/plugins/switcher/src/switcher.cpp
index faeeb05..944b4a9 100644
--- a/plugins/switcher/src/switcher.cpp
+++ b/plugins/switcher/src/switcher.cpp
@@ -30,21 +30,29 @@ COMPIZ_PLUGIN_20090315 (switcher, SwitchPluginVTable)
 static float _boxVertices[] =
 {
     -(WIDTH >> 1), BOX_WIDTH, 0.0f,
+     (WIDTH >> 1), BOX_WIDTH, 0.0f,
+    -(WIDTH >> 1), 0.0f,      0.0f,
     -(WIDTH >> 1), 0.0f,      0.0f,
      (WIDTH >> 1), BOX_WIDTH, 0.0f,
      (WIDTH >> 1), 0.0f,      0.0f,
 
     -(WIDTH >> 1),             HEIGHT - BOX_WIDTH, 0.0f,
+    -(WIDTH >> 1) + BOX_WIDTH, HEIGHT - BOX_WIDTH, 0.0f,
+    -(WIDTH >> 1),             BOX_WIDTH,          0.0f,
     -(WIDTH >> 1),             BOX_WIDTH,          0.0f,
     -(WIDTH >> 1) + BOX_WIDTH, HEIGHT - BOX_WIDTH, 0.0f,
-    -(WIDTH >> 1) + BOX_WIDTH, 0.0f,               0.0f,
+    -(WIDTH >> 1) + BOX_WIDTH, BOX_WIDTH,          0.0f,
 
      (WIDTH >> 1) - BOX_WIDTH, HEIGHT - BOX_WIDTH, 0.0f,
+     (WIDTH >> 1),             HEIGHT - BOX_WIDTH, 0.0f,
+     (WIDTH >> 1) - BOX_WIDTH, BOX_WIDTH,          0.0f,
      (WIDTH >> 1) - BOX_WIDTH, BOX_WIDTH,          0.0f,
      (WIDTH >> 1),             HEIGHT - BOX_WIDTH, 0.0f,
-     (WIDTH >> 1),             0.0f,               0.0f,
+     (WIDTH >> 1),             BOX_WIDTH,          0.0f,
 
     -(WIDTH >> 1), HEIGHT,             0.0f,
+     (WIDTH >> 1), HEIGHT,             0.0f,
+    -(WIDTH >> 1), HEIGHT - BOX_WIDTH, 0.0f,
     -(WIDTH >> 1), HEIGHT - BOX_WIDTH, 0.0f,
      (WIDTH >> 1), HEIGHT,             0.0f,
      (WIDTH >> 1), HEIGHT - BOX_WIDTH, 0.0f,
@@ -1003,10 +1011,10 @@ SwitchWindow::glPaint (const GLWindowPaintAttrib 
&attrib,
                       0xffff;
        }
 
-       streamingBuffer->begin (GL_TRIANGLE_STRIP);
+       streamingBuffer->begin (GL_TRIANGLES);
 
        streamingBuffer->addColors (1, color);
-       streamingBuffer->addVertices (16, _boxVertices);
+       streamingBuffer->addVertices (24, _boxVertices);
 
        streamingBuffer->end ();
        streamingBuffer->render (wTransform, attrib);
-- 
1.7.3.4

_______________________________________________
dev mailing list
[email protected]
http://lists.compiz.org/mailman/listinfo/dev

Reply via email to