Skip to content
Snippets Groups Projects
Commit b96fdb7a authored by Olivier Fourdan's avatar Olivier Fourdan
Browse files

Fix issue with themes w/out pixmap mask,

Add trivial optimization frame draw.


(Old svn revision: 12317)
parent 14c7a0ea
No related branches found
No related tags found
No related merge requests found
...@@ -931,22 +931,25 @@ frameDraw (Client * c, gboolean invalidate_cache, gboolean force_shape_update) ...@@ -931,22 +931,25 @@ frameDraw (Client * c, gboolean invalidate_cache, gboolean force_shape_update)
&c->pm_cache.pm_sides[SIDE_BOTTOM][state], &c->pm_cache.pm_sides[SIDE_BOTTOM][state],
0, 0, bottom_width, frameBottom (c)); 0, 0, bottom_width, frameBottom (c));
xfwmWindowSetBG (&c->title, if (requires_clearing | force_shape_update)
&c->pm_cache.pm_title[state]); {
xfwmWindowSetBG (&c->sides[SIDE_LEFT], xfwmWindowSetBG (&c->title,
&c->pm_cache.pm_sides[SIDE_LEFT][state]); &c->pm_cache.pm_title[state]);
xfwmWindowSetBG (&c->sides[SIDE_RIGHT], xfwmWindowSetBG (&c->sides[SIDE_LEFT],
&c->pm_cache.pm_sides[SIDE_RIGHT][state]); &c->pm_cache.pm_sides[SIDE_LEFT][state]);
xfwmWindowSetBG (&c->sides[SIDE_BOTTOM], xfwmWindowSetBG (&c->sides[SIDE_RIGHT],
&c->pm_cache.pm_sides[SIDE_BOTTOM][state]); &c->pm_cache.pm_sides[SIDE_RIGHT][state]);
xfwmWindowSetBG (&c->corners[CORNER_TOP_LEFT], xfwmWindowSetBG (&c->sides[SIDE_BOTTOM],
&screen_info->corners[CORNER_TOP_LEFT][state]); &c->pm_cache.pm_sides[SIDE_BOTTOM][state]);
xfwmWindowSetBG (&c->corners[CORNER_TOP_RIGHT], xfwmWindowSetBG (&c->corners[CORNER_TOP_LEFT],
&screen_info->corners[CORNER_TOP_RIGHT][state]); &screen_info->corners[CORNER_TOP_LEFT][state]);
xfwmWindowSetBG (&c->corners[CORNER_BOTTOM_LEFT], xfwmWindowSetBG (&c->corners[CORNER_TOP_RIGHT],
&screen_info->corners[CORNER_BOTTOM_LEFT][state]); &screen_info->corners[CORNER_TOP_RIGHT][state]);
xfwmWindowSetBG (&c->corners[CORNER_BOTTOM_RIGHT], xfwmWindowSetBG (&c->corners[CORNER_BOTTOM_LEFT],
&screen_info->corners[CORNER_BOTTOM_RIGHT][state]); &screen_info->corners[CORNER_BOTTOM_LEFT][state]);
xfwmWindowSetBG (&c->corners[CORNER_BOTTOM_RIGHT],
&screen_info->corners[CORNER_BOTTOM_RIGHT][state]);
}
if (FLAG_TEST (c->flags, CLIENT_FLAG_SHADED)) if (FLAG_TEST (c->flags, CLIENT_FLAG_SHADED))
{ {
......
...@@ -222,30 +222,55 @@ xfwmPixmapFree (xfwmPixmap * pm) ...@@ -222,30 +222,55 @@ xfwmPixmapFree (xfwmPixmap * pm)
} }
} }
void static void
xfwmPixmapFill (xfwmPixmap * src, xfwmPixmap * dst, gint x, gint y, gint width, gint height) xfwmPixmapFillRectangle (Display *dpy, int screen, Pixmap pm, Drawable d, int x, int y, int width, int height)
{ {
XGCValues gv; XGCValues gv;
GC gc; GC gc;
unsigned long mask;
TRACE ("entering xfwmWindowFill"); TRACE ("entering fillRectangle");
if ((width < 1) || (height < 1)) if ((width < 1) || (height < 1))
{ {
return; return;
} }
gv.fill_style = FillTiled; gv.fill_style = FillTiled;
gv.tile = pm;
gv.ts_x_origin = x; gv.ts_x_origin = x;
gv.ts_y_origin = y; gv.ts_y_origin = y;
gv.foreground = WhitePixel (dpy, screen);
if (gv.tile != None)
{
mask = GCTile | GCFillStyle | GCTileStipXOrigin;
}
else
{
mask = GCForeground;
}
gc = XCreateGC (dpy, d, mask, &gv);
XFillRectangle (dpy, d, gc, x, y, width, height);
XFreeGC (dpy, gc);
}
void
xfwmPixmapFill (xfwmPixmap * src, xfwmPixmap * dst, gint x, gint y, gint width, gint height)
{
XGCValues gv;
GC gc;
unsigned long mask;
gv.tile = src->pixmap; TRACE ("entering xfwmWindowFill");
gc = XCreateGC (myScreenGetXDisplay (src->screen_info), dst->pixmap, GCTile | GCFillStyle | GCTileStipXOrigin, &gv);
XFillRectangle (myScreenGetXDisplay (src->screen_info), dst->pixmap, gc, x, y, width, height); if ((width < 1) || (height < 1))
XFreeGC (myScreenGetXDisplay (src->screen_info), gc); {
return;
}
gv.tile = src->mask; xfwmPixmapFillRectangle (myScreenGetXDisplay (src->screen_info),
gc = XCreateGC (myScreenGetXDisplay (src->screen_info), dst->mask, GCTile | GCFillStyle | GCTileStipXOrigin, &gv); src->screen_info->screen,
XFillRectangle (myScreenGetXDisplay (src->screen_info), dst->mask, gc, x, y, width, height); src->pixmap, dst->pixmap, x, y, width, height);
XFreeGC (myScreenGetXDisplay (src->screen_info), gc); xfwmPixmapFillRectangle (myScreenGetXDisplay (src->screen_info),
src->screen_info->screen,
src->mask, dst->mask, x, y, width, height);
} }
...@@ -11,6 +11,7 @@ static char * top_left_active_xpm[] = { ...@@ -11,6 +11,7 @@ static char * top_left_active_xpm[] = {
" $$@#++", " $$@#++",
" $.##+##", " $.##+##",
" $######", " $######",
"$.######",
"$@######", "$@######",
"$#######", "$#######",
"$#######", "$#######",
...@@ -25,5 +26,4 @@ static char * top_left_active_xpm[] = { ...@@ -25,5 +26,4 @@ static char * top_left_active_xpm[] = {
"$#######", "$#######",
"$#######", "$#######",
"$#######", "$#######",
"$#######",
"$#######"}; "$#######"};
...@@ -11,6 +11,7 @@ static char * top_left_inactive_xpm[] = { ...@@ -11,6 +11,7 @@ static char * top_left_inactive_xpm[] = {
" $$@#++", " $$@#++",
" $.##+##", " $.##+##",
" $######", " $######",
"$.######",
"$@######", "$@######",
"$#######", "$#######",
"$#######", "$#######",
...@@ -25,5 +26,4 @@ static char * top_left_inactive_xpm[] = { ...@@ -25,5 +26,4 @@ static char * top_left_inactive_xpm[] = {
"$#######", "$#######",
"$#######", "$#######",
"$#######", "$#######",
"$#######",
"$#######"}; "$#######"};
...@@ -11,6 +11,7 @@ static char * top_right_active_xpm[] = { ...@@ -11,6 +11,7 @@ static char * top_right_active_xpm[] = {
"++#@$$ ", "++#@$$ ",
"##+##.$ ", "##+##.$ ",
"######$ ", "######$ ",
"######.$",
"######@$", "######@$",
"#######$", "#######$",
"#######$", "#######$",
...@@ -25,5 +26,4 @@ static char * top_right_active_xpm[] = { ...@@ -25,5 +26,4 @@ static char * top_right_active_xpm[] = {
"#######$", "#######$",
"#######$", "#######$",
"#######$", "#######$",
"#######$",
"#######$"}; "#######$"};
...@@ -11,6 +11,7 @@ static char * top_right_inactive_xpm[] = { ...@@ -11,6 +11,7 @@ static char * top_right_inactive_xpm[] = {
"++#@$$ ", "++#@$$ ",
"##+##.$ ", "##+##.$ ",
"######$ ", "######$ ",
"######.$",
"######@$", "######@$",
"#######$", "#######$",
"#######$", "#######$",
...@@ -25,5 +26,4 @@ static char * top_right_inactive_xpm[] = { ...@@ -25,5 +26,4 @@ static char * top_right_inactive_xpm[] = {
"#######$", "#######$",
"#######$", "#######$",
"#######$", "#######$",
"#######$",
"#######$"}; "#######$"};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment