summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSoeren Sandmann <sandmann@daimi.au.dk>2004-08-09 03:40:37 +0000
committerSøren Sandmann Pedersen <ssp@src.gnome.org>2004-08-09 03:40:37 +0000
commit766d46b70d397ed6966d8b1f7fd5bd63ee7f2bcf (patch)
tree628e12109a438e03cecedd667f5b6aef1739eb5f
parent5f1de4bf7aeffeb1f42e1b14f79c8fcab49cacce (diff)
downloadmetacity-766d46b70d397ed6966d8b1f7fd5bd63ee7f2bcf.tar.gz
New function. Use it here to synchronize with the hardware between each
Mon Aug 9 05:38:33 2004 Soeren Sandmann <sandmann@daimi.au.dk> * src/effects.c (graphics_sync): New function. * src/effects.c (effects_draw_box_animation_timeout): Use it here to synchronize with the hardware between each frame.
-rw-r--r--ChangeLog6
-rw-r--r--src/effects.c20
-rw-r--r--src/effects.h2
3 files changed, 26 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 541e0b01..76d25031 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Mon Aug 9 05:38:33 2004 Soeren Sandmann <sandmann@daimi.au.dk>
+
+ * src/effects.c (graphics_sync): New function.
+ * src/effects.c (effects_draw_box_animation_timeout): Use it here
+ to synchronize with the hardware between each frame.
+
2004-08-08 Rob Adams <readams@readams.net>
* src/window.c (meta_window_move_resize_internal): Add #ifdef
diff --git a/src/effects.c b/src/effects.c
index dee15296..e361c091 100644
--- a/src/effects.c
+++ b/src/effects.c
@@ -125,6 +125,22 @@ update_wireframe_window (MetaDisplay *display,
#endif
}
+static void
+graphics_sync (BoxAnimationContext *context)
+{
+ XImage *image;
+
+ /* A hack to force the X server to synchronize with the
+ * graphics hardware
+ */
+ image = XGetImage (context->screen->display->xdisplay,
+ context->screen->xroot,
+ 0, 0, 1, 1,
+ AllPlanes, ZPixmap);
+
+ XDestroyImage (image);
+}
+
static gboolean
effects_draw_box_animation_timeout (BoxAnimationContext *context)
{
@@ -182,6 +198,8 @@ effects_draw_box_animation_timeout (BoxAnimationContext *context)
XDestroyWindow (context->screen->display->xdisplay,
context->wireframe_xwindow);
}
+
+ graphics_sync (context);
g_free (context);
return FALSE;
@@ -267,7 +285,7 @@ effects_draw_box_animation_timeout (BoxAnimationContext *context)
}
/* kick changes onto the server */
- XFlush (context->screen->display->xdisplay);
+ graphics_sync (context);
return TRUE;
}
diff --git a/src/effects.h b/src/effects.h
index 82dc0c51..38cec4bf 100644
--- a/src/effects.h
+++ b/src/effects.h
@@ -25,7 +25,7 @@
#include "util.h"
#include "screen.h"
-#define META_MINIMIZE_ANIMATION_LENGTH 0.35
+#define META_MINIMIZE_ANIMATION_LENGTH 0.25
#define META_SHADE_ANIMATION_LENGTH 0.2
typedef enum