Change FramelessWindowHint not only when the window is shown

This commit is contained in:
Ilya Fedin 2022-06-21 22:29:00 +04:00 committed by John Preston
parent adf267a3a2
commit 941dc48366

View file

@ -200,7 +200,6 @@ DefaultWindowHelper::DefaultWindowHelper(not_null<RpWidget*> window)
void DefaultWindowHelper::init() { void DefaultWindowHelper::init() {
_title->show(); _title->show();
window()->setWindowFlag(Qt::FramelessWindowHint);
if (WindowExtentsSupported()) { if (WindowExtentsSupported()) {
window()->setAttribute(Qt::WA_TranslucentBackground); window()->setAttribute(Qt::WA_TranslucentBackground);
@ -268,10 +267,8 @@ void DefaultWindowHelper::init() {
bool shown, bool shown,
bool titleShown, bool titleShown,
Qt::WindowStates windowState) { Qt::WindowStates windowState) {
if (shown) { window()->windowHandle()->setFlag(Qt::FramelessWindowHint, titleShown);
window()->windowHandle()->setFlag(Qt::FramelessWindowHint, titleShown); updateWindowExtents();
updateWindowExtents();
}
}, window()->lifetime()); }, window()->lifetime());
window()->events() | rpl::start_with_next([=](not_null<QEvent*> e) { window()->events() | rpl::start_with_next([=](not_null<QEvent*> e) {