diff options
author | Søren Sandmann <sandmann@redhat.com> | 2005-01-24 22:13:22 +0000 |
---|---|---|
committer | Søren Sandmann Pedersen <ssp@src.gnome.org> | 2005-01-24 22:13:22 +0000 |
commit | fb95c58f08ae25e5cacc0a0e3340b6d6b19cede0 (patch) | |
tree | fc599f2ff6753f676b8026162338c14cdda4d2a8 | |
parent | 33bf5ac8ee0db449d512f2f7d14a22f592cb71bc (diff) | |
download | metacity-fb95c58f08ae25e5cacc0a0e3340b6d6b19cede0.tar.gz |
Don't use a timeout to do the repair. Add
Mon Jan 24 17:07:26 2005 Søren Sandmann <sandmann@redhat.com>
* src/compositor.c (remove_repair_idle): Don't use a timeout to do
the repair. Add meta_compositor_start/stop_compositing()
* src/cwindow.[ch]: Add cwindow_freeze()/thaw() to stop and start
compositing. Update various places to use stored geometry.
* src/window.c: Use start/stop composting to make resizing smooth.
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | src/compositor.c | 72 | ||||
-rw-r--r-- | src/cwindow.c | 274 | ||||
-rw-r--r-- | src/cwindow.h | 2 | ||||
-rw-r--r-- | src/frame.c | 2 | ||||
-rw-r--r-- | src/util.c | 18 | ||||
-rw-r--r-- | src/util.h | 1 | ||||
-rw-r--r-- | src/window-props.c | 1 | ||||
-rw-r--r-- | src/window.c | 105 |
9 files changed, 292 insertions, 193 deletions
@@ -1,3 +1,13 @@ +Mon Jan 24 17:07:26 2005 Søren Sandmann <sandmann@redhat.com> + + * src/compositor.c (remove_repair_idle): Don't use a timeout to do + the repair. Add meta_compositor_start/stop_compositing() + + * src/cwindow.[ch]: Add cwindow_freeze()/thaw() to stop and start + compositing. Update various places to use stored geometry. + + * src/window.c: Use start/stop composting to make resizing smooth. + Fri Jan 21 14:36:32 2005 Søren Sandmann <sandmann@redhat.com> * src/window.c (update_resize): s/new_h/new_y/ diff --git a/src/compositor.c b/src/compositor.c index df904a12..498f0865 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -54,7 +54,6 @@ struct MetaCompositor GHashTable *window_hash; guint repair_idle; - guint repair_timeout; guint enabled : 1; guint have_composite : 1; @@ -79,15 +78,15 @@ free_window_hash_value (void *v) static void print_region (Display *dpy, const char *name, XserverRegion region) { - XRectangle *rects; - int i, n_rects; - - rects = XFixesFetchRegion (dpy, region, &n_rects); - - g_print ("region \"%s\":\n", name); - for (i = 0; i < n_rects; ++i) - g_print (" %d %d %d %d\n", rects[i].x, rects[i].y, rects[i].width, rects[i].height); - XFree (rects); + XRectangle *rects; + int i, n_rects; + + rects = XFixesFetchRegion (dpy, region, &n_rects); + + g_print ("region \"%s\":\n", name); + for (i = 0; i < n_rects; ++i) + g_print (" %d %d %d %d\n", rects[i].x, rects[i].y, rects[i].width, rects[i].height); + XFree (rects); } MetaCompositor* @@ -193,20 +192,13 @@ meta_compositor_set_debug_updates (MetaCompositor *compositor, static void remove_repair_idle (MetaCompositor *compositor) { - if (compositor->repair_idle || compositor->repair_timeout) - meta_topic (META_DEBUG_COMPOSITOR, "Damage idle removed\n"); - - if (compositor->repair_idle != 0) + if (compositor->repair_idle) { + meta_topic (META_DEBUG_COMPOSITOR, "Damage idle removed\n"); + g_source_remove (compositor->repair_idle); compositor->repair_idle = 0; } - - if (compositor->repair_timeout != 0) - { - g_source_remove (compositor->repair_timeout); - compositor->repair_timeout = 0; - } } #endif /* HAVE_COMPOSITE_EXTENSIONS */ @@ -456,7 +448,7 @@ do_repair (MetaCompositor *compositor) #ifdef HAVE_COMPOSITE_EXTENSIONS static gboolean -repair_idle_func (void *data) +repair_now (void *data) { MetaCompositor *compositor = data; @@ -469,19 +461,6 @@ repair_idle_func (void *data) #ifdef HAVE_COMPOSITE_EXTENSIONS -static gboolean -repair_timeout_func (void *data) -{ - MetaCompositor *compositor = data; - - compositor->repair_timeout = 0; - do_repair (compositor); - - return FALSE; -} -#endif /* HAVE_COMPOSITE_EXTENSIONS */ - -#ifdef HAVE_COMPOSITE_EXTENSIONS static void ensure_repair_idle (MetaCompositor *compositor) { @@ -489,9 +468,7 @@ ensure_repair_idle (MetaCompositor *compositor) return; compositor->repair_idle = g_idle_add_full (META_PRIORITY_COMPOSITE, - repair_idle_func, compositor, NULL); - compositor->repair_timeout = g_timeout_add (FRAME_INTERVAL_MILLISECONDS, - repair_timeout_func, compositor); + repair_now, compositor, NULL); meta_topic (META_DEBUG_COMPOSITOR, "Damage idle queued\n"); } @@ -519,7 +496,12 @@ meta_compositor_invalidate_region (MetaCompositor *compositor, XSync (screen->display->xdisplay, False); } #endif - + +#if 0 + print_region (compositor->display->xdisplay, "invalidate", invalid_area); + meta_print_top_of_stack (4); +#endif + XFixesUnionRegion (compositor->display->xdisplay, screen->damage_region, invalid_area, screen->damage_region); @@ -1169,12 +1151,24 @@ void meta_compositor_stop_compositing (MetaCompositor *compositor, MetaWindow *window) { + CWindow *cwindow; + cwindow = window_to_cwindow (compositor, window); + + if (cwindow) + cwindow_freeze (cwindow); } void meta_compositor_start_compositing (MetaCompositor *compositor, MetaWindow *window) { + CWindow *cwindow; + cwindow = window_to_cwindow (compositor, window); + + if (cwindow) + cwindow_thaw (cwindow); + + repair_now (compositor); } static void @@ -1314,7 +1308,7 @@ meta_compositor_genie (MetaCompositor *compositor, XFixesSetPictureClipRegion (compositor->display->xdisplay, window->screen->root_picture, 0, 0, None); /* Copy buffer to root window */ - paint_buffer (window->screen, buffer, NULL); + paint_buffer (window->screen, buffer, None); XRenderFreePicture (compositor->display->xdisplay, buffer); diff --git a/src/cwindow.c b/src/cwindow.c index 5baecfd4..9d7470c5 100644 --- a/src/cwindow.c +++ b/src/cwindow.c @@ -3,8 +3,28 @@ #include "errors.h" #include "compositor.h" #include "matrix.h" +#include <X11/extensions/Xcomposite.h> #define SHADOW_OFFSET 3 + +typedef struct Geometry Geometry; +typedef struct FreezeInfo FreezeInfo; + +struct Geometry +{ + int x; + int y; + int width; + int height; + int border_width; +}; + +struct FreezeInfo +{ + Geometry geometry; + Pixmap pixmap; +}; + /* Unlike MetaWindow, there's one of these for _all_ toplevel windows, * override redirect or not. We also track unmapped windows as * otherwise on window map we'd have to determine where the @@ -18,25 +38,15 @@ struct CWindow #ifdef HAVE_COMPOSITE_EXTENSIONS MetaCompositor *compositor; - - int x; - int y; - int width; - int height; - int border_width; - - int pending_x; - int pending_y; - int pending_width; - int pending_height; - int pending_border_width; + + Geometry geometry; Damage damage; XserverRegion last_painted_extents; XserverRegion border_size; - - Pixmap pixmap; + + FreezeInfo *freeze_info; unsigned int managed : 1; unsigned int damaged : 1; @@ -67,10 +77,11 @@ cwindow_free (CWindow *cwindow) XDamageDestroy (cwindow_get_xdisplay (cwindow), cwindow->damage); /* Free our window pixmap name */ - if (cwindow->pixmap != None) - XFreePixmap (cwindow_get_xdisplay (cwindow), - cwindow->pixmap); - meta_error_trap_pop (meta_compositor_get_display (cwindow->compositor), FALSE); + if (cwindow->freeze_info) + cwindow_thaw (cwindow); + + meta_error_trap_pop (meta_compositor_get_display (cwindow->compositor), + FALSE); g_free (cwindow); } @@ -80,12 +91,18 @@ cwindow_free (CWindow *cwindow) XserverRegion cwindow_extents (CWindow *cwindow) { + Geometry *geometry; XRectangle r; + + if (cwindow->freeze_info) + geometry = &cwindow->freeze_info->geometry; + else + geometry = &cwindow->geometry; - r.x = cwindow->x; - r.y = cwindow->y; - r.width = cwindow->width; - r.height = cwindow->height; + r.x = geometry->x; + r.y = geometry->y; + r.width = geometry->width; + r.height = geometry->height; r.width += SHADOW_OFFSET; r.height += SHADOW_OFFSET; @@ -98,10 +115,17 @@ XserverRegion cwindow_get_opaque_region (CWindow *cwindow) { XRectangle rect; - rect.x = cwindow->x; - rect.y = cwindow->y; - rect.width = cwindow->width; - rect.height = cwindow->height; + Geometry *geometry; + + if (cwindow->freeze_info) + geometry = &cwindow->freeze_info->geometry; + else + geometry = &cwindow->geometry; + + rect.x = geometry->x; + rect.y = geometry->y; + rect.width = geometry->width; + rect.height = geometry->height; return XFixesCreateRegion (cwindow_get_xdisplay (cwindow), &rect, 1); } @@ -109,10 +133,14 @@ cwindow_get_opaque_region (CWindow *cwindow) Drawable cwindow_get_drawable (CWindow *cwindow) { - if (cwindow->pixmap) - return cwindow->pixmap; + if (cwindow->freeze_info) + { + return cwindow->freeze_info->pixmap; + } else - return cwindow->xwindow; + { + return cwindow->xwindow; + } } void @@ -158,7 +186,9 @@ cwindow_get_screen (CWindow *cwindow) } CWindow * -cwindow_new (MetaCompositor *compositor, Window xwindow, XWindowAttributes *attrs) +cwindow_new (MetaCompositor *compositor, + Window xwindow, + XWindowAttributes *attrs) { CWindow *cwindow; Damage damage; @@ -178,11 +208,14 @@ cwindow_new (MetaCompositor *compositor, Window xwindow, XWindowAttributes *attr cwindow->xwindow = xwindow; cwindow->screen_index = XScreenNumberOfScreen (attrs->screen); cwindow->damage = damage; - cwindow->x = attrs->x; - cwindow->y = attrs->y; - cwindow->width = attrs->width; - cwindow->height = attrs->height; - cwindow->border_width = attrs->border_width; + + cwindow->freeze_info = NULL; + + cwindow->geometry.x = attrs->x; + cwindow->geometry.y = attrs->y; + cwindow->geometry.width = attrs->width; + cwindow->geometry.height = attrs->height; + cwindow->geometry.border_width = attrs->border_width; if (attrs->class == InputOnly) cwindow->input_only = TRUE; @@ -191,16 +224,6 @@ cwindow_new (MetaCompositor *compositor, Window xwindow, XWindowAttributes *attr cwindow->visual = attrs->visual; -#if 0 - if (compositor->have_name_window_pixmap) - { - meta_error_trap_push (meta_compositor_get_display (compositor)); - cwindow->pixmap = XCompositeNameWindowPixmap (meta_compositor_get_display (compositor)->xdisplay, - cwindow->xwindow); - meta_error_trap_pop (meta_compositor_get_display (compositor), FALSE); - } -#endif - /* viewable == mapped for the root window, since root can't be unmapped */ cwindow->viewable = (attrs->map_state == IsViewable); @@ -254,31 +277,31 @@ cwindow_get_last_painted_extents (CWindow *cwindow) int cwindow_get_x (CWindow *cwindow) { - return cwindow->x; + return cwindow->geometry.x; } int cwindow_get_y (CWindow *cwindow) { - return cwindow->y; + return cwindow->geometry.y; } int cwindow_get_width (CWindow *cwindow) { - return cwindow->width; + return cwindow->geometry.width; } int cwindow_get_height (CWindow *cwindow) { - return cwindow->height; + return cwindow->geometry.height; } int cwindow_get_border_width (CWindow *cwindow) { - return cwindow->border_width; + return cwindow->geometry.border_width; } Damage @@ -287,12 +310,6 @@ cwindow_get_damage (CWindow *cwindow) return cwindow->damage; } -Pixmap -cwindow_get_pixmap (CWindow *cwindow) -{ - return cwindow->pixmap; -} - MetaCompositor * cwindow_get_compositor (CWindow *cwindow) { @@ -300,57 +317,27 @@ cwindow_get_compositor (CWindow *cwindow) } void -cwindow_set_pending_x (CWindow *cwindow, int pending_x) -{ - cwindow->pending_x = pending_x; -} - -void -cwindow_set_pending_y (CWindow *cwindow, int pending_y) -{ - cwindow->pending_y = pending_y; -} - -void -cwindow_set_pending_width (CWindow *cwindow, int pending_width) -{ - cwindow->pending_width = pending_width; -} - -void -cwindow_set_pending_height (CWindow *cwindow, int pending_height) -{ - cwindow->pending_height = pending_height; -} - -void -cwindow_set_pending_border_width (CWindow *cwindow, int pending_border_width) -{ - cwindow->pending_border_width = pending_border_width; -} - -void cwindow_set_x (CWindow *cwindow, int x) { - cwindow->x = x; + cwindow->geometry.x = x; } void cwindow_set_y (CWindow *cwindow, int y) { - cwindow->y = y; + cwindow->geometry.y = y; } void cwindow_set_width (CWindow *cwindow, int width) { - cwindow->width = width; + cwindow->geometry.width = width; } void cwindow_set_height (CWindow *cwindow, int height) { - cwindow->height = height; + cwindow->geometry.height = height; } @@ -364,7 +351,7 @@ cwindow_set_viewable (CWindow *cwindow, gboolean viewable) void cwindow_set_border_width (CWindow *cwindow, int border_width) { - cwindow->border_width = border_width; + cwindow->geometry.border_width = border_width; } static XFixed @@ -735,7 +722,7 @@ cwindow_process_damage_notify (CWindow *cwindow, XDamageNotifyEvent *event) XserverRegion region; MetaScreen *screen; MetaWindow *window; - + window = meta_display_lookup_x_window (meta_compositor_get_display (cwindow->compositor), cwindow_get_xwindow (cwindow)); #if 0 @@ -762,7 +749,11 @@ cwindow_process_damage_notify (CWindow *cwindow, XDamageNotifyEvent *event) screen = cwindow_get_screen (cwindow); - meta_compositor_invalidate_region (cwindow->compositor, screen, region); + if (!cwindow->freeze_info) + { + /* ignore damage on frozen window */ + meta_compositor_invalidate_region (cwindow->compositor, screen, region); + } XFixesDestroyRegion (cwindow_get_xdisplay (cwindow), region); } @@ -775,31 +766,23 @@ cwindow_process_configure_notify (CWindow *cwindow, XConfigureEvent *event) screen = cwindow_get_screen (cwindow); - if (cwindow_get_last_painted_extents (cwindow)) + if (cwindow_get_last_painted_extents (cwindow) && !cwindow->freeze_info) { meta_compositor_invalidate_region (cwindow->compositor, screen, cwindow_get_last_painted_extents (cwindow)); cwindow_set_last_painted_extents (cwindow, None); } - if (cwindow_get_pixmap (cwindow)) - { - cwindow_set_pending_x (cwindow, event->x); - cwindow_set_pending_y (cwindow, event->y); - cwindow_set_pending_width (cwindow, event->width); - cwindow_set_pending_height (cwindow, event->height); - cwindow_set_pending_border_width (cwindow, event->border_width); - } - else - { - cwindow_set_x (cwindow, event->x); - cwindow_set_y (cwindow, event->y); - cwindow_set_width (cwindow, event->width); - cwindow_set_height (cwindow, event->height); - cwindow_set_border_width (cwindow, event->border_width); - } + cwindow_set_x (cwindow, event->x); + cwindow_set_y (cwindow, event->y); + cwindow_set_width (cwindow, event->width); + cwindow_set_height (cwindow, event->height); + cwindow_set_border_width (cwindow, event->border_width); - region = cwindow_extents (cwindow); + if (cwindow->freeze_info) + return; + region = cwindow_extents (cwindow); + meta_compositor_invalidate_region (cwindow->compositor, screen, region); @@ -827,6 +810,59 @@ cwindow_set_transformation (CWindow *cwindow, } void +cwindow_freeze (CWindow *cwindow) +{ + if (cwindow->freeze_info) + { + meta_print_backtrace(); + return; + } + + meta_error_trap_push (meta_compositor_get_display (cwindow->compositor)); + + cwindow->freeze_info = g_new (FreezeInfo, 1); + cwindow->freeze_info->geometry = cwindow->geometry; + + cwindow->freeze_info->pixmap = + XCompositeNameWindowPixmap (cwindow_get_xdisplay (cwindow), + cwindow->xwindow); + + meta_error_trap_pop (meta_compositor_get_display (cwindow->compositor), FALSE); +} + +void +cwindow_thaw (CWindow *cwindow) +{ + XserverRegion region; + if (!cwindow->freeze_info) + return; + + if (cwindow_get_last_painted_extents (cwindow)) + { + meta_compositor_invalidate_region (cwindow->compositor, cwindow_get_screen (cwindow), + cwindow_get_last_painted_extents (cwindow)); + cwindow_set_last_painted_extents (cwindow, None); + } + + + if (cwindow->freeze_info->pixmap) + XFreePixmap (cwindow_get_xdisplay (cwindow), + cwindow->freeze_info->pixmap); + + g_free (cwindow->freeze_info); + cwindow->freeze_info = NULL; + + region = cwindow_extents (cwindow); + + meta_compositor_invalidate_region (cwindow->compositor, + cwindow_get_screen (cwindow), + region); + + XFixesDestroyRegion (cwindow_get_xdisplay (cwindow), region); + +} + +void cwindow_draw (CWindow *cwindow, Picture destination) { XRenderPictFormat *format; @@ -880,6 +916,10 @@ cwindow_draw (CWindow *cwindow, Picture destination) else { Display *dpy = cwindow_get_xdisplay (cwindow); + Geometry *geometry = cwindow->freeze_info? + &cwindow->freeze_info->geometry : + &cwindow->geometry; + XRenderColor shadow_color = { 0x0000, 0x000, 0x0000, 0x70c0 }; XserverRegion shadow_clip; XserverRegion old_clip = XFixesCreateRegionFromPicture (dpy, destination); @@ -895,8 +935,8 @@ cwindow_draw (CWindow *cwindow, Picture destination) PictOpOver, destination, &shadow_color, - cwindow->x + SHADOW_OFFSET, cwindow->y + SHADOW_OFFSET, - cwindow->width, cwindow->height); + geometry->x + SHADOW_OFFSET, geometry->y + SHADOW_OFFSET, + geometry->width, geometry->height); XFixesSetPictureClipRegion (dpy, destination, 0, 0, old_clip); @@ -906,10 +946,10 @@ cwindow_draw (CWindow *cwindow, Picture destination) None, destination, 0, 0, 0, 0, - cwindow->x, - cwindow->y, - cwindow->width, - cwindow->height); + geometry->x, + geometry->y, + geometry->width, + geometry->height); XFixesDestroyRegion (dpy, old_clip); XFixesDestroyRegion (dpy, shadow_clip); diff --git a/src/cwindow.h b/src/cwindow.h index b8a08099..fdb7f165 100644 --- a/src/cwindow.h +++ b/src/cwindow.h @@ -99,3 +99,5 @@ void cwindow_process_configure_notify (CWindow *cwindo XConfigureEvent *event); void cwindow_draw (CWindow *cwindow, Picture destination); +void cwindow_freeze (CWindow *cwindow); +void cwindow_thaw (CWindow *cwindow); diff --git a/src/frame.c b/src/frame.c index 76e62966..a2022a91 100644 --- a/src/frame.c +++ b/src/frame.c @@ -347,7 +347,7 @@ meta_frame_sync_to_window (MetaFrame *frame, * shaped, which might be more visible. */ update_shape (frame); - + meta_ui_move_resize_frame (frame->window->screen->ui, frame->xwindow, frame->rect.x, @@ -32,26 +32,36 @@ #ifdef HAVE_BACKTRACE #include <execinfo.h> void -meta_print_backtrace (void) +meta_print_top_of_stack (int n_frames) { void *bt[500]; int bt_size; int i; char **syms; + + if (n_frames < 0) + n_frames = 500; - bt_size = backtrace (bt, 500); + bt_size = backtrace (bt, n_frames); syms = backtrace_symbols (bt, bt_size); i = 0; while (i < bt_size) { - meta_verbose (" %s\n", syms[i]); - ++i; + g_print (" %s\n", syms[i]); + ++i; } free (syms); } + +void +meta_print_backtrace (void) +{ + meta_print_top_of_stack (-1); +} + #else void meta_print_backtrace (void) @@ -83,6 +83,7 @@ gint meta_unsigned_long_equal (gconstpointer v1, guint meta_unsigned_long_hash (gconstpointer v); void meta_print_backtrace (void); +void meta_print_top_of_stack (int n_frames); #include <libintl.h> #define _(x) dgettext (GETTEXT_PACKAGE, x) diff --git a/src/window-props.c b/src/window-props.c index 2bde03b5..32b137fb 100644 --- a/src/window-props.c +++ b/src/window-props.c @@ -439,7 +439,6 @@ init_normal_hints (MetaDisplay *display, value->atom = XA_WM_NORMAL_HINTS; } - #define FLAG_TOGGLED_ON(old,new,flag) \ (((old)->flags & (flag)) == 0 && \ ((new)->flags & (flag)) != 0) diff --git a/src/window.c b/src/window.c index 9def4ac4..c84a05d5 100644 --- a/src/window.c +++ b/src/window.c @@ -2461,11 +2461,8 @@ meta_window_move_resize_internal (MetaWindow *window, meta_frame_calc_geometry (window->frame, &fgeom); - - meta_compositor_stop_compositing (window->display->compositor, window); - if (is_configure_request || do_gravity_adjust) - { + { adjust_for_gravity (window, window->frame ? &fgeom : NULL, /* configure request coords assume @@ -2702,11 +2699,6 @@ meta_window_move_resize_internal (MetaWindow *window, if (use_static_gravity) meta_window_set_gravity (window, StaticGravity); - - if (configure_frame_first && window->frame) - meta_frame_sync_to_window (window->frame, - resize_gravity, - need_move_frame, need_resize_frame); values.border_width = 0; values.x = client_move_x; @@ -2722,40 +2714,74 @@ meta_window_move_resize_internal (MetaWindow *window, if (need_resize_client) mask |= (CWWidth | CWHeight); +#if 0 + if (mask == 0) + g_print ("nothing happened\n"); +#endif + + configure_frame_first = TRUE; + + if (mask != 0) + if (window->sync_request_counter != None && + window->display->grab_sync_request_alarm != None && + window->sync_request_time.tv_usec == 0 && + window->sync_request_time.tv_sec == 0) + { +#if 0 + g_print ("stop compositing\n"); +#endif + meta_compositor_stop_compositing (window->display->compositor, window); + } + + if (configure_frame_first && window->frame) + meta_frame_sync_to_window (window->frame, + resize_gravity, + need_move_frame, need_resize_frame); + if (mask != 0) { { - int newx, newy; - meta_window_get_position (window, &newx, &newy); - meta_topic (META_DEBUG_GEOMETRY, - "Syncing new client geometry %d,%d %dx%d, border: %s pos: %s size: %s\n", - newx, newy, - window->rect.width, window->rect.height, - mask & CWBorderWidth ? "true" : "false", - need_move_client ? "true" : "false", - need_resize_client ? "true" : "false"); + int newx, newy; + meta_window_get_position (window, &newx, &newy); + meta_topic (META_DEBUG_GEOMETRY, + "Syncing new client geometry %d,%d %dx%d, border: %s pos: %s size: %s\n", + newx, newy, + window->rect.width, window->rect.height, + mask & CWBorderWidth ? "true" : "false", + need_move_client ? "true" : "false", + need_resize_client ? "true" : "false"); } meta_error_trap_push (window->display); - + #ifdef HAVE_XSYNC if (window->sync_request_counter != None && window->display->grab_sync_request_alarm != None && window->sync_request_time.tv_usec == 0 && window->sync_request_time.tv_sec == 0) { +#if 0 + g_print ("send sync request: %p\n", window); +#endif send_sync_request (window); } + else + meta_print_backtrace (); +#if 0 + g_print ("not sending request\n"); +#endif +#endif +#if 0 + g_print ("configuring client\n"); #endif - XConfigureWindow (window->display->xdisplay, - window->xwindow, - mask, - &values); + window->xwindow, + mask, + &values); meta_error_trap_pop (window->display, FALSE); } - + if (!configure_frame_first && window->frame) meta_frame_sync_to_window (window->frame, resize_gravity, @@ -5956,15 +5982,18 @@ check_moveresize_frequency (MetaWindow *window, double elapsed = time_diff (¤t_time, &window->sync_request_time); - if (elapsed < 1000.0) + if (elapsed < 10000000.0) { /* We want to be sure that the timeout happens at * a time where elapsed will definitely be * greater than 1000, so we can disable sync */ if (remaining) - *remaining = 1000.0 - elapsed + 100; - + *remaining = 10000000.0 - elapsed + 100; + +#if 0 + g_print ("ignoring event\n"); +#endif return FALSE; } else @@ -5973,6 +6002,9 @@ check_moveresize_frequency (MetaWindow *window, * application to respond to the sync request */ window->disable_sync = TRUE; +#if 0 + g_print ("buggy app\n"); +#endif return TRUE; } } @@ -5980,6 +6012,9 @@ check_moveresize_frequency (MetaWindow *window, { /* No outstanding sync requests. Go ahead and resize */ +#if 0 + g_print ("going ahead\n"); +#endif return TRUE; } } @@ -6255,8 +6290,6 @@ update_resize (MetaWindow *window, gravity = meta_resize_gravity_from_grab_op (window->display->grab_op); g_assert (gravity >= 0); - meta_compositor_start_compositing (window->display->compositor, window); - if (window->display->grab_wireframe_active) { /* FIXME This is crap. For example, the wireframe isn't @@ -6289,7 +6322,10 @@ update_resize (MetaWindow *window, } else { - meta_window_resize_with_gravity (window, TRUE, new_w, new_h, gravity); +#if 0 + g_print ("r with g\n"); +#endif + meta_window_resize_with_gravity (window, TRUE, new_w, new_h, gravity); } /* Store the latest resize time, if we actually resized. */ @@ -6329,7 +6365,6 @@ handle_moving_event (MetaWindow *window, XEvent *event) } } - static void handle_resizing_event (MetaWindow *window, XEvent *event) { @@ -6377,10 +6412,18 @@ meta_window_handle_mouse_grab_op_event (MetaWindow *window, * the application has come to its senses (maybe it was just * busy with a pagefault or a long computation). */ +#if 0 + g_print ("resetting\n"); +#endif window->disable_sync = FALSE; window->sync_request_time.tv_sec = 0; window->sync_request_time.tv_usec = 0; +#if 0 + g_print ("start compositing %p\n", window); +#endif + meta_compositor_start_compositing (window->display->compositor, window); + /* This means we are ready for another configure. */ if (meta_grab_op_is_resizing (window->display->grab_op)) { |