Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Detach window #3532

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from
Draft

Feature: Detach window #3532

wants to merge 13 commits into from

Conversation

lukas-w
Copy link
Member

@lukas-w lukas-w commented May 5, 2017

Allows detaching a window from LMMS's main window, making things like working on multiple screens easier.

Closes #1259

Quick demonstration:
lmms-window-detach

Edit: This uses some Qt5-only features, so it's best to wait with merging this until we've switched (#2611).

@BaraMGB
Copy link
Contributor

BaraMGB commented May 5, 2017

Wow! That's really awesome!

@karmux
Copy link
Contributor

karmux commented May 6, 2017

Very useful functionality especially when using multi-monitor setup! 👍

I played a little bit with it and found some bugs:

  1. When detached instruments are maximized then all instruments stay maximized inside LMMS until LMMS runs. I think there shouldn't be maximize button and functionality for instrument windows at all.
  2. Mixer, project notes and controller rack can't be closed once detached. Clicking on X-button does nothing.
  3. Trying to close instrument when detached crashes LMMS every time.
  4. Detaching any window and then clicking minimize freezes this window inside LMMS main window and the subwindow border icons/labels don't look correct. Expected functionality is to minimize detached window same way like main window.
  5. Detaching any window and then clicking maximize maximizes it inside LMMS main window and scrolling main window too much to the right. Expected functionality is to maximize detached window same way like main window.

LMMS 1.2.0-rc2.153
(Linux x86_64, Qt 5.7.1, GCC 6.3.0 20170406)

@lukas-w
Copy link
Member Author

lukas-w commented May 6, 2017

@karmux Thanks for testing! I'll have a look at the issues you pointed out as soon as I find the time. I already noticed number 2 (X-button doesn't work), but couldn't find the cause.

@Umcaruje Umcaruje added this to the 1.3.0 milestone May 7, 2017
@aerobinsonIV
Copy link
Contributor

This is super useful!!

I can't seem to make a windows build of it though. The build seems to go without a hitch, but when I open the app, it doesn't have the detach button. This might be my own error, but maybe someone else should look into it.

I can confirm all the issues that @karmux pointed out. Also, getting the detached window back into lmms is a little unwieldy. I basically need to re-open the window (for exmaple, clicking the FX-Mixer button to re-attach the FX-Mixer). Not exactly a bug, but it would be useful if the minimize button reattached the window, or if there was another button entirely.

Good job, looking forward to be able to use this for major producing :)

@NickAcPT
Copy link

NickAcPT commented Oct 9, 2017

Sorry for the bump.
@Jousboxx I agree with you when you gave the idea to make the minimize button reattach the window into LMMS.
But, if they were going to add a button inside the window to attach it back, they would need to adjust the window's content to account for the button.
Also, if you were talking about adding a button to the title bar, that would be a bit complicated and hard to maintain.

PS: Sorry to bother...

@aerobinsonIV
Copy link
Contributor

@NickAcPT Yeah, my idea is that since the minimize button reattaches, they wouldn't have to add another button. The minimize button on the main LMMS window should probably shrink all child windows so there is a way to minimize them.

@PhysSong PhysSong mentioned this pull request Mar 12, 2018
@PhysSong
Copy link
Member

This uses some Qt5-only features, so it's best to wait with merging this until we've switched

Now we've, so I think we can continue working on this.

When detached instruments are maximized then all instruments stay maximized inside LMMS until LMMS runs. I think there shouldn't be maximize button and functionality for instrument windows at all.

It's already fixed.

Mixer, project notes and controller rack can't be closed once detached. Clicking on X-button does nothing.

Trying to close instrument when detached crashes LMMS every time.

