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 Style goes wrong #3516

Closed
wunianqing opened this issue Jun 3, 2019 · 6 comments
Closed

Window Style goes wrong #3516

wunianqing opened this issue Jun 3, 2019 · 6 comments
Labels

Comments

@wunianqing
Copy link

Describe the bug
Original window style can be seen when switch window in Win7.

To Reproduce
Steps to reproduce the behavior:

  1. Open demo application. Notice the top-left corner and top-right corner of window.
  2. Open VS window.
  3. Switch between VS window and main window. Notice the style of VS window.
  4. See error
  5. Maximize and restore VS window. Switch between windows. Style won't change anymore.

Expected behavior
CornerRadius should be 0. And style of window should not change.

Screenshots
[Expected]
Expected
[Actual]
Actual
[Screen record]
record

Environment(please complete the following information):

  • MahApps.Metro version [latest code in develop branch]
  • OS: [Win7 SP1]
  • Visual Studio [dotenet core 3.0 preview 5]
  • .NET Framework [4.6]

Additional context
This only happen in some real machines. But it can be easy reproduced on virtual machine. And once you set Performance Options -> Visual Effects -> Adjust for best performance. This problem will no longer exist.

@wunianqing
Copy link
Author

I just found that version 1.6 and 1.6.1 are good.
I cannot compile the 1.6.2, 1.6.3 and 1.6.4.
And 1.6.5 is NG.

@punker76
Copy link
Member

punker76 commented Jun 3, 2019

@wunianqing This is related to the new/changed implementation of the borderless behavior in ControlzEx v4.0 alpha.

/cc @batzen I can reproduce this in a Win7 test VM, but didn't know how to solve this. (Another effect is while changing focus from Window to another Window is that the win 7 aero theme is shown for one second. I don't know if I want to fix this... 🙈 )

2019-06-03_12h50_42

mahapps_controlzex_win7

@batzen
Copy link
Collaborator

batzen commented Jun 3, 2019

@punker76 Could you move this issue to ControlzEx? Will have a look at this.

@punker76
Copy link
Member

punker76 commented Jun 3, 2019

@batzen Transfering issues is only allowed in the same organization level, so I will create a new one at ControlzEx and reference this one.

@punker76
Copy link
Member

punker76 commented Jun 3, 2019

ControlzEx/ControlzEx#80

@wunianqing
Copy link
Author

Thx. @punker76
I replaced the InitializeWindowChromeBehavior in MetroWinow.cs with the following code before issue is fixed. For now, it works fine. I don't know if this will cause other problems.

        private void InitializeWindowChromeBehavior()
        {
            WindowStyle = WindowStyle.None;
            WindowChrome.SetWindowChrome(this, new WindowChrome()
            {
                CaptionHeight = 0,
                CornerRadius = new CornerRadius(0.0),
                GlassFrameThickness = new Thickness(1),
                UseAeroCaptionButtons = false,
                NonClientFrameEdges = NonClientFrameEdges.None
            });
            //var behavior = new BorderlessWindowBehavior();
            //Interaction.GetBehaviors(this).Add(behavior);
        }

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

No branches or pull requests

3 participants