fixed bad background with fake transparency+hidden panel
git-svn-id: http://tint2.googlecode.com/svn/trunk@350 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
This commit is contained in:
16
src/panel.c
16
src/panel.c
@@ -551,6 +551,12 @@ void set_panel_background(Panel *p)
|
|||||||
if (p->area.pix) XFreePixmap (server.dsp, p->area.pix);
|
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);
|
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) {
|
if (real_transparency) {
|
||||||
clear_pixmap(p->area.pix, 0, 0, p->area.width, p->area.height);
|
clear_pixmap(p->area.pix, 0, 0, p->area.width, p->area.height);
|
||||||
}
|
}
|
||||||
@@ -560,6 +566,11 @@ void set_panel_background(Panel *p)
|
|||||||
Window dummy;
|
Window dummy;
|
||||||
int x, y;
|
int x, y;
|
||||||
XTranslateCoordinates(server.dsp, p->main_win, server.root_win, 0, 0, &x, &y, &dummy);
|
XTranslateCoordinates(server.dsp, p->main_win, server.root_win, 0, 0, &x, &y, &dummy);
|
||||||
|
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);
|
XSetTSOrigin(server.dsp, server.gc, -x, -y);
|
||||||
XFillRectangle(server.dsp, p->area.pix, server.gc, 0, 0, p->area.width, p->area.height);
|
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 (panel_autohide) {
|
||||||
if (p->hidden_pixmap) XFreePixmap(server.dsp, p->hidden_pixmap);
|
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);
|
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);
|
XCopyArea(server.dsp, p->area.pix, p->hidden_pixmap, server.gc, xoff, yoff, p->hidden_width, p->hidden_height, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -263,6 +263,7 @@ int tint2_handles_click(Panel* panel, XButtonEvent* e)
|
|||||||
if (tskbar && e->button == 1 && panel_mode == MULTI_DESKTOP)
|
if (tskbar && e->button == 1 && panel_mode == MULTI_DESKTOP)
|
||||||
return 1;
|
return 1;
|
||||||
if (click_clock(panel, e->x, e->y)) {
|
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) )
|
if ( (e->button == 1 && clock_lclick_command) || (e->button == 3 && clock_rclick_command) )
|
||||||
return 1;
|
return 1;
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user