summaryrefslogtreecommitdiff
path: root/src/frames.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@pobox.com>2001-08-19 01:19:54 +0000
committerHavoc Pennington <hp@src.gnome.org>2001-08-19 01:19:54 +0000
commit246ac5e578323795b539bd51e38673a0ba6642b6 (patch)
tree0cab26d0dd86d6f76be45ba1065527e45d0bf779 /src/frames.c
parent505282697a9b073c8fa0f0108c905df65489789c (diff)
downloadmetacity-246ac5e578323795b539bd51e38673a0ba6642b6.tar.gz
use the delay exposes feature to avoid the scren dirt
2001-08-18 Havoc Pennington <hp@pobox.com> * src/effects.c (effects_draw_box_animation_timeout): use the delay exposes feature to avoid the scren dirt * src/ui.c (meta_image_window_set_position): use gtk_window_move() to set the position (meta_ui_push_delay_exposes): (meta_ui_pop_delay_exposes): feature to let us delay redraws until after we do server-grabbed draw-on-inferiors effects
Diffstat (limited to 'src/frames.c')
-rw-r--r--src/frames.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/frames.c b/src/frames.c
index e09d41c2..f3274adb 100644
--- a/src/frames.c
+++ b/src/frames.c
@@ -278,6 +278,8 @@ meta_frames_init (MetaFrames *frames)
frames->frames = g_hash_table_new (unsigned_long_hash, unsigned_long_equal);
frames->tooltip_timeout = 0;
+
+ frames->expose_delay_count = 0;
}
static void
@@ -698,6 +700,7 @@ meta_frames_manage_window (MetaFrames *frames,
frame->xwindow = xwindow;
frame->layout = NULL;
+ frame->expose_delayed = FALSE;
meta_core_grab_buttons (gdk_display, frame->xwindow);
@@ -1601,6 +1604,13 @@ meta_frames_expose_event (GtkWidget *widget,
if (frame == NULL)
return FALSE;
+ if (frames->expose_delay_count > 0)
+ {
+ /* Redraw this entire frame later */
+ frame->expose_delayed = TRUE;
+ return TRUE;
+ }
+
meta_frames_calc_geometry (frames, frame, &fgeom);
flags = meta_core_get_frame_flags (gdk_display, frame->xwindow);
meta_core_get_frame_size (gdk_display, frame->xwindow, &width, &height);
@@ -2096,3 +2106,40 @@ get_control (MetaFrames *frames,
return META_FRAME_CONTROL_NONE;
}
+
+void
+meta_frames_push_delay_exposes (MetaFrames *frames)
+{
+ frames->expose_delay_count += 1;
+}
+
+static void
+queue_pending_exposes_func (gpointer key, gpointer value, gpointer data)
+{
+ MetaUIFrame *frame;
+ MetaFrames *frames;
+
+ frames = META_FRAMES (data);
+ frame = value;
+
+ if (frame->expose_delayed)
+ {
+ gdk_window_invalidate_rect (frame->window, NULL, FALSE);
+ frame->expose_delayed = FALSE;
+ }
+}
+
+void
+meta_frames_pop_delay_exposes (MetaFrames *frames)
+{
+ g_return_if_fail (frames->expose_delay_count > 0);
+
+ frames->expose_delay_count -= 1;
+
+ if (frames->expose_delay_count == 0)
+ {
+ g_hash_table_foreach (frames->frames,
+ queue_pending_exposes_func,
+ frames);
+ }
+}