From 22f6729e4863cf8019fd7b61ec6ec948c76f4685 Mon Sep 17 00:00:00 2001 From: Patrick Niklaus Date: Mon, 25 Feb 2008 18:45:13 +0100 Subject: Use visual and depth of the window to support RGBA. --- plugins/svg.c | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/plugins/svg.c b/plugins/svg.c index 69714def..bd39174f 100644 --- a/plugins/svg.c +++ b/plugins/svg.c @@ -133,7 +133,7 @@ renderSvg (CompScreen *s, cairo_save (texture->cr); cairo_set_operator (texture->cr, CAIRO_OPERATOR_SOURCE); - cairo_set_source_rgb (texture->cr, 1.0, 1.0, 1.0); + cairo_set_source_rgba (texture->cr, 1.0, 1.0, 1.0, 0.0); cairo_paint (texture->cr); cairo_set_operator (texture->cr, CAIRO_OPERATOR_OVER); @@ -153,13 +153,14 @@ renderSvg (CompScreen *s, } static Bool -initSvgTexture (CompScreen *s, +initSvgTexture (CompWindow *w, SvgSource *source, SvgTexture *texture, int width, int height) { cairo_surface_t *surface; + CompScreen *s = w->screen; Visual *visual; int depth; @@ -173,7 +174,10 @@ initSvgTexture (CompScreen *s, if (width && height) { - depth = DefaultDepth (s->display->display, s->screenNum); + XWindowAttributes attr; + XGetWindowAttributes (s->display->display, w->id, &attr); + + depth = attr.depth; texture->pixmap = XCreatePixmap (s->display->display, s->root, width, height, depth); @@ -190,8 +194,7 @@ initSvgTexture (CompScreen *s, return FALSE; } - visual = DefaultVisual (s->display->display, s->screenNum); - + visual = attr.visual; surface = cairo_xlib_surface_create (s->display->display, texture->pixmap, visual, width, height); @@ -351,7 +354,7 @@ svgDrawWindow (CompWindow *w, finiSvgTexture (w->screen, &sw->context->texture[1]); - if (initSvgTexture (w->screen, sw->context->source, + if (initSvgTexture (w, sw->context->source, &sw->context->texture[1], width, height)) { @@ -381,9 +384,7 @@ svgDrawWindow (CompWindow *w, else if (sw->context->texture[1].width) { finiSvgTexture (w->screen, &sw->context->texture[1]); - initSvgTexture (w->screen, sw->source, - &sw->context->texture[1], - 0, 0); + initSvgTexture (w, sw->source, &sw->context->texture[1], 0, 0); memset (&sw->context->rect, 0, sizeof (BoxRec)); @@ -421,9 +422,7 @@ updateWindowSvgContext (CompWindow *w, sw->context->width = 0; sw->context->height = 0; - initSvgTexture (w->screen, source, - &sw->context->texture[1], - 0, 0); + initSvgTexture (w, source, &sw->context->texture[1], 0, 0); sw->context->source = source; @@ -445,8 +444,7 @@ updateWindowSvgContext (CompWindow *w, x2 = MIN (x2, w->width); y2 = MIN (y2, w->height); - if (!initSvgTexture (w->screen, source, - &sw->context->texture[0], + if (!initSvgTexture (w, source, &sw->context->texture[0], w->width, w->height)) { free (sw->context); @@ -457,7 +455,7 @@ updateWindowSvgContext (CompWindow *w, renderSvg (w->screen, source, &sw->context->texture[0], 0.0f, 0.0f, 1.0f, 1.0f, w->width, w->height); - initSvgTexture (w->screen, source, &sw->context->texture[1], 0, 0); + initSvgTexture (w, source, &sw->context->texture[1], 0, 0); sw->context->box.extents.x1 = x1; sw->context->box.extents.y1 = y1; -- cgit v1.2.3 From df6687a85bb7788b9766c1633982203daea8731a Mon Sep 17 00:00:00 2001 From: Dennis Kasprzyk Date: Tue, 26 Feb 2008 01:34:47 +0100 Subject: Rotate in right direction if hsize is 3. --- plugins/rotate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/rotate.c b/plugins/rotate.c index dfee3268..36fb50d4 100644 --- a/plugins/rotate.c +++ b/plugins/rotate.c @@ -1606,9 +1606,9 @@ rotateHandleEvent (CompDisplay *d, XQueryPointer (d->display, s->root, &win, &win, &x, &y, &i, &i, &ui); - if (dx > (s->hsize + 1) / 2) + if (dx * 2 > s->hsize) dx -= s->hsize; - else if (dx < -(s->hsize + 1) / 2) + else if (dx * 2 < -s->hsize) dx += s->hsize; o[0].type = CompOptionTypeInt; -- cgit v1.2.3 From 81a0ca4b154625cb65b9d57a5c081806c84fc1fb Mon Sep 17 00:00:00 2001 From: Dennis Kasprzyk Date: Tue, 26 Feb 2008 02:45:09 +0100 Subject: Clear switcher content to make sure that the new background pixmap gets applied. --- kde/window-decorator-kde4/switcher.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/kde/window-decorator-kde4/switcher.cpp b/kde/window-decorator-kde4/switcher.cpp index 52b9e975..b5a9897b 100644 --- a/kde/window-decorator-kde4/switcher.cpp +++ b/kde/window-decorator-kde4/switcher.cpp @@ -224,6 +224,7 @@ KWD::Switcher::redrawPixmap () XSetWindowBackgroundPixmap (QX11Info::display (), mId, mBackgroundPixmap.handle ()); + XClearWindow (QX11Info::display (), mId); } void -- cgit v1.2.3