summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@gnome.org>2004-10-19 05:18:50 +0000
committerAnders Carlsson <andersca@src.gnome.org>2004-10-19 05:18:50 +0000
commit1d173183b3624a3c91c06642f0e4200ea86ead6a (patch)
tree6293a52ba4afe86eada0bf66629f299987c170a6
parentb649056fd76ccfd03db4352c579026a404743265 (diff)
downloadmetacity-1d173183b3624a3c91c06642f0e4200ea86ead6a.tar.gz
Don't try to use an ARGB visual at all if the depth isn't 32-bit. This
2004-10-19 Anders Carlsson <andersca@gnome.org> * src/frame.c: (meta_window_ensure_frame): Don't try to use an ARGB visual at all if the depth isn't 32-bit. This caused major slowdowns with Composite enabled.
-rw-r--r--ChangeLog6
-rw-r--r--src/frame.c63
2 files changed, 10 insertions, 59 deletions
diff --git a/ChangeLog b/ChangeLog
index 0eca0b36..619709c0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-10-19 Anders Carlsson <andersca@gnome.org>
+
+ * src/frame.c: (meta_window_ensure_frame):
+ Don't try to use an ARGB visual at all if the depth isn't
+ 32-bit. This caused major slowdowns with Composite enabled.
+
2004-10-16 Elijah Newren <newren@math.utah.edu>
Make the "showing desktop" mode be per-workspace instead of
diff --git a/src/frame.c b/src/frame.c
index b381c858..76e62966 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -38,60 +38,6 @@
EnterWindowMask | LeaveWindowMask | \
FocusChangeMask | \
ColormapChangeMask)
-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 NULL;
-
- 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)
@@ -102,7 +48,7 @@ meta_window_ensure_frame (MetaWindow *window)
if (window->frame)
return;
-
+
/* See comment below for why this is required. */
meta_display_grab (window->display);
@@ -142,14 +88,13 @@ meta_window_ensure_frame (MetaWindow *window)
*/
/* Special case for depth 32 windows (assumed to be ARGB),
- * we use the window's visual
+ * we use the window's visual. Otherwise we just use the system visual.
*/
if (window->depth == 32)
visual = window->xvisual;
else
- visual = find_argb_visual(window->display,
- window->screen->number);
-
+ visual = NULL;
+
frame->xwindow = meta_ui_create_frame_window (window->screen->ui,
window->display->xdisplay,
visual,