Single window mode

Create issue
Issue #740 open
Jesse Johnson created an issue

I propose we add a toggle option which prevents more than one window from being opened. While enabled, when a user attempts to open a new window while the singleton window already is opened, the singleton window will be displayed instead of a new window.

Rationale: Many times while using speedcrunch I accidentally open many instances of it because I forgot I had previously opened it. On particularly busy/forgetful days this leads to 10+ SpeedCrunch windows cluttering my Alt-Tab. This is especially troublesome when I need a previous result and cannot remember which window I typed it in! Forcing the first window to be the only window would solve all this.

Minor issue: When using virtual desktops I sometimes may want multiple windows (one per desktop). It would be nice to enforce a one-per-desktop rule, but to keep things simple we probably could just stick with one vs. many windows as being a single toggle.

Comments (23)

  1. Oliver Gubler

    Just came here to request this option, because I have the same issue. Having many instances open really mixes up the history. As there might be use-cases where many instances are needed, I would vote for the toogle switch in the settings.

    Another approach to solve this problem would be to have the option to sync all open instances on a computer, so that whatever is entered in one instance also shows up in the history of all other instances. But this might be quite complicated to implement.

  2. Joshua Rendon

    I would also like this feature. This would give existing users who use single-instance mode as part of their workflow consistent functionality with previous versions. Personally, I bind my keyboard calculator key to launch speedcrunch. In previous versions instead of creating a new instance of speedcrunch hitting this key would bring the current instance of speedcrunch to focus. When I switched over to version 0.12, I expected the same behavior and instead opened around 20 instances of the program before I realized the behavior had been changed.

    For the time being, would a simple fix be to allow setting of the old single-window behavior via an entry in a configuration file?

  3. Derei

    In the meantime, I am using AutoHotkey to force single instance in Windows.

    *Notes:

    • change the Run path of speedcrunch accordingly to your needs
    • I modified keyboard key association so the Calc button on my keyboard will trigger SpeedCrunch

    ; Forces single instance for SpeedCrunch
    ; In case SpeedCrunch is open, it will bring it topmost, if is closed, it will open it
    
    #NoTrayIcon
    Launch_App2::
    IfWinExist SpeedCrunch
        {
            WinActivate
        }
        else
        {
            Run C:\Program Files (x86)\SpeedCrunch\speedcrunch.exe
            WinWait SpeedCrunch
            WinActivate
        }
    
  4. Samuel Gaist

    Note that I don't know why the state was changed since the pull request hasn't been merged yet.

  5. Tey'

    @sgaist "Resolved" state means a fix is available but some feedback are needed before closing the issue. This is the case actually, but we barely use this state in SC development, so it's better to keep the issue open until the PR is merged to master.

  6. Log in to comment