Skip to content

[Q] How to deal with applications with multiple windows where no “main” window can be identified? #126

@yurikhan

Description

@yurikhan

The README section Window command mappings mentions a case when one has multiple windows belonging to a single application and wants only one instance of the program to be started. In the README, the solution offered is to set all windows of that application to have no command, then identify one “main” window by title and associate a command with it.

Consider Firefox with multiple top-level windows, with multiple tabs in each, and session saving enabled. No one of the windows is obviously “main”. Moreover, because each window houses multiple tabs and any one tab can be active when the session is restored, no one window can be reliably identified by title. The other criteria (class and instance) are identical for all Firefox windows.

Same goes for Emacs with multiple frames and desktop-save-mode configured to t.

Describe the solution you'd like

  • An explanation in the README how these cases could be handled, even if the proposed solution is “configure window_command_mappings to have no command for Firefox windows, and you’ll have to start Firefox yourself after restoring the layout”.

  • Maybe a general solution could be implemented along the lines of “if the layout contains any windows matching class/instance/title, start command once”.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions