Skip to content

Commit

Permalink
Fixes #602 by removing several mouse captures and fixing dismiss mode
Browse files Browse the repository at this point in the history
  • Loading branch information
batzen committed Aug 5, 2018
1 parent c62c234 commit 79cff6a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
- [#581](../../issues/581) - StackOverflow Exception when trying to access ApplicationMenu while RibbonMenu is minimized
- [#586](../../issues/586) - BackstageTabItem IsEnabled=False still displays content
- [#587](../../issues/587) - DisplayMemberPath no longer working on DropDownButton/MenuItem as of version 6.0
- [#602](../../issues/602) - Pin button not clickable when Ribbon in collapsed state

- ### Enhancements
- [#516](../../issues/516) - Add options to hide the row containing RibbonTabItems
Expand Down
13 changes: 2 additions & 11 deletions Fluent.Ribbon/Services/PopupService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ namespace Fluent
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Input;
using System.Windows.Threading;
using Fluent.Extensions;
using Fluent.Internal;

Expand Down Expand Up @@ -193,7 +194,7 @@ public static void OnLostMouseCapture(object sender, MouseEventArgs e)
if (Mouse.Captured == null
|| IsAncestorOf(popup.Child, Mouse.Captured as DependencyObject) == false)
{
RaiseDismissPopupEvent(sender, DismissPopupMode.MouseNotOver);
RaiseDismissPopupEvent(sender, DismissPopupMode.Always);
}

return;
Expand Down Expand Up @@ -260,11 +261,6 @@ public static void OnDismissPopup(object sender, DismissPopupEventArgs e)

if (e.DismissMode == DismissPopupMode.Always)
{
if (Mouse.Captured == control)
{
Mouse.Capture(null);
}

control.IsDropDownOpen = false;
}
else if (control.IsDropDownOpen)
Expand All @@ -287,11 +283,6 @@ public static void OnDismissPopup(object sender, DismissPopupEventArgs e)

if (IsMousePhysicallyOver(control.DropDownPopup.Child) == false)
{
if (Mouse.Captured == control)
{
Mouse.Capture(null);
}

control.IsDropDownOpen = false;
}
else
Expand Down

0 comments on commit 79cff6a

Please sign in to comment.