fix(wayland): use system move (#6573)
Reviewed-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
@@ -18,6 +18,7 @@
|
|||||||
- Bugfix: Forward query params to websocket URLs. (#6141)
|
- Bugfix: Forward query params to websocket URLs. (#6141)
|
||||||
- Bugfix: Fixed Lua errors from handlers of HTTP requests not being logged. (#6452)
|
- Bugfix: Fixed Lua errors from handlers of HTTP requests not being logged. (#6452)
|
||||||
- Bugfix: Fixed restore button not showing on Windows. (#6565)
|
- 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: 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: 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)
|
- Dev: Remove unused QTextCodec includes. (#6487)
|
||||||
|
|||||||
@@ -612,7 +612,8 @@ void BaseWindow::mousePressEvent(QMouseEvent *event)
|
|||||||
return recursiveCheckMouseTracking(widget->parentWidget());
|
return recursiveCheckMouseTracking(widget->parentWidget());
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!recursiveCheckMouseTracking(widget))
|
if (!recursiveCheckMouseTracking(widget) &&
|
||||||
|
!this->windowHandle()->startSystemMove())
|
||||||
{
|
{
|
||||||
this->moving = true;
|
this->moving = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
#include "buttons/SvgButton.hpp"
|
#include "buttons/SvgButton.hpp"
|
||||||
|
|
||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
|
#include <QWindow>
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
|
|
||||||
@@ -10,31 +11,23 @@ namespace chatterino {
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
constexpr FlagsEnum<BaseWindow::Flags> POPUP_FLAGS{
|
||||||
#ifdef Q_OS_LINUX
|
#ifdef Q_OS_LINUX
|
||||||
FlagsEnum<BaseWindow::Flags> popupFlags{
|
|
||||||
BaseWindow::Dialog,
|
BaseWindow::Dialog,
|
||||||
|
#endif
|
||||||
BaseWindow::EnableCustomFrame,
|
BaseWindow::EnableCustomFrame,
|
||||||
};
|
};
|
||||||
FlagsEnum<BaseWindow::Flags> popupFlagsCloseAutomatically{
|
constexpr FlagsEnum<BaseWindow::Flags> POPUP_FLAGS_CLOSE_AUTOMATICALLY{
|
||||||
BaseWindow::Dialog,
|
|
||||||
BaseWindow::EnableCustomFrame,
|
|
||||||
};
|
|
||||||
#else
|
|
||||||
FlagsEnum<BaseWindow::Flags> popupFlags{
|
|
||||||
BaseWindow::EnableCustomFrame,
|
|
||||||
};
|
|
||||||
FlagsEnum<BaseWindow::Flags> popupFlagsCloseAutomatically{
|
|
||||||
BaseWindow::EnableCustomFrame,
|
BaseWindow::EnableCustomFrame,
|
||||||
BaseWindow::Frameless,
|
BaseWindow::Frameless,
|
||||||
BaseWindow::FramelessDraggable,
|
BaseWindow::FramelessDraggable,
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
DraggablePopup::DraggablePopup(bool closeAutomatically, QWidget *parent)
|
DraggablePopup::DraggablePopup(bool closeAutomatically, QWidget *parent)
|
||||||
: BaseWindow(
|
: BaseWindow(
|
||||||
(closeAutomatically ? popupFlagsCloseAutomatically : popupFlags) |
|
(closeAutomatically ? POPUP_FLAGS_CLOSE_AUTOMATICALLY : POPUP_FLAGS) |
|
||||||
BaseWindow::DisableLayoutSave |
|
BaseWindow::DisableLayoutSave |
|
||||||
BaseWindow::ClearBuffersOnDpiChange,
|
BaseWindow::ClearBuffersOnDpiChange,
|
||||||
parent)
|
parent)
|
||||||
@@ -72,7 +65,8 @@ DraggablePopup::DraggablePopup(bool closeAutomatically, QWidget *parent)
|
|||||||
|
|
||||||
void DraggablePopup::mousePressEvent(QMouseEvent *event)
|
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->dragTimer_.start(std::chrono::milliseconds(17));
|
||||||
this->startPosDrag_ = event->pos();
|
this->startPosDrag_ = event->pos();
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
#include <QKeySequence>
|
#include <QKeySequence>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QSizeGrip>
|
#include <QSizeGrip>
|
||||||
|
#include <QWindow>
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
# include <Windows.h>
|
# include <Windows.h>
|
||||||
@@ -232,6 +233,10 @@ bool OverlayWindow::eventFilter(QObject * /*object*/, QEvent *event)
|
|||||||
switch (event->type())
|
switch (event->type())
|
||||||
{
|
{
|
||||||
case QEvent::MouseButtonPress: {
|
case QEvent::MouseButtonPress: {
|
||||||
|
if (this->windowHandle()->startSystemMove())
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
auto *evt = dynamic_cast<QMouseEvent *>(event);
|
auto *evt = dynamic_cast<QMouseEvent *>(event);
|
||||||
this->moving_ = true;
|
this->moving_ = true;
|
||||||
this->moveOrigin_ = evt->globalPosition().toPoint();
|
this->moveOrigin_ = evt->globalPosition().toPoint();
|
||||||
|
|||||||
Reference in New Issue
Block a user