From 1293440512c354989d7c2da217b3fb07dd90f4e5 Mon Sep 17 00:00:00 2001 From: Bastian Schmidt Date: Sat, 25 Aug 2018 18:12:35 +0200 Subject: [PATCH] Only try to dismiss popup if next captured item is not a context menu #439 and #616 --- Fluent.Ribbon/Services/PopupService.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Fluent.Ribbon/Services/PopupService.cs b/Fluent.Ribbon/Services/PopupService.cs index b358fbdbe..cca543083 100644 --- a/Fluent.Ribbon/Services/PopupService.cs +++ b/Fluent.Ribbon/Services/PopupService.cs @@ -386,7 +386,11 @@ public static void OnContextMenuClosing(object sender, ContextMenuEventArgs e) { Debug.WriteLine("Context menu closing"); control.IsContextMenuOpened = false; - RaiseDismissPopupEvent(control, DismissPopupMode.MouseNotOver); + + if (Mouse.Captured is System.Windows.Controls.ContextMenu == false) + { + RaiseDismissPopupEvent(e.OriginalSource, DismissPopupMode.MouseNotOver); + } } }