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

The option to disable immersive menus does not disable them in File Explorer #96

Closed
Anix-x opened this issue Oct 15, 2021 · 13 comments
Closed
Labels
enhancement New feature or request fixed

Comments

@Anix-x
Copy link

Anix-x commented Oct 15, 2021

Without the option to disable immersive menus on we have the default Windows 11 menus:
image
If we enable the option that claims to disable the immersive menus, we get the usual immersive menues, introduced in Windows 10, and known as such. They do not fit with the Windows theme and font settings, do not support subpixel hinting, and not compatible with Windows Classic theme:
immersivemenu
Now, if we install ExplorerContextMenuTweaker, we get the non-immersive menus, that fully fit with the current theme and can be used without theming (e.g., under "Classic" theme). They use subpixel hinting and ClearType:
non-immersive
And this is the same non-immersive menu when not themed:
classic

@valinet
Copy link
Owner

valinet commented Oct 15, 2021

Okay, so I ask again, what is the proposal?

@Anix-x
Copy link
Author

Anix-x commented Oct 15, 2021

Possibly, to change the wording to less confusing, such as "Disable Windows 11-style menus" or "Enable Windows 10-style menus" or "Enable full/complete menus".

@Anix-x
Copy link
Author

Anix-x commented Oct 15, 2021

The best solution, of course, would be the real option to disable immersive menus.

@valinet
Copy link
Owner

valinet commented Oct 15, 2021

I don't think it is that confusing, but the reasons are valid, the proposed solution is okay, I will change the wording to "Disable the Windows 11 context menu".

The problem with ExplorerContextMenuTweaker is that it is not documented at all... it is very hard to pick off where they left off; plus, isn't there any other easier solution...? I think the core of the problem is that before displaying the menu, it calls 2 functions which set it up for owner drawing, and that uses theming, and because theming is not available when you enable the classic theme, the calculations fail and return 0 widths and heights and that's why you see nothing in the menu...

Anyway, I am thinking of a different approach, at least in File Explorer, but first of all, how do I differentiate between the immersive menus and the classic ones without enabling the classic theme? They look identical when using the default theme. Also, I think they do it in order to enable theming support.

And also, I don't think the immersive menu is that broken as to not support subpixel hinting and ClearType. I use a high DPI display at it looks fine, does not seem like it is not using ClearType...

@Anix-x
Copy link
Author

Anix-x commented Oct 15, 2021

The Immersive menu as well as the Win11 menu both use the greyscale antialiasing and do not respect the systemwide font settings (the font size is greater than system default).
This, in particular, shows, that implementing non-immersive menus is beneficial not only to users of Classic theme.

As to how to tell apart immersive menu from non-immersive themed, look at

  • Font (immersive uses greyscale hinting and bigger font)
  • The ">" characters indicating submenus (they are bigger)
  • When the bit 17 in User Preference Mask is unset, there is a difference in the border (see the pictures above).
  • The length of separators are different as you can see on the pictures above in Win11 theme.
    On Windows 10 the difference was much greater, but on Win11 they "themed up" the immersive menus a bit to better match the system theme.

@valinet
Copy link
Owner

valinet commented Oct 15, 2021

So, this is it, right?

image

I managed to revert it back in File Explorer windows. It was indeed as I supposed, they just call the copy-pasted in a million places ImmersiveContextMenuHelper::ApplyOwnerDrawToMenu function before calling TrackPopupMenu (or TrackPopupMenuEx in other cases).

For this to work in Open/Save file dialogs, a little more work is required - somehow the patcher has to inject there as well. I will implement this when I will add the functionality to use Everything instead of Windows Search in File Explorer's search box. When doing that, I will implement a search box COM component, so I will get hooked into every Open/Save file dialog and will also take care of the menus, since I am there anyway.

For the moment though, this should suffice.

@Anix-x
Copy link
Author

Anix-x commented Oct 15, 2021

On your picture the menus are in the Classic theme, non-immersive and UPM 17 is set :-)

@Anix-x
Copy link
Author

Anix-x commented Oct 15, 2021

Thank you very much, this is great!

@Anix-x
Copy link
Author

Anix-x commented Oct 15, 2021

What about the taskbar context menus? It has the same problem as File Explorer (the menus are immersive and empty in Classic theme), but currently there is a decent solution: TaskbarContextMenuTweaker by the same author as ExplorerContextMenuTweaker.
Will your fix work the same way for the taskbar as for File Explorer? Then there would be no need in these two programs.

@Anix-x
Copy link
Author

Anix-x commented Oct 15, 2021

By the way, if you have solid rectangle as an indicator of a submenu, this tells the menu is not immersive and not themed.

@valinet
Copy link
Owner

valinet commented Oct 15, 2021

What about the taskbar context menus? It has the same problem as File Explorer (the menus are immersive and empty in Classic theme), but currently there is a decent solution: TaskbarContextMenuTweaker by the same author as ExplorerContextMenuTweaker. Will your fix work the same way for the taskbar as for File Explorer? Then there would be no need in these two programs.

Yeah, it works, will be added as an option in the next release. I disabled owner drawing (immersive menu) for taskbar right click, system tray icons right click, clock right click, language right click, notification icon right click, show desktop right click, secondary taskbar right click, secondary clock right click, Win+X menu, plus in File Explorer windows.

@valinet valinet closed this as completed Oct 15, 2021
@Anix-x
Copy link
Author

Anix-x commented Oct 15, 2021

Thank you very much! Please take a note that the settings window already hardly fits the screen on some laptops, so if you are to add more options, consider splitting the list in two columns or making it denser.

@valinet
Copy link
Owner

valinet commented Oct 15, 2021

Thank you very much! Please take a note that the settings window already hardly fits the screen on some laptops, so if you are to add more options, consider splitting the list in two columns or making it denser.

Yeah, one step ahead, I've already implemented that ;) not only did it hardly fit, it kept my development in place because I wanted to add some more option yet I did not have the required space.

@valinet valinet added enhancement New feature or request fixed labels Oct 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fixed
Projects
None yet
Development

No branches or pull requests

2 participants