Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions src/core/frame.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ meta_window_destroy_frame (MetaWindow *window)
{
MetaFrame *frame;
MetaFrameBorders borders;
int offset_x, offset_y;

if (window->frame == NULL)
return;
Expand Down Expand Up @@ -198,15 +199,33 @@ meta_window_destroy_frame (MetaWindow *window)
"Incrementing unmaps_pending on %s for reparent back to root\n", window->desc);
window->unmaps_pending += 1;
}

/* Account for window gravity when choosing where to place the client
* on the root window, so that re-managing it doesn't shift its
* position. StaticGravity clients (e.g. Qt) expect the client's own
* position; other gravities need the visible frame corner so that
* adjust_for_gravity() can add the borders back correctly.
*/
if (window->size_hints.win_gravity == StaticGravity)
{
offset_x = frame->child_x;
offset_y = frame->child_y;
}
else
{
offset_x = borders.invisible.left;
offset_y = borders.invisible.top;
}

XReparentWindow (window->display->xdisplay,
window->xwindow,
window->screen->xroot,
/* 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 + borders.invisible.left,
window->frame->rect.y + borders.invisible.top);
window->frame->rect.x + offset_x,
window->frame->rect.y + offset_y);
meta_error_trap_pop (window->display, FALSE);

meta_ui_destroy_frame_window (window->screen->ui, frame->xwindow);
Expand Down
Loading