xcb: Determine the window gravity just before the window is shown

It may change after the window has been created.

Change-Id: Ib81a7ad7353b1909cc42684fc70d6b7d2556106f
Reviewed-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
This commit is contained in:
Alexander Volkov 2015-03-05 16:18:02 +03:00 committed by Shawn Rutledge
parent 9f1f8aaa92
commit c0e4f24336

View File

@ -308,11 +308,6 @@ void QXcbWindow::create()
return;
}
// Determine gravity from initial position. Do not change
// later as it will cause the window to move uncontrollably.
m_gravity = positionIncludesFrame(window()) ?
XCB_GRAVITY_NORTH_WEST : XCB_GRAVITY_STATIC;
const quint32 mask = XCB_CW_BACK_PIXMAP | XCB_CW_OVERRIDE_REDIRECT | XCB_CW_SAVE_UNDER | XCB_CW_EVENT_MASK;
const quint32 values[] = {
// XCB_CW_BACK_PIXMAP
@ -732,6 +727,9 @@ void QXcbWindow::show()
xcb_set_wm_hints(xcb_connection(), m_window, &hints);
m_gravity = positionIncludesFrame(window()) ?
XCB_GRAVITY_NORTH_WEST : XCB_GRAVITY_STATIC;
// update WM_NORMAL_HINTS
propagateSizeHints();