Apply window extents early to avoid window size changes
This commit is contained in:
parent
6732aa70e9
commit
180b0bc517
1 changed files with 5 additions and 8 deletions
|
|
@ -192,12 +192,13 @@ DefaultWindowHelper::DefaultWindowHelper(not_null<RpWidget*> window)
|
||||||
}
|
}
|
||||||
|
|
||||||
void DefaultWindowHelper::init() {
|
void DefaultWindowHelper::init() {
|
||||||
_title->show();
|
|
||||||
|
|
||||||
if (WindowExtentsSupported()) {
|
if (WindowExtentsSupported()) {
|
||||||
window()->setAttribute(Qt::WA_TranslucentBackground);
|
window()->setAttribute(Qt::WA_TranslucentBackground);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
window()->createWinId();
|
||||||
|
_title->show();
|
||||||
|
|
||||||
rpl::combine(
|
rpl::combine(
|
||||||
window()->widthValue(),
|
window()->widthValue(),
|
||||||
_windowState.value(),
|
_windowState.value(),
|
||||||
|
|
@ -260,12 +261,8 @@ void DefaultWindowHelper::init() {
|
||||||
bool shown,
|
bool shown,
|
||||||
bool titleShown,
|
bool titleShown,
|
||||||
Qt::WindowStates windowState) {
|
Qt::WindowStates windowState) {
|
||||||
if (const auto handle = window()->windowHandle()) {
|
window()->windowHandle()->setFlag(Qt::FramelessWindowHint, titleShown);
|
||||||
handle->setFlag(Qt::FramelessWindowHint, titleShown);
|
updateWindowExtents();
|
||||||
updateWindowExtents();
|
|
||||||
} else {
|
|
||||||
window()->setWindowFlag(Qt::FramelessWindowHint, titleShown);
|
|
||||||
}
|
|
||||||
}, window()->lifetime());
|
}, window()->lifetime());
|
||||||
|
|
||||||
window()->events() | rpl::start_with_next([=](not_null<QEvent*> e) {
|
window()->events() | rpl::start_with_next([=](not_null<QEvent*> e) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue