disable NameWindowPixmap stuff always for now, it seemed kind of busted

2004-08-27  Havoc Pennington  <hp@redhat.com>

	* 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"
This commit is contained in:
Havoc Pennington 2004-08-27 22:09:13 +00:00 committed by Havoc Pennington
parent 522e9916b6
commit 744efc95a1
3 changed files with 45 additions and 31 deletions

View File

@ -1,3 +1,16 @@
2004-08-27 Havoc Pennington <hp@redhat.com>
* 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 <newren@math.utah.edu> 2004-08-27 Elijah Newren <newren@math.utah.edu>
Prevent an assertion failure that can occur after increasing the Prevent an assertion failure that can occur after increasing the

View File

@ -166,9 +166,11 @@ meta_compositor_new (MetaDisplay *display)
#if HAVE_NAME_WINDOW_PIXMAP #if HAVE_NAME_WINDOW_PIXMAP
XCompositeQueryVersion (display->xdisplay, XCompositeQueryVersion (display->xdisplay,
&composite_major, &composite_minor); &composite_major, &composite_minor);
#if 0
if (composite_major > 0 || composite_minor >= 2) if (composite_major > 0 || composite_minor >= 2)
compositor->have_name_window_pixmap = TRUE; compositor->have_name_window_pixmap = TRUE;
#endif
#endif #endif
} }
@ -324,7 +326,7 @@ paint_screen (MetaCompositor *compositor,
meta_topic (META_DEBUG_COMPOSITOR, "Repainting screen %d root 0x%lx\n", meta_topic (META_DEBUG_COMPOSITOR, "Repainting screen %d root 0x%lx\n",
screen->number, screen->xroot); screen->number, screen->xroot);
meta_display_grab (screen->display); /* meta_display_grab (screen->display); */
xdisplay = screen->display->xdisplay; xdisplay = screen->display->xdisplay;
@ -478,7 +480,7 @@ paint_screen (MetaCompositor *compositor,
XRenderFreePicture (xdisplay, buffer_picture); XRenderFreePicture (xdisplay, buffer_picture);
XFreeGC (xdisplay, gc); XFreeGC (xdisplay, gc);
meta_display_ungrab (screen->display); /* meta_display_ungrab (screen->display); */
XSync (screen->display->xdisplay, False); XSync (screen->display->xdisplay, False);
} }

View File

@ -64,6 +64,9 @@ static void meta_frames_paint_to_drawable (MetaFrames *frames,
GdkDrawable *drawable, GdkDrawable *drawable,
GdkRegion *region); GdkRegion *region);
static void meta_frames_set_window_background (MetaFrames *frames,
MetaUIFrame *frame);
static void meta_frames_calc_geometry (MetaFrames *frames, static void meta_frames_calc_geometry (MetaFrames *frames,
MetaUIFrame *frame, MetaUIFrame *frame,
MetaFrameGeometry *fgeom); 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 /* If a resize occurs it will cause a redraw, but the
* resize may not actually be needed so we always redraw * resize may not actually be needed so we always redraw
* in case of color change. Don't change color if this is * in case of color change.
* an ARGB visual
*/ */
if (gdk_window_get_visual (frame->window)->depth != 32) meta_frames_set_window_background (frames, frame);
gtk_style_set_background (GTK_WIDGET (frames)->style,
frame->window, GTK_STATE_NORMAL);
gdk_window_invalidate_rect (frame->window, NULL, FALSE); gdk_window_invalidate_rect (frame->window, NULL, FALSE);
meta_core_queue_frame_resize (gdk_display, 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 /* If a resize occurs it will cause a redraw, but the
* resize may not actually be needed so we always redraw * resize may not actually be needed so we always redraw
* in case of color change. Only redraw if it is not * in case of color change.
* an ARGB visual however since we always want background
* in this case to be transparent.
*/ */
if (gdk_window_get_visual (frame->window)->depth != 32) meta_frames_set_window_background (frames, frame);
gtk_style_set_background (GTK_WIDGET (frames)->style,
frame->window, GTK_STATE_NORMAL);
gdk_window_invalidate_rect (frame->window, NULL, FALSE); 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); gdk_window_set_user_data (frame->window, frames);
/* Set the window background to the current style if not ARGB and /* Set the window background to the current style */
* transparent otherwise meta_frames_set_window_background (frames, frame);
*/
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);
}
/* Don't set event mask here, it's in frame.c */ /* 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); widget = GTK_WIDGET (frames);
frame = meta_frames_lookup_window (frames, xwindow); frame = meta_frames_lookup_window (frames, xwindow);
if (gdk_window_get_visual (frame->window)->depth != 32) meta_frames_set_window_background (frames, frame);
gtk_style_set_background (GTK_WIDGET (frames)->style,
frame->window, GTK_STATE_NORMAL);
} }
static void static void
@ -1915,6 +1898,22 @@ meta_frames_paint_to_drawable (MetaFrames *frames,
g_free (areas); 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 static gboolean
meta_frames_enter_notify_event (GtkWidget *widget, meta_frames_enter_notify_event (GtkWidget *widget,
GdkEventCrossing *event) GdkEventCrossing *event)