]> git.tdb.fi Git - geometrycompositor.git/commitdiff
Account for border when drawing windows
authorMikko Rasa <tdb@tdb.fi>
Fri, 11 Dec 2015 16:12:59 +0000 (18:12 +0200)
committerMikko Rasa <tdb@tdb.fi>
Fri, 11 Dec 2015 16:32:41 +0000 (18:32 +0200)
source/main.c

index 3f788848c119c6b230185a3878652566dd7214fd..637183f02bdbd54f17979da017b49b2854fae447 100644 (file)
@@ -16,6 +16,7 @@ typedef struct CompositedWindow
        int y;
        unsigned width;
        unsigned height;
+       unsigned border;
        int map_state;
        Damage damage;
        Pixmap pixmap;
@@ -277,6 +278,7 @@ void add_window(Compositor *compositor, CompositedScreen *screen, Window w)
        window->y = win_attr.y;
        window->width = win_attr.width;
        window->height = win_attr.height;
+       window->border = win_attr.border_width;
        window->map_state = win_attr.map_state;
 
        window->damage = XDamageCreate(compositor->display, window->window, XDamageReportNonEmpty);
@@ -535,7 +537,7 @@ void refresh_screens(Compositor *compositor)
                        {
                                glBindTexture(GL_TEXTURE_2D, window->texture);
                                compositor->glXBindTexImageEXT(compositor->display, window->glx_pixmap, GLX_FRONT_LEFT_EXT, NULL);
-                               glUniform4f(screen->geometry_loc, (float)window->x/screen->width, (float)(screen->height-window->y-window->height)/screen->height, (float)window->width/screen->width, (float)window->height/screen->height);
+                               glUniform4f(screen->geometry_loc, (float)window->x/screen->width, (float)(screen->height-window->y-window->height)/screen->height, (float)(window->width+2*window->border)/screen->width, (float)(window->height+2*window->border)/screen->height);
                                glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
                                compositor->glXReleaseTexImageEXT(compositor->display, window->glx_pixmap, GLX_FRONT_LEFT_EXT);
                                XDamageSubtract(compositor->display, window->damage, None, None);