-
Notifications
You must be signed in to change notification settings - Fork 808
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
Allow Maximizing Settings Window #2959
Conversation
ec6e850
to
c9a2d16
Compare
I'm provisionally not marking this as a draft because I don't know if doing so hides it from the main least, and my reason for posting it is that I do, in fact, need help figuring this out. |
It seems like the settings dialog is inherited from a
I've read through the issue and it seems like the people want the settings dialog to behave like a normal window. If this is really needed why not convert the settings dialog to a proper window? I guess a lot of the problems are then gone but maybe there was a good reason that it is just a dialog. I would say this also involves some design questions so input from @jancborchardt would be valuable. @er-vin @camilasan @allexzander What do you think about this? |
Adding the Again, the current place I'm at is that as far as I can tell the I've basically fixed the titular issue in #700; I just need help figuring out how to make the dock icon go away when the settings dialogue is inactive. (There needs to be a dock icon when the settings dialogue is active in order for there to be a default macOS menubar, which is necessary for the window to be able to be un-maximized.) I haven't built these changes on Linux or Windows, but I can't imagine them breaking anything. Worst case scenario, there might be an empty menubar, though Qt might be clever and hide it on Linux and Windows (whereas in macOS it just has the default menu with the name of the application). FWIW it might not be the end of the world to have, like, other (fully redundant) menubar menus, at least on macOS (where they are generally expected) but obviously that's beyond the scope of fixing #700. (GNOME and Windows both seem to be trying to phase menubars out, but I can't speak to KDE or any of the other shells.) |
As you can see in these two screenshots, the settings dialog takes up basically the entire screen on my MacBook: Being able to maximize the window on macOS would allow me to give it its own "workspace" and better integrate with the macOS window manager. (I use mostly full-screen windows on my MacBook.) The main case for maximizing the window (and setting it aside in its own workspace) is when there's a long sync going on, and I'd like to be able to Cmd-Tab or three-finger-swipe over to it to check on the progress from time to time. Without being able to maximize the window, yes, I can assign it to a second desktop, but it looks stupid filling the screen without actually being able to maximize. (Also note that the interface is squished when the window is zoomed—using the zoom button, which is the alternative to the maximize button—to less than a certain height. This is a Qt problem, as I ran into it with the Qt installer window, as well. It's also beyond the scope here, though, too.) |
030dc26
to
5728ce4
Compare
da9b1cc
to
7366ac4
Compare
It works! I was able to add code (wrapped in |
7366ac4
to
9eb52c2
Compare
2d7d8c7
to
7d145d0
Compare
FYI, this is working perfectly for me on macOS, but while I was able to resolve any overt build issues on Linux, the build didn't actually seem to work. I'm not sure if it's just me, though, or something with my code, since this was the first time I had tested a Linux build. |
662c5b3
to
86202df
Compare
Current status:
To Do:
|
It turns out I was running the Flatpak version of Nextcloud Desktop on my Linux computer. When I ran the build I was actually working on, it was able to maximize. (Somewhat strangely, it didn't respect the dark-mode skin, though.) Next up, I guess, is setting up a Windows VM. Also I'm not sure the best way to handle the overlap between this pull request and #2974. |
As soon as you have merged the current one, you're going to need to manually resolve conflicts between the master and the other PR. Just removing those classes you've added here from that other branch, and then reusing the ones from the current branch. I see no other way. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's overall going in a better direction now (although I still need things which need changing but let's deal with the broad strokes first then move on to more detailed points). Still I'm wondering something, don't you need this foreground/background mechanism for every type of dialogs? I'm thinking of the share dialog for instance.
Yes, it would make sense for Nextcloud Desktop to show a Dock icon whenever there is any sort of window on screen that doesn't disappear when it loses focus. I could change the scope of this pull request and fold in the foreground/background logic of other windowlets here, since the foreground/background logic is really the bulk of the changes here. The only remaining change to settingsdialog.cpp at this point is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Just need to cleanup history in the branch now.
9985047
to
856daa5
Compare
856daa5
to
ff861b1
Compare
This should be ready to merge, except that it suffers from the problem of not being easily able to exit fullscreen on macOS. The fix for this is #3014, so essentially we should wait for that to get merged first. (I'll try and get it done soon.) |
Signed-off-by: Elsie Hupp <[email protected]>
ff861b1
to
068ca41
Compare
AppImage file: Nextcloud-PR-2959-068ca4108fe777dd227689d4871f3361f8a930fb-x86_64.AppImage |
Hello @elsiehupp |
Hello, Thank you for your contribution to the Desktop Client with this pull request. We truly value your support and hope to see more contributions from you in the future! Best regards, |
Fixes #700.
I haven't tested this on Windows or Linux, but the main problem I'm facing is on macOS. What I've done so far is:
Qt::Window
tosettingsdialogue.cpp
, which allowed the window to be maximized.a. I removed
LSUIElement = True
fromInfo.plist
b. I converted the existing toolbar to a toolbar (rather than a menubar)
c. I added an empty menubar (which macOS could use to push the titlebar back on screen and allow the window to un-maximized).
This left Nextcloud Desktop with a dock icon when it is running. To get rid of it I tried adding the following to
cocoainitializer_mac.mm
:It didn't crash the application or anything, but neither did it have any effect. (Apparently setting
activationPolicy
is more or less equivalent to settingLSUIElement
orLSBackgroundOnly
.)It seems like what needs to happen to make the dock icon hidden would be to dynamically switch the application between being a Status Bar icon (no menubar or dock icon) and being a foreground application (both menubar and dock icon) when the settings window is open or closed, which involves something along the lines of the following:
The issue here is that
settingsdialog.cpp
is cross-platform and also C++ rather than Objective-C, so I wasn't able to add theAppKit
import at the top, and I imagine doing so might present issues when building the application for Windows or Linux.Does anybody know what would be a safe and feasible way of adding this code to the settings window? Thanks!