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

Maximized floating windows sit under the task bar. #208

Closed
Flynn1179 opened this issue Nov 2, 2020 · 8 comments · Fixed by #256
Closed

Maximized floating windows sit under the task bar. #208

Flynn1179 opened this issue Nov 2, 2020 · 8 comments · Fixed by #256

Comments

@Flynn1179
Copy link

Added a document pane with a scrollable document within it, and when it's floated and maximized, the horizontal scrollbar is now underneath the task bar, making it impossible to horizontally scroll with the mouse.

Position/Orientation of the task bar doesn't matter- if I temporarily move my task bar to the right of the screen, I can't vertically scroll the floating panel, and if I move it to the top, I can't see the title bar.

@Dirkster99
Copy link
Owner

hm, interesting bug, I am afraid I have no idea how to adjust a floating window (its a Win32 window) towards leaving the taskbar on display :-(

@mgnslndh
Copy link
Contributor

@Flynn1179 do you have a repository where this bug can be reproduced?

@Flynn1179
Copy link
Author

@mgnslndh Not a public one, but honestly there's no special circumstances required to reproduce. Just float any document pane and maximize it, you'll see it's area overlap the task bar.

@mgnslndh
Copy link
Contributor

mgnslndh commented Jan 4, 2021

Ok, this was easily reproduced as you explained. It seems this will also be a problem for me. If I find a solution I will post it here.

@mgnslndh
Copy link
Contributor

mgnslndh commented Jan 4, 2021

I'm doing a custom theme so I will add the MaxWidth and MaxHeight in a trigger for my floating window styles:

<Trigger Property="WindowState" Value="Maximized">
    <Setter TargetName="WindowBorder" Property="Padding" Value="3" />
    <Setter Property="MaxHeight" Value="{x:Static SystemParameters.MaximizedPrimaryScreenHeight}"/>
    <Setter Property="MaxWidth" Value="{x:Static SystemParameters.MaximizedPrimaryScreenWidth}"/>
</Trigger>

This does not work 100% and I guess if we want a more robust solution we need to provide more than styles. Multiple monitors and DPI (and perhaps the WindowChrome) needs to be taken into account.

@Dirkster99
Copy link
Owner

@mgnslndh Can you indicate where your style could be incorporated in the themes (eg Generic or VS2013) to apply this style? I am not sure whether I understand how this relates to maximized windows not floating over the Windows Task Bar?

@nickkitto
Copy link

I used mgnslndh solution, but had issues with multiple monitors. I tried hooking the windows WM_GETMINMAXINFO event and setting the max size, which worked assuming the application was mutli monitor DPI aware (and my legacy app was not).
A simple solution that worked for me was to set the WindowStyle to SingleBorderWindow for the LayoutDocumentFloatingWindowControl/LayoutAnchorableFloatingWindowControl style, which solved the issue and didn't appear different for me.

@Khaos66
Copy link
Contributor

Khaos66 commented Mar 19, 2021

Had a simmilar issue with another project once. Turned out that Windows handels the window size just fine as long as you don't set WindowStyle to None.
Here is a hint on WindowChrome that helped me MSDN

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

Successfully merging a pull request may close this issue.

5 participants