mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 17:40:40 -05:00
disable automatic GTK double buffering, since it resulted in gigantic
2002-05-04 Havoc Pennington <hp@pobox.com> * src/frames.c (meta_frames_init): disable automatic GTK double buffering, since it resulted in gigantic backing pixmaps the size of the whole screen. (meta_frames_paint_to_drawable): change to take a region argument; punch the client area out of the expose region, then iterate over rectangles in the region and draw each, manually doing begin_paint_rect. Results in 4 long thin backing pixmaps per frame repaint, instead of one large backing pixmap. Suggested by Owen.
This commit is contained in:
parent
cf4ef8cab2
commit
7fbbd0200f
12
ChangeLog
12
ChangeLog
@ -1,3 +1,15 @@
|
|||||||
|
2002-05-04 Havoc Pennington <hp@pobox.com>
|
||||||
|
|
||||||
|
* src/frames.c (meta_frames_init): disable automatic GTK double
|
||||||
|
buffering, since it resulted in gigantic backing pixmaps the size
|
||||||
|
of the whole screen.
|
||||||
|
(meta_frames_paint_to_drawable): change to take a region argument;
|
||||||
|
punch the client area out of the expose region, then iterate over
|
||||||
|
rectangles in the region and draw each, manually doing
|
||||||
|
begin_paint_rect. Results in 4 long thin backing pixmaps
|
||||||
|
per frame repaint, instead of one large backing pixmap.
|
||||||
|
Suggested by Owen.
|
||||||
|
|
||||||
2002-05-05 Bastien Nocera <hadess@hadess.net>
|
2002-05-05 Bastien Nocera <hadess@hadess.net>
|
||||||
|
|
||||||
* src/workspace.c: (meta_workspace_get_neighbor):
|
* src/workspace.c: (meta_workspace_get_neighbor):
|
||||||
|
70
src/frames.c
70
src/frames.c
@ -56,7 +56,7 @@ static gboolean meta_frames_leave_notify_event (GtkWidget *widget,
|
|||||||
static void meta_frames_paint_to_drawable (MetaFrames *frames,
|
static void meta_frames_paint_to_drawable (MetaFrames *frames,
|
||||||
MetaUIFrame *frame,
|
MetaUIFrame *frame,
|
||||||
GdkDrawable *drawable,
|
GdkDrawable *drawable,
|
||||||
GdkRectangle *area);
|
GdkRegion *region);
|
||||||
|
|
||||||
static void meta_frames_calc_geometry (MetaFrames *frames,
|
static void meta_frames_calc_geometry (MetaFrames *frames,
|
||||||
MetaUIFrame *frame,
|
MetaUIFrame *frame,
|
||||||
@ -166,6 +166,8 @@ meta_frames_init (MetaFrames *frames)
|
|||||||
frames->tooltip_timeout = 0;
|
frames->tooltip_timeout = 0;
|
||||||
|
|
||||||
frames->expose_delay_count = 0;
|
frames->expose_delay_count = 0;
|
||||||
|
|
||||||
|
gtk_widget_set_double_buffered (GTK_WIDGET (frames), FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -1275,7 +1277,7 @@ meta_frames_expose_event (GtkWidget *widget,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
meta_frames_paint_to_drawable (frames, frame, frame->window, &event->area);
|
meta_frames_paint_to_drawable (frames, frame, frame->window, event->region);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -1284,7 +1286,7 @@ static void
|
|||||||
meta_frames_paint_to_drawable (MetaFrames *frames,
|
meta_frames_paint_to_drawable (MetaFrames *frames,
|
||||||
MetaUIFrame *frame,
|
MetaUIFrame *frame,
|
||||||
GdkDrawable *drawable,
|
GdkDrawable *drawable,
|
||||||
GdkRectangle *area)
|
GdkRegion *region)
|
||||||
{
|
{
|
||||||
GtkWidget *widget;
|
GtkWidget *widget;
|
||||||
MetaFrameFlags flags;
|
MetaFrameFlags flags;
|
||||||
@ -1295,6 +1297,12 @@ meta_frames_paint_to_drawable (MetaFrames *frames,
|
|||||||
MetaButtonState button_states[META_BUTTON_TYPE_LAST];
|
MetaButtonState button_states[META_BUTTON_TYPE_LAST];
|
||||||
Window grab_frame;
|
Window grab_frame;
|
||||||
int i;
|
int i;
|
||||||
|
int top, bottom, left, right;
|
||||||
|
GdkRegion *edges;
|
||||||
|
GdkRegion *client;
|
||||||
|
GdkRectangle area;
|
||||||
|
GdkRectangle *areas;
|
||||||
|
int n_areas;
|
||||||
|
|
||||||
widget = GTK_WIDGET (frames);
|
widget = GTK_WIDGET (frames);
|
||||||
|
|
||||||
@ -1365,18 +1373,50 @@ meta_frames_paint_to_drawable (MetaFrames *frames,
|
|||||||
|
|
||||||
meta_frames_ensure_layout (frames, frame);
|
meta_frames_ensure_layout (frames, frame);
|
||||||
|
|
||||||
meta_theme_draw_frame (meta_theme_get_current (),
|
meta_theme_get_frame_borders (meta_theme_get_current (),
|
||||||
widget,
|
type, frame->text_height, flags,
|
||||||
drawable,
|
&top, &bottom, &left, &right);
|
||||||
area,
|
|
||||||
0, 0,
|
/* Repaint each side of the frame */
|
||||||
type,
|
|
||||||
flags,
|
edges = gdk_region_copy (region);
|
||||||
w, h,
|
area.x = left;
|
||||||
frame->layout,
|
area.y = top;
|
||||||
frame->text_height,
|
area.width = w;
|
||||||
button_states,
|
area.height = h;
|
||||||
mini_icon, icon);
|
client = gdk_region_rectangle (&area);
|
||||||
|
gdk_region_subtract (edges, client);
|
||||||
|
gdk_region_destroy (client);
|
||||||
|
|
||||||
|
gdk_region_get_rectangles (edges, &areas, &n_areas);
|
||||||
|
|
||||||
|
i = 0;
|
||||||
|
while (i < n_areas)
|
||||||
|
{
|
||||||
|
if (GDK_IS_WINDOW (drawable))
|
||||||
|
gdk_window_begin_paint_rect (drawable, &areas[i]);
|
||||||
|
|
||||||
|
meta_theme_draw_frame (meta_theme_get_current (),
|
||||||
|
widget,
|
||||||
|
drawable,
|
||||||
|
&areas[i],
|
||||||
|
0, 0,
|
||||||
|
type,
|
||||||
|
flags,
|
||||||
|
w, h,
|
||||||
|
frame->layout,
|
||||||
|
frame->text_height,
|
||||||
|
button_states,
|
||||||
|
mini_icon, icon);
|
||||||
|
|
||||||
|
if (GDK_IS_WINDOW (drawable))
|
||||||
|
gdk_window_end_paint (drawable);
|
||||||
|
|
||||||
|
++i;
|
||||||
|
}
|
||||||
|
|
||||||
|
gdk_region_destroy (edges);
|
||||||
|
g_free (areas);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
Loading…
Reference in New Issue
Block a user