summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog11
-rw-r--r--src/effects.c2
-rw-r--r--src/frames.c47
-rw-r--r--src/frames.h6
-rw-r--r--src/ui.c14
-rw-r--r--src/ui.h9
6 files changed, 88 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index ee87554..cd81923 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+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
+
2001-08-17 Havoc Pennington <hp@redhat.com>
* src/window.c (meta_window_get_gravity_position): fix for
diff --git a/src/effects.c b/src/effects.c
index 91cc59e..f9eb254 100644
--- a/src/effects.c
+++ b/src/effects.c
@@ -100,6 +100,7 @@ effects_draw_box_animation_timeout (BoxAnimationContext *context)
else
{
meta_display_ungrab (context->screen->display);
+ meta_ui_pop_delay_exposes (context->screen->ui);
XFreeGC (context->screen->display->xdisplay,
context->gc);
}
@@ -235,6 +236,7 @@ meta_effects_draw_box_animation (MetaScreen *screen,
/* Grab the X server to avoid screen dirt */
meta_display_grab (context->screen->display);
+ meta_ui_push_delay_exposes (context->screen->ui);
}
/* Do this only after we get the pixbuf from the server,
diff --git a/src/frames.c b/src/frames.c
index e09d41c..f3274ad 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);
+ }
+}
diff --git a/src/frames.h b/src/frames.h
index 4531d2a..a3a77f8 100644
--- a/src/frames.h
+++ b/src/frames.h
@@ -66,6 +66,7 @@ struct _MetaUIFrame
Window xwindow;
GdkWindow *window;
PangoLayout *layout;
+ guint expose_delayed : 1;
};
struct _MetaFrames
@@ -81,6 +82,8 @@ struct _MetaFrames
guint tooltip_timeout;
MetaUIFrame *last_motion_frame;
+
+ int expose_delay_count;
};
struct _MetaFramesClass
@@ -121,4 +124,7 @@ void meta_frames_notify_menu_hide (MetaFrames *frames);
Window meta_frames_get_moving_frame (MetaFrames *frames);
+void meta_frames_push_delay_exposes (MetaFrames *frames);
+void meta_frames_pop_delay_exposes (MetaFrames *frames);
+
#endif
diff --git a/src/ui.c b/src/ui.c
index 2e31151..a32313d 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -285,7 +285,7 @@ meta_image_window_set_position (MetaImageWindow *iw,
int x,
int y)
{
- gtk_widget_set_uposition (iw->window, x, y);
+ gtk_window_move (iw->window, x, y);
}
GdkPixbuf*
@@ -323,3 +323,15 @@ meta_gdk_pixbuf_get_from_window (GdkPixbuf *dest,
return retval;
}
+void
+meta_ui_push_delay_exposes (MetaUI *ui)
+{
+ meta_frames_push_delay_exposes (ui->frames);
+}
+
+void
+meta_ui_pop_delay_exposes (MetaUI *ui)
+{
+ meta_frames_pop_delay_exposes (ui->frames);
+}
+
diff --git a/src/ui.h b/src/ui.h
index 6c03ae6..de9e549 100644
--- a/src/ui.h
+++ b/src/ui.h
@@ -109,4 +109,13 @@ GdkPixbuf* meta_gdk_pixbuf_get_from_window (GdkPixbuf *dest,
int dest_y,
int width,
int height);
+
+/* Used when we have a server grab and draw all over everything,
+ * then we need to handle exposes after doing that, instead of
+ * during it
+ */
+void meta_ui_push_delay_exposes (MetaUI *ui);
+void meta_ui_pop_delay_exposes (MetaUI *ui);
+
#endif
+