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

Window maximizing doesn't work when AllowsTransparency set to true #2483

Closed
RayMeOut opened this issue Apr 24, 2016 · 10 comments
Closed

Window maximizing doesn't work when AllowsTransparency set to true #2483

RayMeOut opened this issue Apr 24, 2016 · 10 comments

Comments

@RayMeOut
Copy link

I have experienced a bit a weird behavior of the MahApps Window when I set the AllowsTransparency to true. What I am doing is to set the Opacity of the whole window to 0.4 when the mouse leaves the window. When the mouse returns to the window area, the opacity is set back to a value of 1.0.

This works fine unless I want to maximize the MahApps window. It doesn't maximize, but makes a weird blue rectangle around half of the screen, and the window remains the same size as before (The window is resizable... and without the AllowsTransparency(in code, after InitializeComponent) everything works fine).

See a short clip on giphy

What steps will reproduce this issue?

When I start the application and maximize the window immediately, the window changes it's position to (0,0) but doesn't resize to full size (screen size). It just remains the same size as before.
If I pull the window to the right or the left side of the screen (like WIN+Left/Right) first, and then try to maximize, I get the result visible in the clip above.

This only happens, when I set AllowsTransparency in code after initializing. When I set it in the xaml, the window does not use transparency but a semi-black overlay.

I there any way to get this working? If more information are needed, just ask ;)

Thank you in advance.
RayMeOut

Environment

  • MahApps.Metro v1.2.4
  • Windows 8.1
  • Visual Studio 2013 Professional
  • .NET Framework 4.5

PS: I've already asked this question (link), but I thought, I belongs to this site.

@punker76
Copy link
Member

@RayMeOut I tested this out with the latest source and can't reproduce this. So, please take the latest pre-release via NuGet, maybe this is fixed for you, thx!

2016-04-25 10h17_21

@RayMeOut
Copy link
Author

Hey @punker76
Thank you for your response. I've tried your suggestion and installed 1.3.0-ALPHA (136), but the behavior is still there... :/ I've also tried a new project but the result was the same.
But this miss-displaying only appears when i try to maximize the window, not when only using half of the screen (Did you try that as well to reproduce?).
And the new project i created only contains this AllowsTransparencyset to True and nothing else. So it shouldn't be affected by other parts of the code :/

@punker76
Copy link
Member

@RayMeOut Is you Win 8.1 running inside a VM? or normal PC? Do you have a chance to test it on a different os?

@RayMeOut
Copy link
Author

@punker76 My Win is running normal on a pc (not inside a vm). I've startet the .exe on another computer (but also Win 8.1) and there was the same "error"

@punker76
Copy link
Member

@RayMeOut ok, thx. seems like a Win8.1 issue :-(

@RayMeOut
Copy link
Author

@punker76 ok, I will try this on a Win10 pc, but I need to wait until this evening, because I cannot access my code at my workplace. And neither I have VS.

@RayMeOut
Copy link
Author

Hey @punker76, I tried the application on another PC with Win10 running and it was working without problems. You were right, it is at least a Win8.1 issue... :/ (But only with MahApps, a "normal" app with the default window was working normal) :/ Would it be possible to get this working in the (near) future (next releases)? Would be glad to use this feature also on Win8.1... :) Thanks and regards
RayMeOut

@NickHarmer
Copy link

Has there been any further movement on this issue? I've had to a code huge number of window-subclassing workarounds to make this work as it should, and every time Micro$oft release an update it breaks and I have to rewrite it!

It is definitely NOT just a windows 8/8.1 problem - it occurs on machines running Windows 10 (original and anniversary) as well. I have just built a new test project based off MahApps 1.3.0 and the bug is still present, even with no other code except AllowTransparency=true after the InitializeComponent() call.

The issue does NOT occur when using Aero Snap to pin a window to the left-hand or right-hand side, but DOES occur when dragging a window to the top of the screen, or when using the maximize button or menu item, or when maximizing programmatically in code-behind. It also occurs on both single and multi-monitor systems (all screens).

Is there any likelihood that this issue will be fixed in 1.4.0, or is it already fixed in a 1.3 alpha which I could test against?

@RayMeOut
Copy link
Author

I've just tested my code with the newest alpha (1.4.0) and still get the same behavior.
But I'm "glad" to hear, that I'm not the only one with this problem

I avoided this problem by not using AllowTransparency (that's the reason, that I do not have further information to this topic)... But I know that this is not a solution and I really wanted to use this feature

@punker76
Copy link
Member

@RayMeOut @NickHarmer

MahApps sets the AllowTransparency property is to false, cause true has some nasty bugs, e.g. like your issue.

It breaks also the TextBox ClearType and sometimes UI Performance is bad.

-> #1537
-> #1536

@punker76 punker76 closed this as completed Oct 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants