mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Native context menu: wait before querying the menu
This commit is contained in:
parent
58e4285953
commit
2e2c1742b0
1 changed files with 5 additions and 0 deletions
|
|
@ -4,6 +4,7 @@ using System.IO;
|
|||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Windows;
|
||||
using System.Windows.Interop;
|
||||
using System.Windows.Media;
|
||||
|
|
@ -275,6 +276,10 @@ public static class ShellContextMenuDisplayHelper
|
|||
|
||||
contextMenu = (IContextMenu)Marshal.GetTypedObjectForIUnknown(pContextMenu, typeof(IContextMenu));
|
||||
|
||||
// Without waiting, some items, such as "Send to > Documents", don't always appear, which shifts item ids
|
||||
// even though it shouldn't. Please replace this if you find a better way to fix this bug.
|
||||
Thread.Sleep(200);
|
||||
|
||||
hMenu = CreatePopupMenu();
|
||||
contextMenu.QueryContextMenu(hMenu, 0, ContextMenuStartId, ContextMenuEndId, (uint)ContextMenuFlags.Explore);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue