Skip to content

Need to press spacebar twice #1483

Closed
Closed

Description

@Sebbe909

Please search within existing issues before the submission. Has this issue already been reported?
Not that I'm aware of

Describe the bug
Since some while now, for more than a year, you sometimes need to press/tap the spacebar twice before the preview window is opened up. Sometimes it opens up after one press. But sometimes it requires two presses. I couldn't find any relation to file format.

To Reproduce
Steps to reproduce the behavior:

  1. Select file
  2. Press spacebar
  3. Sometimes nothing happens

Expected behavior
The preview window should show up after pressing spacebar once.

Desktop (please complete the following information):

  • OS Version: Windows 11 24H2
  • QuickLook Version: 3.7.3

Activity

  1. xupefei commented on Oct 31, 2024

    @xupefei
    Member

    Maybe since c107732?
    Tldr: press and hold Space will briefly show the preview window until the key is released.
    The trigger threshold is 0.75 seconds. Are you pressing the key for a time longer than that?

  2. Sebbe909 commented on Nov 1, 2024

    @Sebbe909
    Author

    I believe it happened more recently than 2021. But I also never "long press" the space, so it can't be that. Now I think about it, I believe this began around the time Explorer got tabs. You've never experienced this yourself? I first thought it maybe was my older PC. But I've just got a brand new one, and the same issue exists.

    Could it possibly be that I'm pressing space too quickly after selecting a file/folder? I tend to work quite fast. Also note that I have the details pane enabled in explorer. I haven't dug into the QL code, but maybe it could be related to QL needing to process stuff before it's able to detect an action?

    Still weird though that/as the issue didn't occur in the past, so I'm just thinking out loud here.

  3. rabelux commented on Nov 2, 2024

    @rabelux
    Member

    I'm also having this issue regularly on Win 10 and my impression so far is, that the first trigger after system startup or a long time not using QL does not open a preview window. To me it looks like some caches first need to be filled and then it works.

  4. Sebbe909 commented on Dec 18, 2024

    @Sebbe909
    Author

    @xupefei any chance to look into this or maybe have an update? :)

  5. mooflu commented on Feb 20, 2025

    @mooflu
    Contributor

    I'm also having this issue regularly on Win 10 and my impression so far is, that the first trigger after system startup or a long time not using QL does not open a preview window. To me it looks like some caches first need to be filled and then it works.

    I'm on Win11 and I see this, too. Though maybe not the same as it does open a preview eventually after 5-6 secs. I.e. no need to press space again.

    I can repro pretty reliably after computer comes out of sleep, the first preview takes 5-6sec after pressing space bar. During the 5-6secs the screen freezes (mouse can still move) and can't interact with anything. Which makes it a pain to diagnose...

    Tried with an older release and happens there, too.
    Tried killing explorer and open QL preview via a dialog - same thing.
    Tried disabling real-time protection temporarily - same thing.
    Tried with network cable disconnected - same thing.
    When running in debugger and recording cpu profile most cpu is in system calls (ntdll.dll).

    #1526 and #1521 sound similar, too.

  6. mooflu commented on Feb 21, 2025

    @mooflu
    Contributor

    Ran with Windows Performance Recorder and looks like a bulk of the time is spent in the nvidia driver and it seems to be stalling

    ...
    nvlddmkm.sys!<PDB not found>
    ntoskrnl.exe!KeStallExecutionProcessor
    ntoskrnl.exe!HalpTimerStallExecutionProcessor
    

    That's with driver version 560.94

    Upgraded to 572.47 - no change.

    Tried an older version from around Aug 2023 - 536.99 and I can no longer reproduce.

  7. emako commented on May 10, 2025

    @emako
    Member

    Just Mark to myself:

    ========2025/5/10 19:29:46========
    System.InvalidOperationException: Cannot set Visibility or call Show, ShowDialog, or WindowInteropHelper.EnsureHandle after a Window has closed.
       at System.Windows.Window.VerifyCanShow()
       at System.Windows.Window.CreateSourceWindow(Boolean duringShow)
       at System.Windows.Interop.WindowInteropHelper.EnsureHandle()
       at QuickLook.Common.Helpers.DisplayDeviceHelper.GetMonitorColorProfileFromWindow(Window window) in D:\GitHub\QuickLook\QuickLook.Common\Helpers\DisplayDeviceHelper.cs:line 75
       at QuickLook.ViewerWindow.BeginShow(IViewer matchedPlugin, String path, Action`2 exceptionHandler) in D:\GitHub\QuickLook\QuickLook\ViewerWindow.Actions.cs:line 177
       at QuickLook.ViewWindowManager.BeginShowNewWindow(String path, IViewer matchedPlugin) in D:\GitHub\QuickLook\QuickLook\ViewWindowManager.cs:line 195
       at QuickLook.ViewWindowManager.InvokePreview(String path) in D:\GitHub\QuickLook\QuickLook\ViewWindowManager.cs:line 164
       at QuickLook.ViewWindowManager.InvokePreviewWithOption(String path, String option) in D:\GitHub\QuickLook\QuickLook\ViewWindowManager.cs:line 130
       at QuickLook.ViewWindowManager.TogglePreview(String path, String option) in D:\GitHub\QuickLook\QuickLook\ViewWindowManager.cs:line 84
       at QuickLook.PipeServerManager.<>c__DisplayClass7_0.<MessageReceived>b__3() in D:\GitHub\QuickLook\QuickLook\PipeServerManager.cs:line 148
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
       at System.Windows.Threading.DispatcherOperation.InvokeImpl()
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Windows.Threading.DispatcherOperation.Invoke()
       at System.Windows.Threading.Dispatcher.ProcessQueue()
       at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
       at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
       at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
       at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
       at System.Windows.Application.RunDispatcher(Object ignore)
       at System.Windows.Application.RunInternal(Window window)
       at QuickLook.App.Main()
    
    

    Maybe something is wrong from this exception.

  8. added a commit that references this issue on Apr 22, 2026
  9. emako commented on Apr 22, 2026

    @emako
    Member

    Done in preview version.

    The fix prevents the first Space keydown from being locked out before it is actually handled, so subsequent Space presses are no longer discarded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions