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

Allow placing Taskbar and MenuBar on secondary monitor #738

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

lostmsu
Copy link

@lostmsu lostmsu commented Oct 25, 2022

NOTE: I renamed IMenuBar.GetIsPrimaryDisplay to IMenuBar.GetIsMainMenuBar to better match semantic of the new behavior.

Did not make a descent UI for the new setting yet, for now can be tested by going into Advanced and setting the first Time format (which actually points to the new setting) to something like Pos=-700,800 (requires restart). which would then treat monitor at those coordinates as primary for the purpose of Taskbar and MenuBar placement. If there are no monitors at those coordinates, system primary monitor is used. To revert back, set the setting to Primary.

@dremin
Copy link
Collaborator

dremin commented Oct 29, 2022

Thanks!

While I understand setting primary taskbar could be beneficial, what does changing the primary menu bar enable (or do you have future ideas)? Also, for the settings interface, do you have a plan for making the setting intuitive?

@lostmsu
Copy link
Author

lostmsu commented Oct 29, 2022

@dremin re: menu bar, I imagine they'd go together most of the time (that's what I personally did locally) so at least a shared setting is useful, but it is also conceivable why one would want them on different screens.

Oh, I just realized you did not realize the setting is mostly for the scenario where taskbar and menu bar are not to be displayed on all displays. E.g. I have a big central monitor where I game, and I need the taskbar and menubar off it so that they are fully accessible when a game is running. Same for fullscreen videos. Many games don't have a way to select a monitor, and always display on the one Windows considers primary.

re: intuitive setting, I was thinking to have a selector that looks like the Windows displays layout window. e.g.
image

@lostmsu
Copy link
Author

lostmsu commented Nov 5, 2022

@dremin do you want me to make the UI before this goes in? I was planning individual PRs.

@dremin
Copy link
Collaborator

dremin commented Nov 6, 2022

I'm OK with the UI coming in a separate PR if the temporary UI is removed first.

@lostmsu lostmsu force-pushed the losttech/master branch 3 times, most recently from 5bfe393 to c337630 Compare November 6, 2022 17:42
@lostmsu
Copy link
Author

lostmsu commented Nov 6, 2022

@dremin I am curious if there's a reason no to use latest C# (10.0)?

@dremin
Copy link
Collaborator

dremin commented Nov 6, 2022

@dremin I am curious if there's a reason no to use latest C# (10.0)?

Cairo still targets .NET Framework 4.7.1, which I don't believe supports the latest C# versions.

@lostmsu
Copy link
Author

lostmsu commented Nov 6, 2022

@dremin language version has only a little to do with the target framework. As long as you don't need it to be buildable with old msbuild and compiler (which I believe it is not, as it is using .NET SDK project format), you can set <LangVersion>10</LangVersion>, and most features will be available (except the ones that require types missing in .NET 4.7.1).

@xoascf
Copy link

xoascf commented Nov 6, 2022

@dremin I am curious if there's a reason no to use latest C# (10.0)?

Cairo still targets .NET Framework 4.7.1, which I don't believe supports the latest C# versions.

I develop some applications targeting .NET 2.0/4.0, but I can still use most of the features of C# 10, there should be no issue by using LangVersion.

@dremin
Copy link
Collaborator

dremin commented Nov 6, 2022

In that case, feel free to enable the new version!

@lostmsu
Copy link
Author

lostmsu commented Nov 6, 2022

@dremin added UI, enabled C# 10, and slightly cleaned code up.

@lostmsu
Copy link
Author

lostmsu commented Nov 21, 2022

Do you think this pull request needs more work?

@dremin
Copy link
Collaborator

dremin commented Dec 5, 2022

Sorry it's taken me so long to get to this! Overall it looks good, but I ran into an issue: if the selected monitor is removed, the [menu bar/taskbar] is gone forever, even after the monitor is reconnected (of course, it works correctly when reconnecting the monitor before starting Cairo again). Ideally, the window would be re-opened on the primary display when the preferred one is removed, and back to the preferred once it is reconnected. The settings UI should also handle this other than showing no option selected (maybe a selected-but-inactive-looking state).

I also think we can make the UI a bit easier to understand:

  1. Rather than a distinct 'primary' option plus individual monitor options, the individual monitor option representing the primary display should be labeled as such, whether with text or a clear symbol. Selecting the primary display could still set the bespoke 'Primary' setting value.
  2. The 'Show [menu bar/taskbar] on multiple displays' option should probably be turned into a radio group with the following options:
Show [menu bar/taskbar] on: ( ) Multiple displays
                            ( ) This display:

I also think we can improve the appearance of the displays in the UI but that doesn't need to happen before merging this (and is something I'm happy to play with as well). One thing I'm concerned about is this has pushed the settings UI height to a size that is no longer possible to use properly on a 720p display.

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.

None yet

3 participants