vstSubWin, ControllerDialog, EffectControlDialog, FxMixerView, SongEditor(this is fine because SongEditorWindow doesn't), ControllerRackView, ProjectNotes and IntrumentTrackWindow class overrides closeEvent and ignores close event. See #1495 (comment) for why we have such workarounds.

Detaching any window and then clicking minimize freezes this window inside LMMS main window and the subwindow border icons/labels don't look correct. Expected functionality is to minimize detached window same way like main window.

Detaching any window and then clicking maximize maximizes it inside LMMS main window and scrolling main window too much to the right. Expected functionality is to maximize detached window same way like main window.

I guess the event is propagated to SubWindow in some way. Installing an event filter which blocks propagation seems to fix it.

@PhysSong
Copy link
Member

PhysSong commented May 23, 2018

Found some more issues:

  • Window size is not preserved when using some window manager on X11(compiz on Ubuntu 18.04, unity session in my case). There's a known issue with frameGeometry on X11 so I'm not sure if we can work around this when attaching. It's from the difference between widget's size and subwindow's size.
  • When switching instrument, detached windows get attached automatically.

@PhysSong
Copy link
Member

if the minimize button reattached the window, or if there was another button entirely.

If the minimize button is used for attaching, wouldn't it be confusing? Also, I can't find platform-independent way to add such a button to the title bar unless we create a custom window class which would be quite difficult. There's an easier workaround, wrapping window content and window controls in a layout. It might be a little bit ugly, but it's easy.

@lukas-w may I continue this work?

@lukas-w
Copy link
Member Author

lukas-w commented May 24, 2018

@lukas-w may I continue this work?

Go for it. 👍

@PhysSong
Copy link
Member

Fixed almost all bugs reported by @karmux. As a side effects, minimize button doesn't re-attach windows anymore. I can restore the behavior, but I think that might be confusing.
Bugs in #3532 (comment) still needs to be fixed.

@karmux
Copy link
Contributor

karmux commented Jun 17, 2018

@PhysSong thank you! During a quick test I couldn't reproduce any of my previously reported bugs.
While testing I discovered now that I can't close sample track instrument in detached mode. Maybe happens because I have #3866 merged.

@PhysSong
Copy link
Member

Maybe happens because I have #3866 merged.

I think that's correct. IIRC I copied some code from instrument track and it had some issue(fixed in this PR).
When/If that one is merged, I will add a fix.

@lukas-w
Copy link
Member Author

lukas-w commented Jun 17, 2018

As a side effects, minimize button doesn't re-attach windows anymore.

It never did. This was just suggested by @Jousboxx in #3532 (comment).

@pwepwe973
Copy link

hello,
how to enable this option please?
thank you

@PhysSong
Copy link
Member

PhysSong commented Oct 9, 2018

@pwepwe973 This feature is in development and not a part of released versions. Sorry.

@pwepwe973
Copy link

thank you

@pwepwe973 This feature is in development and not a part of released versions. Sorry.

thank you for your message

@winniehell
Copy link
Contributor

@PhysSong Can you please summarize the current state of this? Is it ready to be merged?

I'm willing to help get this finished if possible.

@PhysSong
Copy link
Member

PhysSong commented Nov 7, 2019

@PhysSong Can you please summarize the current state of this?

I unintentionally abandoned this one, but I can restart working on this.

Is it ready to be merged?

Not yet, mainly due to #3532 (comment).

@pwepwe973
Copy link

hello,

why not integrate this option in the new versions ?? for people with 2 screens

@PhysSong PhysSong marked this pull request as draft January 31, 2022 02:38
@tresf tresf mentioned this pull request May 22, 2022
@Rossmaxx
Copy link
Contributor

Rossmaxx commented Jun 14, 2022

What's the status as of now? How about a rebase and bugfixes.

@pwepwe973
Copy link

I have never changed version since I kept this version with the detachment of the windows because I use the others on 2 screens, even if there are new things but I am not interested in WHAT INTERESTS ME IS TO BE ABLE TO WORK in a practical way with the 2 screens

@luzpaz
Copy link
Contributor

luzpaz commented Sep 24, 2023

What's blocking the rebase ?

@Rossmaxx
Copy link
Contributor

merge conflicts maybe, and the fact that the author hasn't been here in a long time.

@messmerd
Copy link
Member

@PhysSong Are you still working on this? If not, I can try getting it to a state where it's ready to merge.

@PhysSong
Copy link
Member

@PhysSong Are you still working on this? If not, I can try getting it to a state where it's ready to merge.

@messmerd No, please feel free to take over.

@messmerd messmerd removed the after-refactor PRs that will need to be rebased after the planned code refactor (#5592) label Nov 19, 2023
@messmerd
Copy link
Member

I fixed the bug that prevented detached editor windows (Song Editor, Piano Roll, etc.) from closing when "X" is clicked.

These are the known bugs that still remain:

  • Detached microtuner config window doesn't close when "X" is clicked
  • When switching instruments, detached windows get attached automatically
  • The LMMS taskbar icon changes to the icon for the most recently detached window
  • Some detached windows look really bad when maximized, so they should be prevented from maximizing if possible
  • The "Add" button in the Controller Rack is not visible at first when attached

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

Successfully merging this pull request may close these issues.

Multiple Monitors