From 744efc95a10dea2f6d62a3e3aa3048fd5287b741 Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Fri, 27 Aug 2004 22:09:13 +0000 Subject: [PATCH] disable NameWindowPixmap stuff always for now, it seemed kind of busted 2004-08-27 Havoc Pennington * src/compositor.c (meta_compositor_new): disable NameWindowPixmap stuff always for now, it seemed kind of busted (paint_screen): don't grab the server during repaint, adds to the speed, though only slightly. * src/frames.c (meta_frames_set_window_background): factor out all the set_background stuff to one function; disable setting background to transparent, because it breaks existing themes. We need to add a flag in the theme XML file to say "start me with a transparent background" --- ChangeLog | 13 ++++++++++++ src/compositor.c | 8 ++++--- src/frames.c | 55 ++++++++++++++++++++++++------------------------ 3 files changed, 45 insertions(+), 31 deletions(-) diff --git a/ChangeLog b/ChangeLog index a12c06605..15aae751f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2004-08-27 Havoc Pennington + + * src/compositor.c (meta_compositor_new): disable NameWindowPixmap + stuff always for now, it seemed kind of busted + (paint_screen): don't grab the server during repaint, adds to the + speed, though only slightly. + + * src/frames.c (meta_frames_set_window_background): factor out all + the set_background stuff to one function; disable setting + background to transparent, because it breaks existing themes. We + need to add a flag in the theme XML file to say "start me with a + transparent background" + 2004-08-27 Elijah Newren Prevent an assertion failure that can occur after increasing the diff --git a/src/compositor.c b/src/compositor.c index 338fa613e..b664237dd 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -166,9 +166,11 @@ meta_compositor_new (MetaDisplay *display) #if HAVE_NAME_WINDOW_PIXMAP XCompositeQueryVersion (display->xdisplay, &composite_major, &composite_minor); - + +#if 0 if (composite_major > 0 || composite_minor >= 2) compositor->have_name_window_pixmap = TRUE; +#endif #endif } @@ -324,7 +326,7 @@ paint_screen (MetaCompositor *compositor, meta_topic (META_DEBUG_COMPOSITOR, "Repainting screen %d root 0x%lx\n", screen->number, screen->xroot); - meta_display_grab (screen->display); + /* meta_display_grab (screen->display); */ xdisplay = screen->display->xdisplay; @@ -478,7 +480,7 @@ paint_screen (MetaCompositor *compositor, XRenderFreePicture (xdisplay, buffer_picture); XFreeGC (xdisplay, gc); - meta_display_ungrab (screen->display); + /* meta_display_ungrab (screen->display); */ XSync (screen->display->xdisplay, False); } diff --git a/src/frames.c b/src/frames.c index 409f2a397..56cd5e426 100644 --- a/src/frames.c +++ b/src/frames.c @@ -64,6 +64,9 @@ static void meta_frames_paint_to_drawable (MetaFrames *frames, GdkDrawable *drawable, GdkRegion *region); +static void meta_frames_set_window_background (MetaFrames *frames, + MetaUIFrame *frame); + static void meta_frames_calc_geometry (MetaFrames *frames, MetaUIFrame *frame, MetaFrameGeometry *fgeom); @@ -268,12 +271,9 @@ queue_recalc_func (gpointer key, gpointer value, gpointer data) /* If a resize occurs it will cause a redraw, but the * resize may not actually be needed so we always redraw - * in case of color change. Don't change color if this is - * an ARGB visual + * in case of color change. */ - if (gdk_window_get_visual (frame->window)->depth != 32) - gtk_style_set_background (GTK_WIDGET (frames)->style, - frame->window, GTK_STATE_NORMAL); + meta_frames_set_window_background (frames, frame); gdk_window_invalidate_rect (frame->window, NULL, FALSE); meta_core_queue_frame_resize (gdk_display, @@ -316,13 +316,9 @@ queue_draw_func (gpointer key, gpointer value, gpointer data) /* If a resize occurs it will cause a redraw, but the * resize may not actually be needed so we always redraw - * in case of color change. Only redraw if it is not - * an ARGB visual however since we always want background - * in this case to be transparent. + * in case of color change. */ - if (gdk_window_get_visual (frame->window)->depth != 32) - gtk_style_set_background (GTK_WIDGET (frames)->style, - frame->window, GTK_STATE_NORMAL); + meta_frames_set_window_background (frames, frame); gdk_window_invalidate_rect (frame->window, NULL, FALSE); } @@ -486,19 +482,8 @@ meta_frames_manage_window (MetaFrames *frames, gdk_window_set_user_data (frame->window, frames); - /* Set the window background to the current style if not ARGB and - * transparent otherwise - */ - if (gdk_window_get_visual (frame->window)->depth != 32) - { - gtk_style_set_background (GTK_WIDGET (frames)->style, - frame->window, GTK_STATE_NORMAL); - } - else - { - col.pixel = 0; - gdk_window_set_background (window, &col); - } + /* Set the window background to the current style */ + meta_frames_set_window_background (frames, frame); /* Don't set event mask here, it's in frame.c */ @@ -632,10 +617,8 @@ meta_frames_reset_bg (MetaFrames *frames, widget = GTK_WIDGET (frames); frame = meta_frames_lookup_window (frames, xwindow); - - if (gdk_window_get_visual (frame->window)->depth != 32) - gtk_style_set_background (GTK_WIDGET (frames)->style, - frame->window, GTK_STATE_NORMAL); + + meta_frames_set_window_background (frames, frame); } static void @@ -1915,6 +1898,22 @@ meta_frames_paint_to_drawable (MetaFrames *frames, g_free (areas); } +static void +meta_frames_set_window_background (MetaFrames *frames, + MetaUIFrame *frame) +{ + gtk_style_set_background (GTK_WIDGET (frames)->style, + frame->window, GTK_STATE_NORMAL); + +#if 0 + /* This is what we want for transparent background */ + { + col.pixel = 0; + gdk_window_set_background (window, &col); + } +#endif +} + static gboolean meta_frames_enter_notify_event (GtkWidget *widget, GdkEventCrossing *event)