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

Windows 11 breaking Development compatibility #6364

Closed
memoarfaa opened this issue Dec 18, 2021 · 6 comments
Closed

Windows 11 breaking Development compatibility #6364

memoarfaa opened this issue Dec 18, 2021 · 6 comments
Labels
area-MDI Multiple Document Interface issues os-windows11 waiting-for-testing The PR is awaiting manual testing by the primary team; no action is yet required from the author(s)

Comments

@memoarfaa
Copy link

memoarfaa commented Dec 18, 2021

  • .NET Core Version:
  • Have you experienced this same bug with .NET Framework?: Yes

Problem description:

  1. MDIParent Window that have Custom WM_NCPAINT Windows Message or its DWMNCRENDERINGPOLICY set to DWMNCRP_DISABLED will add then new Snap layouts in maximize button to Mdi Child Window (how a Child Window can layout all Desktop Windows and layout its parent in Desktop );

2021-12-18_14-47-33

  1. DwmExtendFrameIntoClientArea Wrong MARGINS

DwmExtendFrameIntoClientArea will Extend Frame to both Client and Non Client area

[DllImport("dwmapi.dll")]
public static extern int DwmExtendFrameIntoClientArea(IntPtr hWnd, ref MARGINS pMarInset);

   [StructLayout(LayoutKind.Sequential)]
        public struct MARGINS
        {
            internal int cxLeftWidth;

            internal int cxRightWidth;

            internal int cyTopHeight;

            internal int cyBottomHeight;

         
            public MARGINS(int cxLeftWidth, int cxRightWidth, int cyTopHeight, int cyBottomHeight) : this()
            {
                this.cxLeftWidth = cxRightWidth;
                this.cxRightWidth = cxRightWidth;
                this.cyTopHeight = cyTopHeight;
                this.cyBottomHeight = cyBottomHeight;
            }

           
        }
          MARGINS m = new MARGINS(8, 8, 31, 8);
            DwmExtendFrameIntoClientArea(Handle,ref m); 

windows 11
2021-12-18_15-39-35
Windows 10 and lower
2021-12-18_15-59-28

Expected behavior:

Minimal repro:

@merriemcgaw merriemcgaw added the area-MDI Multiple Document Interface issues label Feb 25, 2022
@merriemcgaw
Copy link
Member

We're unlikely to have any control over this particular scenario. These were changes directly to the Win32 API set. I'd be interested to know if this happens in an MFC app, and if so we should certainly file a feedback issue on the Windows team

@merriemcgaw
Copy link
Member

@Olina-Zhang if your team can test the MFC scenario that would be super helpful!

@RussKie RussKie added the waiting-for-testing The PR is awaiting manual testing by the primary team; no action is yet required from the author(s) label Feb 25, 2022
@John-Qiao
Copy link
Member

@memoarfaa could you please provide your sample project here?

@dreddy-work
Copy link
Member

@John-Qiao , it seems Windows fixed this issue in the latest builds. Can you try this issue again with latest windows 11 build?

@John-Qiao
Copy link
Member

@dreddy-work I tested it in my Win11 21H2 OS, and the issue1 is not reproduced in my result, please check below gif:
TestResult-6364

@dreddy-work
Copy link
Member

Thanks @John-Qiao for confirming. Closing as this is fixed in latest windows version.

@ghost ghost locked as resolved and limited conversation to collaborators Apr 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-MDI Multiple Document Interface issues os-windows11 waiting-for-testing The PR is awaiting manual testing by the primary team; no action is yet required from the author(s)
Projects
None yet
Development

No branches or pull requests

5 participants