Skip to content

"Universal" workspace panning#8203

Open
yohannd1 wants to merge 29 commits intoLMMS:masterfrom
yohannd1:feature/workspace-drag
Open

"Universal" workspace panning#8203
yohannd1 wants to merge 29 commits intoLMMS:masterfrom
yohannd1:feature/workspace-drag

Conversation

@yohannd1
Copy link
Copy Markdown
Contributor

@yohannd1 yohannd1 commented Jan 9, 2026

This PR adds the ability to pan through the workspace without having to click on free areas (i.e. the background). This is done primarily through holding Alt-S and dragging the area around (optionally clicking), but I've also put scrollbars back.

2026-02-24.universal_panning_demo.v3.mp4

KNOWN BUGS:

  • Sometimes maximized subwindows have a wrong size until either the main window is resized or the subwindow itself is closed and reopened.
  • Panning via Alt-S-Click sometimes stops working (haven't managed to track down the cause yet).

When testing, keep an eye out for whether the scroll bars are working properly and whether panning feels natural, or if it's error prone.

(Old) progress
  • Initial implementation
  • Change keybinding: Ctrl+Alt -> Alt+S
  • Fix offset bug (at 0:12 in the video)
  • Add checks to prevent dragging in odd situations (at 0:16 in the video)
  • Fix bug where panning without the keybinding, finishing and then trying to drag a widget is causing weird issues. Usually it tries to resize the widget.
  • Implement scrollbars
  • Fix scrollbar twitching (it glitches out sometimes, specially when going to the top/left while the screen is not maximized)
  • Put scrollbars in the correct position (vertical on the right, and bottom one with the width of the workspace widget itself)
  • Fix maximized windows being messed up (introduced by 8d333a4)
  • Fix scrollbars appearing when a window is maximized
  • Fix wheel-scrolling on the scrollbars (it does nothing, but changes the scrollbar value) - fixed by 27ecfdf
  • Fix bug: 1. open automation window (maximized); 2. open piano roll window (maximized); 2. close piano roll window; then the song editor will be focused. It shouldn't, and messes up panning - fixed by aca8480
  • When loading a project, song editor will go over other windows. How to avoid that? Or at least remedy it. If the piano roll is maximized and open, for example, the song editor goes over and things get confusing. Not necessary for this PR

@yohannd1 yohannd1 changed the title Workspace dragging with Ctrl+Alt "Universal" workspace panning with Ctrl+Alt Jan 9, 2026
Copy link
Copy Markdown
Contributor

@szeli1 szeli1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My concern with this PR is that it looks like to me that other "ctrl + alt" mouse shortcuts may not work because of the event filter. I did not test this PR.
Here is some code that may be effected:
AutomationEditor:

}
else if( we->modifiers() & Qt::ControlModifier && we->modifiers() & Qt::AltModifier )
{

ClipView:

bool ClipView::unquantizedModHeld( QMouseEvent * me )
{
	return me->modifiers() & Qt::ControlModifier || me->modifiers() & Qt::AltModifier;
}

PianoRoll:

void PianoRoll::dragNotes(int x, int y, bool alt, bool shift, bool ctrl)

Comment thread src/gui/MainWindow.cpp Outdated
Comment thread src/gui/MainWindow.cpp Outdated
yohannd1 and others added 2 commits January 9, 2026 14:37
Co-authored-by: szeli1 <143485814+szeli1@users.noreply.github.com>
@yohannd1 yohannd1 changed the title "Universal" workspace panning with Ctrl+Alt "Universal" workspace panning Jan 9, 2026
@yohannd1
Copy link
Copy Markdown
Contributor Author

yohannd1 commented Jan 9, 2026

Changed the keybinding to Alt+S, which (as discussed on discord) is not perfect. I'm hoping to find a better keybinding in the future but for now I'm leaving this one, which I believe doesn't have any conflicts.

Also a note to self: adding the keybinding handling on the event filter is sadly necessary, as when it is pressed I have to prevent it from being forwarded to other elements. I tried implementing it with key{Press,Release}Event and it was a mess.

@szeli1
Copy link
Copy Markdown
Contributor

szeli1 commented Jan 11, 2026

Also a note to self: adding the keybinding handling on the event filter is sadly necessary, as when it is pressed I have to prevent it from being forwarded to other elements. I tried implementing it with key{Press,Release}Event and it was a mess.

If I remember correctly, there are other options like implementing it in MainWindow::KeyPressEvent, or by using QAction with a shortcut in MainWindow, but event filter may be the best option.

Copy link
Copy Markdown
Contributor

@szeli1 szeli1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not test this PR.

Comment thread src/gui/MainWindow.cpp Outdated
Comment thread src/gui/MainWindow.cpp Outdated
Comment thread include/MainWindow.h Outdated
Comment thread src/gui/MainWindow.cpp Outdated
Comment thread include/MainWindow.h
Comment thread src/gui/MainWindow.cpp Outdated
Comment thread src/gui/MainWindow.cpp Outdated
Comment thread src/gui/MainWindow.cpp Outdated
Comment thread src/gui/MainWindow.cpp Outdated
@yohannd1 yohannd1 mentioned this pull request Feb 19, 2026
9 tasks
@yohannd1 yohannd1 marked this pull request as ready for review February 24, 2026 14:27
@yohannd1
Copy link
Copy Markdown
Contributor Author

yohannd1 commented Mar 9, 2026

Update! I've found some bugs introduced by this PR and reported them on the PR description. They are not critical (they are not irreversible) but they are a bit annoying sometimes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants