GithubHelp home page GithubHelp logo

Comments (8)

angelsix avatar angelsix commented on July 20, 2024 1

Confirmed this is an issue. It is not the same behaviour as a normal window.

Repro environment

  • Primary monitor on left with 200% scaling in Display Settings
  • Secondary monitor on right with <200% scaling (175% for example)

Repro steps

  • Change MainWindow.xaml to WindowStyle="SingleBorderWindow" and AllowsTransparency="False"
  • Drag top left of window to the top right of the primary monitor, with over half the window into the second monitor and the window reduces in size due to DPI awareness, then let go to maximize.

The "maximized" ghosting appears on primary screen and it maximizes to the primary screen.

Revert back to the original WindowStyle="None" and AllowsTransparency="True" and repeat the steps. The window maximizes incorrectly to the secondary monitor.

Observational notes

We didn't change the WindowResizer, the reported max/min size of the window or any other message pumps, and just changing the window style resolved the issue.

My thoughts are it is either because of an internal bug in the .Net framework revolving around WindowStyle="None", or due to it having decoration around the window our reported min/max sizes make a difference, however I doubt that is the case.

It could also be we need to catch some other message pump details and override them.

Conclusion

For now this is a tricky one to fix. If anyone wants to look into it feel free, until then I will leave it as an open bug as it is a bug, and if I get time to dig deeper into the message pump to fix it I will

from fasetto-word.

angelsix avatar angelsix commented on July 20, 2024

I had and since fixed this bug I am sure. Are you using the latest code from master branch?

If so I will re-test on Monday

from fasetto-word.

angelsix avatar angelsix commented on July 20, 2024

Also regarding MonitorFromPoint function thats a good point thanks for the catch. I will apply that fix

from fasetto-word.

angelsix avatar angelsix commented on July 20, 2024

Fixed Win+Arrow key move if you want to verify that 272acf4

from fasetto-word.

angelsix avatar angelsix commented on July 20, 2024

I can't get a dual monitor setup until Monday to test, but can you also confirm, do normal WPF windows and Notepad on Windows act differently in the same situation? i.e. they maximize to the other window?

from fasetto-word.

dcm99 avatar dcm99 commented on July 20, 2024

I have your latest mater branch, just tested it on my Window 10 system, the window expand on the wrong screen. I have seen this behaviour only on WPF Windows with WindowStyle=None and AllowTransparency=True. A Window with border doesn´t do that.
The fixed "Win+Arrow Key move" works.

from fasetto-word.

angelsix avatar angelsix commented on July 20, 2024

Ok I will test monday but it sounds like you just want to change the size method to always use the MonitorFromWindow, never from mouse, then when you drag ot will be based on the window. If you test that before I can change the code to that, if not I will investigate monday.

from fasetto-word.

dcm99 avatar dcm99 commented on July 20, 2024

Hey do not invest much work in that if is not an issue for you. I just was looking into your code to find another aproach to handle the sizing after docking with aero snap. And it helped a lot, so thank you.

from fasetto-word.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.