diff --git a/ChangeLog b/ChangeLog index 60648f274..369ab7fde 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2004-08-26 Havoc Pennington + + * src/frame.c, src/theme.c: couple of cosmetic tweaks from + resolving my local patch with the bugzilla patch from the 8-19 + entry below + 2004-08-26 Havoc Pennington * configure.in: move the have_xrender variable initialization up diff --git a/src/frame.c b/src/frame.c index ca600339d..679b348ba 100644 --- a/src/frame.c +++ b/src/frame.c @@ -26,8 +26,6 @@ #include "errors.h" #include "keybindings.h" -#include - #ifdef HAVE_RENDER #include #endif @@ -95,6 +93,61 @@ find_argb_visual (MetaDisplay *display, #endif /* !RENDER */ } +static Visual* +find_argb_visual (MetaDisplay *display, + int scr) +{ +#ifdef HAVE_RENDER + XVisualInfo *xvi; + XVisualInfo template; + int nvi; + int i; + XRenderPictFormat *format; + Visual *visual; + + if (!META_DISPLAY_HAS_RENDER (display)) + return NULL; + + template.screen = scr; + template.depth = 32; + template.class = TrueColor; + xvi = XGetVisualInfo (display->xdisplay, + VisualScreenMask | + VisualDepthMask | + VisualClassMask, + &template, + &nvi); + if (!xvi) + return 0; + + visual = NULL; + + for (i = 0; i < nvi; i++) + { + format = XRenderFindVisualFormat (display->xdisplay, xvi[i].visual); + if (format->type == PictTypeDirect && format->direct.alphaMask) + { + visual = xvi[i].visual; + break; + } + } + + XFree (xvi); + + if (visual) + meta_topic (META_DEBUG_COMPOSITOR, + "Found ARGB visual 0x%lx\n", + (long) visual->visualid); + else + meta_topic (META_DEBUG_COMPOSITOR, + "No ARGB visual found\n"); + + return visual; +#else /* RENDER */ + return NULL; +#endif /* !RENDER */ +} + void meta_window_ensure_frame (MetaWindow *window) { diff --git a/src/theme.c b/src/theme.c index 7ed48277f..4f3d25901 100644 --- a/src/theme.c +++ b/src/theme.c @@ -2663,7 +2663,10 @@ get_gc_for_primitive (GtkWidget *widget, meta_color_spec_render (color_spec, widget, &color); values.foreground = color; - gdk_rgb_find_color (gdk_drawable_get_colormap (drawable), &values.foreground); + + gdk_rgb_find_color (gdk_drawable_get_colormap (drawable), + &values.foreground); + values.line_width = line_width; gc = gdk_gc_new_with_values (drawable, &values,