WindowChrome can fail to render properly with multi-monitors

WPF Studio, Themes, and Shared Library for WPF Forum

Posted 1 year ago by Chien A.
Version: 17.2.0663
Environment: Windows 10 (64-bit)
Avatar

Note: This is with a preview 663 build, but pretty sure the problem is present in normal latest build as well.

When you are using a second monitor (+ maybe the resolution needs to be larger than main monitor, similar to many notebook with external monitor setups) then opening a WindowChrome'd window in maximised state causes rendering problems when the Window is then unmaximised (in 'normal' state).

Usually, this results in a portion of the top and left side of the window not rendering and remaining transparent (don't know if this depends on secondary monitor location or not), and in severe cases can also cause large portions of the client area to not render and be transparent as well. This is a big problem when the Window in question is the main Window!

Simplest way to reproduce this is to create new project, add the WindowChrome, and change the Window's WIndowState to Maximized. Once it runs, unmaximise and note the border rendering issues. This persists for the entire session.

If the instead the Window is changed to open in normal state, or if no external monitor is present, then all is fine.

There is also an additional bug in that during initialisation/load, if the window is moved to the secondary monitor and then maximised, it instead opens maximised on the main monitor.

I can provide a project demonstrating this, but discovered that the above was all that was needed to trigger the issue.

[Modified 1 year ago]

Comments (3)

Posted 1 year ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

Thanks for reporting this.  We're unable to track down what is causing the border/content layout scenario to occur but I believe we added a workaround that at least fixes it.  This will be in the next build.  I haven't seen the transparent issue you described happening, but perhaps the fix for the border/content layout would fix it?  Please write our support address if you'd like to try a preview build with the fix so you can test it on your end.

I'm not able to reproduce the other issue you mentioned where it maximizes on the wrong monitor.  Please supply some code that makes that occur.


Actipro Software Support

Posted 1 year ago by Chien A.
Avatar

The more serious client area transparency issue was only encountered by one of our devs so far (but consistently for them) so it's possibly system, and/or even layout specific, as our application saves and loads both main window and toolwindow layouts on open.

It does seem that 1 and 2 or even all 3 issues might be linked, however I was able to reproduce 3 myself quite easily, will send the demo project via email.

Like our application, the demo saves both main window and toolwindow layouts on close, and reloads them on open. Simply launch it, move the window to the secondary monitor, and maximise, then close and rerun. It will open maximised on the primary monitor instead of secondary, and if you unmaximise it it will then jump correctly back to saved location on the secondary monitor : ).

Note: by default it lauches maximised, so will already be affected by 1st issue on the first open - just unmaximise and reopen.

[Modified 1 year ago]

Posted 1 year ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

For the transparency issue, I didn't see it happen with the steps you mentioned.  But it sounds like something that could also be possibly related to needing a display card driver update.  Occasionally in the past we've seen cases where updating display card drivers fixes WPF rendering glitches.

For the other issue with the main window opening as maximized on the wrong monitor, I am seeing that with your steps.  I believe we might have run into that before in Docking/MDI with maximized floating windows, and it's definitely a bug in core WPF.  It happens even if you aren't using our WindowChrome or anything from us. 

Here's a MSDN post with a workaround:

https://social.msdn.microsoft.com/Forums/vstudio/en-US/2ca2fab6-b349-4c08-915f-373c71bd636a/show-and-maximize-wpf-window-on-a-specific-screen?forum=wpf

As a quick test, when I moved your LoadVisualSettings() method to OnSourceInitialized instead of in the constructor, it opened maximized on the second monitor.


Actipro Software Support

The latest build of this product (v2018.1 build 0675) was released 14 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.