diff options
author | Havoc Pennington <hp@redhat.com> | 2004-08-27 02:24:48 +0000 |
---|---|---|
committer | Havoc Pennington <hp@src.gnome.org> | 2004-08-27 02:24:48 +0000 |
commit | a8fd516aa0dfbeccf3e82fd91a72642420632b9e (patch) | |
tree | 33d5240815af3a85522e31d40923fc89dbf2931b | |
parent | 1f7f29e059f4e835a33c94a5bc88d43f718429cc (diff) | |
download | metacity-a8fd516aa0dfbeccf3e82fd91a72642420632b9e.tar.gz |
couple of cosmetic tweaks from resolving my local patch with the bugzilla
2004-08-26 Havoc Pennington <hp@redhat.com>
* 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
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | src/frame.c | 57 | ||||
-rw-r--r-- | src/theme.c | 5 |
3 files changed, 65 insertions, 3 deletions
@@ -1,5 +1,11 @@ 2004-08-26 Havoc Pennington <hp@redhat.com> + * 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 <hp@redhat.com> + * configure.in: move the have_xrender variable initialization up in the file since it can be set as part of composite check diff --git a/src/frame.c b/src/frame.c index ca600339..679b348b 100644 --- a/src/frame.c +++ b/src/frame.c @@ -26,8 +26,6 @@ #include "errors.h" #include "keybindings.h" -#include <X11/extensions/Xrender.h> - #ifdef HAVE_RENDER #include <X11/extensions/Xrender.h> #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 7ed48277..4f3d2590 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, |