[Xfce4-commits] [xfce/xfwm4] 02/03: Make composited wireframe prettier
noreply at xfce.org
noreply at xfce.org
Mon Jan 19 09:17:32 CET 2015
This is an automated email from the git hooks/post-receive script.
olivier pushed a commit to branch master
in repository xfce/xfwm4.
commit 33e3eaeceb699dbd997045fc5b59251bfb697d49
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date: Mon Jan 19 00:32:52 2015 +0100
Make composited wireframe prettier
---
src/wireframe.c | 35 ++++++++++++++++++++++-------------
1 file changed, 22 insertions(+), 13 deletions(-)
diff --git a/src/wireframe.c b/src/wireframe.c
index 3892d29..477143d 100644
--- a/src/wireframe.c
+++ b/src/wireframe.c
@@ -53,12 +53,17 @@ wireframeUpdate (Client *c, Window xwindow)
Visual *xvisual;
cairo_surface_t *surface;
cairo_t *cr;
+ gboolean composited = FALSE;
+ gdouble rgba = 1.0;
g_return_if_fail (c != NULL);
g_return_if_fail (xwindow != None);
TRACE ("entering wireframeUpdate 0x%lx", xwindow);
screen_info = c->screen_info;
+ composited = screen_info->compositor_active;
+ if (composited)
+ rgba = 0.2;
XUnmapWindow (clientGetXDisplay (c), xwindow);
XMoveResizeWindow (clientGetXDisplay (c), xwindow,
frameX (c), frameY (c), frameWidth (c), frameHeight (c));
@@ -103,27 +108,31 @@ wireframeUpdate (Client *c, Window xwindow)
XSubtractRegion (outer_xregion, inner_xregion, outer_xregion);
- XShapeCombineRegion (clientGetXDisplay (c), xwindow, ShapeBounding,
- 0, 0, outer_xregion, ShapeSet);
+ if (composited == FALSE)
+ XShapeCombineRegion (clientGetXDisplay (c), xwindow, ShapeBounding,
+ 0, 0, outer_xregion, ShapeSet);
XDestroyRegion (outer_xregion);
XDestroyRegion (inner_xregion);
XMapWindow (clientGetXDisplay (c), xwindow);
- cairo_set_source_rgba (cr, 0, 0, 0, 1);
+ cairo_set_source_rgba (cr, 0, 0, 0, rgba);
cairo_paint (cr);
cairo_set_line_width (cr, 1);
- cairo_set_line_join (cr, CAIRO_LINE_JOIN_MITER);
- cairo_set_source_rgba (cr, 1, 1, 1, 1);
+ cairo_set_line_join (cr, CAIRO_LINE_JOIN_MITER);
+ cairo_set_source_rgba (cr, rgba, rgba, rgba, rgba + 0.2);
cairo_rectangle (cr, 0.5, 0.5, frameWidth (c) - 1, frameHeight (c) - 1);
cairo_stroke (cr);
- cairo_rectangle (cr,
- OUTLINE_WIDTH - 0.5, OUTLINE_WIDTH - 0.5,
- frameWidth (c) - 2 * (OUTLINE_WIDTH - 1) - 1,
- frameHeight (c)- 2 * (OUTLINE_WIDTH - 1) - 1);
- cairo_stroke (cr);
+ if (composited == FALSE)
+ {
+ cairo_rectangle (cr,
+ OUTLINE_WIDTH - 0.5, OUTLINE_WIDTH - 0.5,
+ frameWidth (c) - 2 * (OUTLINE_WIDTH - 1) - 1,
+ frameHeight (c)- 2 * (OUTLINE_WIDTH - 1) - 1);
+ cairo_stroke (cr);
+ }
}
else
{
@@ -132,12 +141,12 @@ wireframeUpdate (Client *c, Window xwindow)
ShapeBounding, 0, 0, None, ShapeSet);
XMapWindow (clientGetXDisplay (c), xwindow);
- cairo_set_source_rgba (cr, 0, 0, 0, 1);
+ cairo_set_source_rgba (cr, 0, 0, 0, rgba);
cairo_paint (cr);
cairo_set_line_width (cr, 1);
- cairo_set_line_join (cr, CAIRO_LINE_JOIN_MITER);
- cairo_set_source_rgba (cr, 1, 1, 1, 1);
+ cairo_set_line_join (cr, CAIRO_LINE_JOIN_MITER);
+ cairo_set_source_rgba (cr, rgba, rgba, rgba, rgba + 0.2);
cairo_rectangle (cr, 0.5, 0.5, frameWidth (c) - 1, frameHeight (c) - 1);
cairo_stroke (cr);
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list