dotnet / dotnet/winforms

ContextMenuStrip not opening when moving window on secondary display

Open
#4,084 6 comments 0 reactions 0 assignees View on GitHub
:beetle: bug area-controls-StripControls area-HDPI help wanted
Dominant language
C#
Stars
4.9k
Forks
1.1k
Avg merge
20h 23m
Merged PRs (30d)
103

Description

* .NET Core Version: 3.1

* Have you experienced this same bug with .NET Framework?: Haven't tried. I need to use .NET Core

**Problem description:**
Given
- a `WPF` app
- that uses the `WinForms` `ContextMenuStrip`
- in a `dual monitor` setup
- when moving the MainWindow to the `secondary monitor`
- the context menu does not display at all

**Expected behavior:**
The context menu is displayed

**Minimal repro:**
Repo: https://github.com/ccornici/tray_context_menu_bug

Demo (contained in the repo too)
![ctx_bug](https://user-images.githubusercontent.com/15718751/95679730-13058300-0bd5-11eb-8bd7-c65f301b1dbc.gif)

Other details:
- All other tray icons from other apps (ex: Spotify, NVidia Control Panel etc) work as expected. So it doesn't look like a WIn 10 bug that affects any and all tray icons.
- **The `Opening` event of the `ContextMenuStrip` gets fired. It simply doesn't display the context menu...**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.