Skip to content

MDI forms lost sub control box #3029

Closed

Description

@RussKie
  • .NET Core Version:
  • Have you experienced this same bug with .NET Framework?:
    No

Problem description:

  • .NET 5 current master and Preview2
    image

  • .NET Core 3.1
    image

Expected behavior:

.NET 5 variant must look like .NET Core 3.1 variant.

Minimal repro:

Run a repro app provided in #2979

Activity

  1. added
    🪲 bug
    💥 regression-preview
    on Apr 2, 2020
  2. RussKie commented on Apr 2, 2020

    @RussKie
    ContributorAuthor

    Had two hours of "fun" bisecting, and it looks like we regressed back on 13 Nov 2019 in 07ae711 😱
    Somewhat surprised this went unnoticed for so long... @Vino-Wang looks like we have a gap.

    I still need to go through the diff (which is massive) to see what caused it.
    🤔 Not sure what to look for tbh, @JeremyKuhne @weltkante if you have any hints - they are appreciated.

  3. weltkante commented on Apr 2, 2020

    @weltkante
    Contributor

    I took a quick look over Form.cs and what stands out regarding MDI forms is the removal of the "merged menu". Might have slipped up and left a bool or other variable in the wrong default state when removing the code. I might be able to debug later today.

  4. weltkante commented on Apr 2, 2020

    @weltkante
    Contributor

    this line is probably the regression. Can't seem to link directly for some reason, probably because the commit is so large? Its line 6081 in the diff of Form.cs in the commit linked above, I commented on the line but you have to manually scroll there. Within UpdateMenuHandles method an interop call for WM_MDISETMENU occurred even if no deprecated HMENU was configured by the user. I believe removing this interop call leads to the regression, because when I'm on a working build and skip this line I get the behavior you observe on master.

    I think this can be fixed without reintroducing MainMenu and Menu classes, you just need to manufacture an appropriate HMENU directly via interop instead of using the WinForms convenience classes. Need to be careful to do proper cleanup though, to not introduce any leaks.

    PS: I reviewed the diff of Form.cs manually against the release/3.1 branch and I think this is the only line which was removed even though it was executed. Also I'm quite confused by the commit being a merge of remote/release/3.1 yet the changes within the commit aren't in release/3.1. Was this a commit that was rolled back in 3.1 ?

  5. added this to the 5.0 milestone on Apr 2, 2020
  6. merriemcgaw commented on Apr 2, 2020

    @merriemcgaw
    Contributor

    Great investigation @weltkante! Thanks a ton!

  7. modified the milestones: 5.0 Previews 1-4, 5.0 on Apr 20, 2020
  8. self-assigned this
    on Jun 9, 2020
  9. RussKie commented on Jun 16, 2020

    @RussKie
    ContributorAuthor

    I've started going through history again, and ran tests against 3.1.2, and it appears to be a regression all the way back to 3.1... So we'll need to service it.

  10. added
    priority-1
    on Jun 16, 2020
  11. modified the milestones: 5.0, 3.1.7 on Jun 16, 2020
  12. 33 remaining items

  13. RussKie commented on Jan 11, 2021

    @RussKie
    ContributorAuthor

    he GetNativeMenuItemImage forgets to set the size of the struct (previously done in the constructor when it was still a class). All others in this PR do have the size assignment, its the only call where its missing.

    Thank you, I started going mad at this point :)
    I confirm the fix.

  14. ghost removed
    🚧 work in progress
    on Jan 14, 2021
  15. added a commit that references this issue on Jan 14, 2021
    14c8cf5
  16. ghost added
    🚧 work in progress
    on Jan 14, 2021
  17. ghost removed
    🚧 work in progress
    on Jan 15, 2021
  18. Zheng-Li01 commented on Jan 22, 2021

    @Zheng-Li01
    Member

    Verified the issue with latest 6.0 SDK 6.0.100-preview.1.21071.29 that the issue has been fixed, the MDI forms show sub control box correctly. see below screenshot.
    3029

  19. Zheng-Li01 commented on Jan 26, 2021

    @Zheng-Li01
    Member

    Verified the issue with 5.0.103-servicing.21073.8 that the issue has been fixed, the MDI forms show sub control box correctly.

  20. removed this from the Future milestone on May 17, 2021
  21. added
    area-MDI
    on Dec 14, 2021
  22. ghost locked as resolved and limited conversation to collaborators on Feb 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

🪲 bug💥 regression-previewarea-MDI

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions