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
This commit is contained in:
Elijah Newren 2007-04-12 04:02:57 +00:00 committed by Elijah Newren
parent 2034a309e5
commit 9ec6dbd5ca
3 changed files with 41 additions and 6 deletions

View File

@ -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> 2007-04-11 Thomas Thurman <thomas@thurman.org.uk>
Workaround for a gdk bug which dies with BadAlloc if you try Workaround for a gdk bug which dies with BadAlloc if you try

View File

@ -197,7 +197,10 @@ meta_window_destroy_frame (MetaWindow *window)
XReparentWindow (window->display->xdisplay, XReparentWindow (window->display->xdisplay,
window->xwindow, window->xwindow,
window->screen->xroot, 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.x,
window->frame->rect.y); window->frame->rect.y);
meta_error_trap_pop (window->display, FALSE); meta_error_trap_pop (window->display, FALSE);

View File

@ -1016,6 +1016,12 @@ meta_window_free (MetaWindow *window,
if (window->maximized_horizontally || window->maximized_vertically) if (window->maximized_horizontally || window->maximized_vertically)
unmaximize_window_before_freeing (window); 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_calc_showing (window);
meta_window_unqueue_move_resize (window); meta_window_unqueue_move_resize (window);
meta_window_unqueue_update_icon (window); meta_window_unqueue_update_icon (window);
@ -2390,8 +2396,6 @@ unmaximize_window_before_freeing (MetaWindow *window)
if (window->withdrawn) /* See bug #137185 */ if (window->withdrawn) /* See bug #137185 */
{ {
window->rect = window->saved_rect; window->rect = window->saved_rect;
send_configure_notify (window);
set_net_wm_state (window); set_net_wm_state (window);
} }
else if (window->screen->closing) /* See bug #358042 */ 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; event.xconfigure.y = window->rect.y - window->border_width;
if (window->frame) if (window->frame)
{ {
/* Need to be in root window coordinates */ if (window->withdrawn)
event.xconfigure.x += window->frame->rect.x; {
event.xconfigure.y += window->frame->rect.y; /* 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.width = window->rect.width;
event.xconfigure.height = window->rect.height; event.xconfigure.height = window->rect.height;