diff options
author | Elijah Newren <newren gmail com> | 2007-04-12 04:02:57 +0000 |
---|---|---|
committer | Elijah Newren <newren@src.gnome.org> | 2007-04-12 04:02:57 +0000 |
commit | 9ec6dbd5ca3becd42eb6d39f50d01e970b3476e8 (patch) | |
tree | 99a3034a73dab0d326caabe7c04898725f1f03a6 | |
parent | 2034a309e55b459f6689185a318df777736bf135 (diff) | |
download | metacity-9ec6dbd5ca3becd42eb6d39f50d01e970b3476e8.tar.gz |
Make sure apps have correct info about their coordinates, even on unmap.
2007-04-11 Elijah Newren <newren gmail com>
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
-rw-r--r-- | ChangeLog | 17 | ||||
-rw-r--r-- | src/frame.c | 5 | ||||
-rw-r--r-- | src/window.c | 25 |
3 files changed, 41 insertions, 6 deletions
@@ -1,3 +1,20 @@ +2007-04-11 Elijah Newren <newren gmail com> + + 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 <thomas@thurman.org.uk> Workaround for a gdk bug which dies with BadAlloc if you try diff --git a/src/frame.c b/src/frame.c index 922443d3..399bfac5 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 78c6e992..6b81d399 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; |