diff --git a/CHANGELOG.md b/CHANGELOG.md index 560838cb..e017aaf4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ - Bugfix: Forward query params to websocket URLs. (#6141) - Bugfix: Fixed Lua errors from handlers of HTTP requests not being logged. (#6452) - Bugfix: Fixed restore button not showing on Windows. (#6565) +- Bugfix: Fixed popups and the overlay not being draggable on Wayland. (#6573) - Dev: Update release documentation. (#6498) - Dev: Make code sanitizers opt in with the `CHATTERINO_SANITIZER_SUPPORT` CMake option. After that's enabled, use the `SANITIZE_*` flag to enable individual sanitizers. (#6493) - Dev: Remove unused QTextCodec includes. (#6487) diff --git a/src/widgets/BaseWindow.cpp b/src/widgets/BaseWindow.cpp index a16dd544..70592712 100644 --- a/src/widgets/BaseWindow.cpp +++ b/src/widgets/BaseWindow.cpp @@ -612,7 +612,8 @@ void BaseWindow::mousePressEvent(QMouseEvent *event) return recursiveCheckMouseTracking(widget->parentWidget()); }; - if (!recursiveCheckMouseTracking(widget)) + if (!recursiveCheckMouseTracking(widget) && + !this->windowHandle()->startSystemMove()) { this->moving = true; } diff --git a/src/widgets/DraggablePopup.cpp b/src/widgets/DraggablePopup.cpp index 240dac76..1dc649aa 100644 --- a/src/widgets/DraggablePopup.cpp +++ b/src/widgets/DraggablePopup.cpp @@ -3,6 +3,7 @@ #include "buttons/SvgButton.hpp" #include +#include #include @@ -10,31 +11,23 @@ namespace chatterino { namespace { +constexpr FlagsEnum POPUP_FLAGS{ #ifdef Q_OS_LINUX -FlagsEnum popupFlags{ BaseWindow::Dialog, +#endif BaseWindow::EnableCustomFrame, }; -FlagsEnum popupFlagsCloseAutomatically{ - BaseWindow::Dialog, - BaseWindow::EnableCustomFrame, -}; -#else -FlagsEnum popupFlags{ - BaseWindow::EnableCustomFrame, -}; -FlagsEnum popupFlagsCloseAutomatically{ +constexpr FlagsEnum POPUP_FLAGS_CLOSE_AUTOMATICALLY{ BaseWindow::EnableCustomFrame, BaseWindow::Frameless, BaseWindow::FramelessDraggable, }; -#endif } // namespace DraggablePopup::DraggablePopup(bool closeAutomatically, QWidget *parent) : BaseWindow( - (closeAutomatically ? popupFlagsCloseAutomatically : popupFlags) | + (closeAutomatically ? POPUP_FLAGS_CLOSE_AUTOMATICALLY : POPUP_FLAGS) | BaseWindow::DisableLayoutSave | BaseWindow::ClearBuffersOnDpiChange, parent) @@ -72,7 +65,8 @@ DraggablePopup::DraggablePopup(bool closeAutomatically, QWidget *parent) void DraggablePopup::mousePressEvent(QMouseEvent *event) { - if (event->button() == Qt::MouseButton::LeftButton) + if (event->button() == Qt::MouseButton::LeftButton && + !this->windowHandle()->startSystemMove()) { this->dragTimer_.start(std::chrono::milliseconds(17)); this->startPosDrag_ = event->pos(); diff --git a/src/widgets/OverlayWindow.cpp b/src/widgets/OverlayWindow.cpp index db7537fb..2f14c3e5 100644 --- a/src/widgets/OverlayWindow.cpp +++ b/src/widgets/OverlayWindow.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #ifdef Q_OS_WIN # include @@ -232,6 +233,10 @@ bool OverlayWindow::eventFilter(QObject * /*object*/, QEvent *event) switch (event->type()) { case QEvent::MouseButtonPress: { + if (this->windowHandle()->startSystemMove()) + { + return true; + } auto *evt = dynamic_cast(event); this->moving_ = true; this->moveOrigin_ = evt->globalPosition().toPoint();