From 78a2835bbf089a8d8bdf8669a054e496ae08bd16 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Fri, 28 Aug 2020 16:24:54 +0400 Subject: [PATCH] Extents should be updated on each event only on Wayland --- Telegram/SourceFiles/window/window_title_qt.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/window/window_title_qt.cpp b/Telegram/SourceFiles/window/window_title_qt.cpp index 1763ef659e..8a52c34939 100644 --- a/Telegram/SourceFiles/window/window_title_qt.cpp +++ b/Telegram/SourceFiles/window/window_title_qt.cpp @@ -8,6 +8,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "window/window_title_qt.h" #include "platform/platform_specific.h" +#include "base/platform/base_platform_info.h" #include "ui/platform/ui_platform_utility.h" #include "ui/widgets/buttons.h" #include "ui/widgets/shadow.h" @@ -237,9 +238,10 @@ void TitleWidgetQt::mouseDoubleClickEvent(QMouseEvent *e) { bool TitleWidgetQt::eventFilter(QObject *obj, QEvent *e) { // I tried to listen only QEvent::Move and QEvent::Resize - // but that didn't work + // but that doesn't work on Wayland if (obj->isWidgetType() - && window() == static_cast(obj)) { + && window() == static_cast(obj) + && Platform::IsWayland()) { updateWindowExtents(); } @@ -265,6 +267,11 @@ bool TitleWidgetQt::eventFilter(QObject *obj, QEvent *e) { if (window() == static_cast(obj)) { restoreCursor(); } + } else if (e->type() == QEvent::Move + || e->type() == QEvent::Resize) { + if (window() == static_cast(obj)) { + updateWindowExtents(); + } } return TitleWidget::eventFilter(obj, e);