use simplewindow function to refresh and rework left/right pixmap handling
I love hacking at 280 km/h
This commit is contained in:
parent
0e4568b305
commit
3b899c4922
33
statusbar.c
33
statusbar.c
|
@ -79,8 +79,24 @@ statusbar_draw(Statusbar *statusbar)
|
||||||
Drawable d;
|
Drawable d;
|
||||||
|
|
||||||
/* don't waste our time */
|
/* don't waste our time */
|
||||||
if(statusbar->position == Off)
|
switch(statusbar->position)
|
||||||
|
{
|
||||||
|
case Off:
|
||||||
return;
|
return;
|
||||||
|
break;
|
||||||
|
case Right:
|
||||||
|
case Left:
|
||||||
|
/* we need a new pixmap this way [ ] to render */
|
||||||
|
XFreePixmap(globalconf.display, statusbar->sw->drawable);
|
||||||
|
d = XCreatePixmap(globalconf.display,
|
||||||
|
RootWindow(globalconf.display, phys_screen),
|
||||||
|
statusbar->width, statusbar->height,
|
||||||
|
DefaultDepth(globalconf.display, phys_screen));
|
||||||
|
statusbar->sw->drawable = d;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
DrawCtx *ctx = draw_get_context(phys_screen,
|
DrawCtx *ctx = draw_get_context(phys_screen,
|
||||||
statusbar->width,
|
statusbar->width,
|
||||||
|
@ -142,24 +158,11 @@ statusbar_draw(Statusbar *statusbar)
|
||||||
void
|
void
|
||||||
statusbar_display(Statusbar *statusbar)
|
statusbar_display(Statusbar *statusbar)
|
||||||
{
|
{
|
||||||
int phys_screen = get_phys_screen(statusbar->screen);
|
|
||||||
|
|
||||||
/* don't waste our time */
|
/* don't waste our time */
|
||||||
if(statusbar->position == Off)
|
if(statusbar->position == Off)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(statusbar->position == Right
|
simplewindow_refresh_drawable(statusbar->sw, get_phys_screen(statusbar->screen));
|
||||||
|| statusbar->position == Left)
|
|
||||||
XCopyArea(globalconf.display, statusbar->sw->drawable,
|
|
||||||
statusbar->sw->window,
|
|
||||||
DefaultGC(globalconf.display, phys_screen), 0, 0,
|
|
||||||
statusbar->sw->geometry.height,
|
|
||||||
statusbar->sw->geometry.width, 0, 0);
|
|
||||||
else
|
|
||||||
XCopyArea(globalconf.display, statusbar->sw->drawable,
|
|
||||||
statusbar->sw->window,
|
|
||||||
DefaultGC(globalconf.display, phys_screen), 0, 0,
|
|
||||||
statusbar->sw->geometry.width, statusbar->sw->geometry.height, 0, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in New Issue