Skip to main content

Module shell_tabs

Module shell_tabs 

Expand description

Tabs belong to the desktop, never to an application.

A Tilo app shows one thing: a page, a file, a conversation. Several of them side by side are several app instances, and the shell groups them as tabs of a window group (Workspace → Strip → WindowGroup → Tab). An app that wants “another one of these next to me” — a link opened in a new tab, Ctrl+T, a file opened beside the current one — asks the shell for it here instead of growing a tab strip of its own.

Requests are queued on the UI thread and the app runner hands them to the session shell over the app’s authenticated shell-ui connection, which knows the asking app and its tab. Outside a Tilo session there is no desktop tab model: the runner opens a new window of the same app instead (another process given the same target), so “beside me” still means “another instance”, never a tab inside this window.

The keyboard is the same everywhere: Ctrl+T, Ctrl+W and Ctrl+Shift+T (Cmd on macOS) reach these requests when the focused widget leaves the chord unhandled, so every app gets the desktop’s tab chords without implementing them.

Enums§

TabRequest
What an app may ask of the desktop’s tab model about itself.

Functions§

chord_request
The desktop tab chord a key press names, if any: Ctrl+T opens a new tab of this app, Ctrl+Shift+T reopens the last closed tab, Ctrl+W closes this tab. command is the platform’s command modifier (Ctrl, or Cmd on macOS); Alt and Super chords are never these.
close_this
Close this app’s tab the way the desktop closes any tab.
launch_instance
The record instance the shell launched this process for, which is how it finds this app’s own tab. None outside a shell launch.
open_beside
Ask the desktop for another instance of this app in a new tab right after this one, opening target (a URI) when given.
place_next_window_beside
Place the next window this app maps as a tab right after this one.
reopen_closed
Reopen the workspace’s most recently closed tab.
request
Queue the request chord_request named.
take_requests
Every request queued on this thread, oldest first.