]> Dogcows Code - chaz/tint2/commitdiff
fixed bad background with fake transparency+hidden panel
authorThierry Lorthiois <lorthiois@bbsoft.fr>
Thu, 14 Jan 2010 22:55:08 +0000 (22:55 +0000)
committerThierry Lorthiois <lorthiois@bbsoft.fr>
Thu, 14 Jan 2010 22:55:08 +0000 (22:55 +0000)
src/panel.c
src/tint.c

index 9711ebc01497986bce7ced723808be6b254c1468..77dcb2dd5eac3db002dfca808503a06a2ba43f24 100644 (file)
@@ -551,6 +551,12 @@ void set_panel_background(Panel *p)
        if (p->area.pix) XFreePixmap (server.dsp, p->area.pix);
        p->area.pix = XCreatePixmap (server.dsp, server.root_win, p->area.width, p->area.height, server.depth);
 
+       int xoff=0, yoff=0;
+       if (panel_horizontal && panel_position & BOTTOM)
+               yoff = p->area.height-p->hidden_height;
+       else if (!panel_horizontal && panel_position & RIGHT)
+               xoff = p->area.width-p->hidden_width;
+
        if (real_transparency) {
                clear_pixmap(p->area.pix, 0, 0, p->area.width, p->area.height);
        }
@@ -560,7 +566,12 @@ void set_panel_background(Panel *p)
                Window dummy;
                int  x, y;
                XTranslateCoordinates(server.dsp, p->main_win, server.root_win, 0, 0, &x, &y, &dummy);
-               XSetTSOrigin(server.dsp, server.gc, -x, -y) ;
+               if (panel_autohide && p->is_hidden) {
+                       x -= xoff;
+                       y -= yoff;
+               }
+               //printf("x %d, y %d\n", x, y);
+               XSetTSOrigin(server.dsp, server.gc, -x, -y);
                XFillRectangle(server.dsp, p->area.pix, server.gc, 0, 0, p->area.width, p->area.height);
        }
 
@@ -576,11 +587,6 @@ void set_panel_background(Panel *p)
        if (panel_autohide) {
                if (p->hidden_pixmap) XFreePixmap(server.dsp, p->hidden_pixmap);
                p->hidden_pixmap = XCreatePixmap(server.dsp, server.root_win, p->hidden_width, p->hidden_height, server.depth);
-               int xoff=0, yoff=0;
-               if (panel_horizontal && panel_position & BOTTOM)
-                       yoff = p->area.height-p->hidden_height;
-               else if (!panel_horizontal && panel_position & RIGHT)
-                       xoff = p->area.width-p->hidden_width;
                XCopyArea(server.dsp, p->area.pix, p->hidden_pixmap, server.gc, xoff, yoff, p->hidden_width, p->hidden_height, 0, 0);
        }
 
index 0004f30ccb6770dfb812d67bcd5b6f05f5170edb..2c991215f5924a2e799fb37fa612f7d08c6de341 100644 (file)
@@ -263,6 +263,7 @@ int tint2_handles_click(Panel* panel, XButtonEvent* e)
        if (tskbar && e->button == 1 && panel_mode == MULTI_DESKTOP)
                return 1;
        if (click_clock(panel, e->x, e->y)) {
+               printf("ici 1 : %d\n", e->button);
                if ( (e->button == 1 && clock_lclick_command) || (e->button == 3 && clock_rclick_command) )
                        return 1;
                else
This page took 0.031872 seconds and 4 git commands to generate.