take the window's border width into account when drawing the window
authorDana Jansens <danakj@orodu.net>
Thu, 10 Jun 2010 20:29:47 +0000 (16:29 -0400)
committerDana Jansens <danakj@orodu.net>
Sat, 26 Jun 2010 23:30:48 +0000 (01:30 +0200)
openbox/composite.c
openbox/event.c
openbox/window.h

index 77df36c1ba5c02c67535c717fbfd04665eb8041c..9398e1d23d8a0e763ef08f7e66936bf06169fff5 100644 (file)
@@ -351,7 +351,7 @@ static gboolean composite(gpointer data)
 
 //    for (it = stacking_list; it; it = g_list_next(it)) {
     for (it = g_list_last(stacking_list); it; it = g_list_previous(it)) {
-        gint d;
+        gint d, x, y, w, h;
 
         win = it->data;
         if (win->type == OB_WINDOW_CLASS_PROMPT)
@@ -398,21 +398,20 @@ time_fix(&dif);
         glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
         glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
 
+        x = win->area.x;
+        y = win->area.y;
+        w = win->area.width + win->border * 2;
+        h = win->area.height + win->border * 2;
+
         glBegin(GL_QUADS);
         glTexCoord2f(0, 0);
-        glVertex3f(win->comp_area.x, win->comp_area.y, 0.0);
+        glVertex3f(x, y, 0.0);
         glTexCoord2f(0, 1);
-        glVertex3f(win->comp_area.x,
-                   win->comp_area.y + win->comp_area.height,
-                   0.0);
+        glVertex3f(x, y + h, 0.0);
         glTexCoord2f(1, 1);
-        glVertex3f(win->comp_area.x + win->comp_area.width,
-                   win->comp_area.y + win->comp_area.height,
-                   0.0);
+        glVertex3f(x + w, y + h, 0.0);
         glTexCoord2f(1, 0);
-        glVertex3f(win->comp_area.x + win->comp_area.width,
-                   win->comp_area.y,
-                   0.0);
+        glVertex3f(x + w, y, 0.0);
         glEnd();
     }
     glXSwapBuffers(obt_display, obcomp.overlay);
index 5198ff720970225644e7e95f4081a20a059a0454..5c7a1952d1a29add43930e02b5c7281e2b5e36ba 100644 (file)
@@ -628,7 +628,8 @@ static void event_process(const XEvent *ec, gpointer data)
     {
         XCreateWindowEvent const *xe = &e->xcreatewindow;
         obwin->mapped = 0;
-        RECT_SET(obwin->comp_area, xe->x, xe->y, xe->width, xe->height);
+        RECT_SET(obwin->area, xe->x, xe->y, xe->width, xe->height);
+        obwin->border = xe->border_width;
         if (!obwin->texture) glGenTextures(1, &obwin->texture);
     }
     else if ((obwin && obwin->type != OB_WINDOW_CLASS_PROMPT) &&
@@ -641,13 +642,15 @@ static void event_process(const XEvent *ec, gpointer data)
 
         if (e->type == ConfigureNotify) {
             XConfigureEvent const *xe = &e->xconfigure;
-            if (obwin->comp_area.width != xe->width ||
-                obwin->comp_area.height != xe->height)
+            if (obwin->area.width != xe->width ||
+                obwin->area.height != xe->height ||
+                obwin->border != xe->border_width)
             {
                 pixchange = TRUE;
             }
-            RECT_SET(obwin->comp_area, xe->x, xe->y,
+            RECT_SET(obwin->area, xe->x, xe->y,
                      xe->width, xe->height);
+            obwin->border = xe->border_width;
         }
 
         if (e->type == MapNotify) {
index 27600c6b4f672e96e31ef8e10e1571da276b4205..a88768033dc1baca8fca2a9b6d17c3d7efc1e97e 100644 (file)
@@ -63,7 +63,8 @@ struct _ObWindow {
     Pixmap pixmap;
     GLXPixmap gpixmap;
     Damage damage;
-    Rect comp_area;
+    Rect area;
+    gint border;
     gboolean mapped;
 #endif
 };