From 9ec6dbd5ca3becd42eb6d39f50d01e970b3476e8 Mon Sep 17 00:00:00 2001 From: Elijah Newren Date: Thu, 12 Apr 2007 04:02:57 +0000 Subject: [PATCH] Make sure apps have correct info about their coordinates, even on unmap. 2007-04-11 Elijah Newren Make sure apps have correct info about their coordinates, even on unmap. Fixes temporary hang with libXt (XtVaSetValues setting x & y coordinates). #399552. * src/frame.c (meta_window_destroy_frame): Add a comment noting that the current choice causes the need for a ConfigureNotify event * src/window.c (meta_window_free): Send a configure notify event due to our XReparentWindow coordinate choices on withdrawal, (unmaximize_window_before_freeing): no need to send a configure notify from here since it is always done in meta_window_free new, (send_configure_notify): have to special case the coordinates used when withdrawing the window svn path=/trunk/; revision=3192 --- ChangeLog | 17 +++++++++++++++++ src/frame.c | 5 ++++- src/window.c | 25 ++++++++++++++++++++----- 3 files changed, 41 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index ab624e233..d2284f6fc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2007-04-11 Elijah Newren + + Make sure apps have correct info about their coordinates, even on + unmap. Fixes temporary hang with libXt (XtVaSetValues setting x & + y coordinates). #399552. + + * src/frame.c (meta_window_destroy_frame): Add a comment noting + that the current choice causes the need for a ConfigureNotify + event + + * src/window.c (meta_window_free): Send a configure notify event + due to our XReparentWindow coordinate choices on withdrawal, + (unmaximize_window_before_freeing): no need to send a configure + notify from here since it is always done in meta_window_free new, + (send_configure_notify): have to special case the coordinates used + when withdrawing the window + 2007-04-11 Thomas Thurman Workaround for a gdk bug which dies with BadAlloc if you try diff --git a/src/frame.c b/src/frame.c index 922443d3c..399bfac5d 100644 --- a/src/frame.c +++ b/src/frame.c @@ -197,7 +197,10 @@ meta_window_destroy_frame (MetaWindow *window) XReparentWindow (window->display->xdisplay, window->xwindow, window->screen->xroot, - /* FIXME where to put it back depends on the gravity */ + /* Using anything other than meta_window_get_position() + * coordinates here means we'll need to ensure a configure + * notify event is sent; see bug 399552. + */ window->frame->rect.x, window->frame->rect.y); meta_error_trap_pop (window->display, FALSE); diff --git a/src/window.c b/src/window.c index 78c6e992e..6b81d399f 100644 --- a/src/window.c +++ b/src/window.c @@ -1015,6 +1015,12 @@ meta_window_free (MetaWindow *window, if (window->maximized_horizontally || window->maximized_vertically) unmaximize_window_before_freeing (window); + + /* The XReparentWindow call in meta_window_destroy_frame() moves the + * window so we need to send a configure notify; see bug 399552. (We + * also do this just in case a window got unmaximized.) + */ + send_configure_notify (window); meta_window_unqueue_calc_showing (window); meta_window_unqueue_move_resize (window); @@ -2390,8 +2396,6 @@ unmaximize_window_before_freeing (MetaWindow *window) if (window->withdrawn) /* See bug #137185 */ { window->rect = window->saved_rect; - send_configure_notify (window); - set_net_wm_state (window); } else if (window->screen->closing) /* See bug #358042 */ @@ -5393,9 +5397,20 @@ send_configure_notify (MetaWindow *window) event.xconfigure.y = window->rect.y - window->border_width; if (window->frame) { - /* Need to be in root window coordinates */ - event.xconfigure.x += window->frame->rect.x; - event.xconfigure.y += window->frame->rect.y; + if (window->withdrawn) + { + /* WARNING: x & y need to be set to whatever the XReparentWindow + * call in meta_window_destroy_frame will use so that the window + * has the right coordinates. Currently, that means no change to + * x & y. + */ + } + else + { + /* Need to be in root window coordinates */ + event.xconfigure.x += window->frame->rect.x; + event.xconfigure.y += window->frame->rect.y; + } } event.xconfigure.width = window->rect.width; event.xconfigure.height = window->rect.height;