chore: allow dragging window from titlebar when maximized (#178)

This better matches titlebar behavior of Windows and KDE, and probably a lot more other environments, it also allows for easier unmaximizing because the current titlebar has no dedicated maximize/restore button.

Note: This is somewhat problematic on Windows, thus we only apply the change to other platforms for now.
This commit is contained in:
Tech-Tac
2026-07-17 19:38:01 +03:00
committed by GitHub
parent 033e48044c
commit a10bbb4e8d
2 changed files with 14 additions and 3 deletions

View File

@@ -129,8 +129,14 @@ void TitleBar::mouseMoveEvent(QMouseEvent *event)
}
}
bool optionalMaximized = false;
#if defined(Q_OS_WIN)
optionalMaximized = isMaximized();
#endif
if (event->buttons() & Qt::LeftButton && m_dragPending
&& !window()->isMaximized() && !window()->isFullScreen()) {
&& !window()->isFullScreen() && !optionalMaximized) {
if (QWindow *wh = window()->windowHandle()) {
if (!wh->startSystemMove())
window()->move(event->globalPosition().toPoint() - m_moveStartPos);