wpf: Popup's placement propery is wrong
- .NET Core Version: 3.0, 3.1, 5.0
- Windows version: (
winver
) 20H2 (19042.985) - Does the bug reproduce also in WPF for .NET Framework 4.8?: Yes
**Problem description: Popups in WPF show’s in wrong place, when set to left the popup shows at right, set to right shows at left, set to up shows at top-right (which should shows at top-left) and set to bottom shows at bottom-right (which should shows at bottom-left).
Actual behavior:
Expected behavior:
Minimal repro:
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 22 (10 by maintainers)
As far as I know the popup open direction depends on whether the PC is set to left handed or right handed. For a long time there was a link in the control panel called Tablet PC Settings for setting this option, but it was removed in some Windows 10 update for an unknown reason. You can still open the dialog by using the run dialog (Win + R) and entering
shell:::{80F3F1D5-FECA-45F3-BC32-752C152E456E}
. You can find the option in the second tab there.By the way not all applications or frameworks honor this option.
@yanshouwang I guess the idea behind this is, that if you have a touch display and open a popup with the index finger of your right hand, then it should open to the left, else the popup would open right beneath your right hand and so it would be covered and you would need to move your hand before you can see the popup content. And vice versa with the left hand.
This means if you want the “normal” popup open direction, you need to choose the left handed setting here. As far as I can tell the right handed option is only set by default for PCs that have a touch display or a stylus display. That’s why this behavior does not occur on every PC. (or it might depend on vendor setup)
I would also support the
Popup.GetPointCombination
to use dynamic resource withMenuDropAlignmentKey
rather than directlySystemParameters.MenuDropAlignment
. That way, you could override the value in your resource dictionary.@lindexi A year later passed and this issue still make some developers confused, I think this is not a good design and should be changed by what device we are using, this setting seems is synced between PC and tablet?
This is a per-user setting, see #5944. It gets activated only when you connect specific class of devices, e.g. pens or old touch digitizers.
@lindexi I cannot support your workaround this time since it on purpose ignores user’s wishes, creating inconsistency with other apps. (Yes I know the default behavior is confusing and annoying)