Introducing a new way to review your PRs.

Read the announcement

ismaelmartinez / teams-for-linux

Unofficial Microsoft Teams for Linux client

View on GitHub

23 documents · Updated Nov 23, 2026

docs / desktop-integration-and-menus

Desktop menus, tray, and native controls

The desktop control layer gives Teams for Linux ways to act outside the main Teams page. It is one part of the broader platform services layer and combines application menus, profile switching, a system tray, keyboard shortcuts, and platform icons so users can open, hide, switch, refresh, or quit the app without relying only on the Teams window.

Application menu

The application menu is the main native command surface for the desktop app. It exposes window actions, meeting navigation, settings, notifications, help, optional video tools, profile actions, and quit behavior through Electron menu entries (app/…/appMenu.js• L4-101). The menu is attached to the main window according to the configured menubar mode, while the tray can reuse its submenu as a context menu (app/…/index.js• L171-213, app/…/index.js• L499-525).

The menu is also a control point for settings that affect both native behavior and the Teams renderer. For example, notification toggles update stored configuration and then notify the renderer so the new behavior can take effect without a restart (app/…/index.js• L528-581).

The application menu groups its main capabilities as follows:

  • Window and meeting controls: Open, join a meeting, return to Teams, refresh, hide, and quit.
  • Desktop settings: Save or restore Teams settings, show an updated configuration, choose an app icon, and change zoom or full-screen state.
  • Notifications: Disable notification channels, control window flashing and badge counts, and choose notification urgency.
  • Support and diagnostics: Open documentation, external support links, developer tools, and GPU information.
  • Optional controls: Quick Chat, profile management, update checks, and video controls appear only when their related features or build conditions allow them (app/…/appMenu.js• L21-42, app/…/appMenu.js• L69-87).

The menubar setting controls whether the native menu is visible, hidden, or shown automatically. A hidden menubar normally removes the menu from the window, but multi-account mode keeps a profile-only menu attached so pinned profile accelerators still work without restoring unrelated application accelerators (app/…/index.js• L171-194, app/…/index.js• L196-211).

The menu is rebuilt when profile state changes and when menu-controlled settings change. This keeps checkmarks, profile entries, and the tray context menu aligned with current state rather than with the state at startup (app/…/index.js• L215-228, app/…/index.js• L499-525).

References: app/…/appMenu.js• L4-101 app/…/index.js• L171-228 app/…/index.js• L499-581 app/…/options.js• L1316-1360

Profile menu

The Profiles submenu is the native entry point for multi-account use. It lets a user add a profile, manage existing profiles, and switch the active profile; the active profile is marked in the switch list (app/…/profilesMenu.js• L13-65). It appears only when multi-account mode is enabled and a profile manager is available (app/…/appMenu.js• L69-71).

Pinned profiles receive numbered Ctrl+Alt+1 through Ctrl+Alt+5 accelerators in list order. The menu rebuilds after profile add, remove, switch, or update events, so the active mark and numbered slots follow the current profile state (app/…/profilesMenu.js• L17-30, app/…/index.js• L215-228). An empty profile list remains usable: it shows a disabled placeholder and does not enable profile management until a profile exists (app/…/profilesMenu.js• L41-63).

The native menu and the in-window profile switcher share the same add and manage dialogs. Requests from the switcher are accepted only when they come from the local switcher page, which keeps a remote Teams page from opening native profile dialogs (app/…/index.js• L230-271, app/…/index.js• L708-727). For more on the browser-side switcher boundary, see Security and web APIs.

References: app/…/profilesMenu.js• L13-68 app/…/index.js• L215-271 app/…/index.js• L476-497 app/…/index.js• L19-20

System tray

The system tray keeps the app available when the main window is hidden. When enabled, the tray shows the application icon, opens the shared application submenu on its context menu, and toggles the main window when clicked (app/…/index.js• L275-283, app/…/tray.js• L5-16). A click hides a focused window; otherwise it restores, shows, and focuses the window (app/…/tray.js• L46-57).

Closing the main window does not always quit the app. Unless close-on-cross or an allowed quit is active, the close action hides the window or minimizes it according to configuration. A real quit destroys the tray and flushes session storage (app/…/index.js• L287-311). This makes the tray the normal recovery path when the window is hidden instead of closed.

The tray can reflect activity from Teams. The renderer sends unread-count changes to the main process, which updates the tray image, optional flashing, and tooltip count. A zero count returns to the base icon, while a positive count can add a badge when badge display is enabled (app/…/trayIconRenderer.js• L35-99, app/…/tray.js• L18-27, app/…/tray.js• L59-71). The same app icon choice updates the tray and the window, with a platform-sized icon selected when no custom image is set (app/…/trayIconChooser.js• L15-27, app/…/index.js• L313-363).

Tray behavior is controlled by the tray configuration. The tray is enabled by default, supports a custom PNG and light or dark icon type, and uses restart-time configuration for its setup (app/…/options.js• L1362-1391).

References: app/…/tray.js• L5-85 app/…/index.js• L275-311 app/…/trayIconRenderer.js• L8-99 app/…/trayIconChooser.js• L15-27 app/…/options.js• L1362-1391

Shortcut surfaces

The app has two different shortcut surfaces. Application-menu accelerators work while the app is focused, while global shortcuts are registered with the operating system and can trigger Teams commands when another app has focus (app/…/appMenu.js• L7-18, app/…/index.js• L1-6).

Global shortcuts are opt-in and use the configured shortcuts.global list. When the operating system accepts one, the main process sends the matching key event to the Teams window so Teams can apply its own built-in command. Invalid entries and shortcuts already claimed by another app are skipped or reported, and all registrations are removed during quit (app/…/index.js• L72-131, app/…/options.js• L1108-1131).

The focused-window shortcut layer adds desktop-friendly zoom and history behavior. It handles control-plus/minus/zero for zoom and, on non-macOS systems, Alt-plus-left/right for history navigation. It listens in the main page and waits for a same-origin embedded document when one is available (app/…/shortcuts.js• L28-43, app/…/shortcuts.js• L61-99).

Quick Chat uses an optional application-menu accelerator and can also register a global shortcut when configured. If the global registration is not available, the menu shortcut remains the focused-window path (app/…/appMenu.js• L21-28, app/index.js• L625-633).

flowchart LR
    A[Keyboard input] --> B{Where does it occur?}
    B -->|App focused| C[Application menu or renderer shortcut]
    B -->|Any app focused| D[Operating system global shortcut]
    C --> E[Native action or Teams page behavior]
    D --> F[Forward key event to Teams window]

References: app/…/index.js• L72-131 app/…/shortcuts.js• L28-132 app/…/appMenu.js• L7-28 app/…/options.js• L1108-1131

Platform icons and badges

Native icon controls connect Teams activity and user status to the desktop shell. The tray and window use the selected app icon, while macOS also uses a larger version for the dock (app/…/index.js• L689-713, app/…/index.js• L348-363).

The app can show an unread badge on the taskbar or dock and can render a status marker on the macOS dock icon. Dock status rendering is enabled only on macOS when configured, and a failed render restores the default icon rather than leaving an old status marker in place (app/…/dockIconRenderer.js• L4-39, app/index.js• L239-256). Badge count updates pass through a validated preload API before reaching the main process (app/…/preload.js• L141-150).

These controls give native surfaces different roles: the tray communicates unread activity and opens the app, the taskbar or dock can show a count, and the macOS dock can show user status. The controls are related but are not the same state channel, so disabling one does not imply that the others are disabled (app/…/options.js• L425-430, app/…/options.js• L1362-1391, app/…/dockIconRenderer.js• L6-27). Related renderer-to-native boundaries are described in Browser integration and tools.

References: app/…/index.js• L689-713 app/…/index.js• L313-363 app/…/dockIconRenderer.js• L4-39 app/…/preload.js• L141-150 app/index.js• L239-256

Change checklist

When these files or sections are changed, remember to consider these:

  • Keep the application menu and tray submenu aligned when adding or changing a command. The tray is built from the application submenu and is rebuilt after menu state changes.
  • Preserve the hidden-menubar profile-only path. Removing its attached menu can disable pinned profile accelerators even when the user only hid the menubar.
  • Keep profile list events and menu rebuilds aligned. A stale rebuild can show the wrong active profile or assign a pinned shortcut to the wrong slot.
  • Keep tray activity updates and badge updates consistent with the notification disable flags. They are separate native outputs driven by the same unread count.
  • Treat global shortcut configuration as restart-time state. A failed operating-system registration must not be reported as an active shortcut.
  • Keep custom icon updates in sync across tray, window, and macOS dock paths. Use a suitable large icon for the dock.

Important failure modes

TriggerConsequenceGuard
The tray is disabled and the menubar is hiddenThe user has no normal native surface to show the hidden window or open the migration commandKeep at least one of the menubar or tray surfaces available when those actions are needed (app/…/deprecation.js• L56-72)
A global shortcut is already owned by another applicationThe configured command does not trigger system-wideCheck the registration result and treat only accepted registrations as active (app/…/index.js• L94-115)
A profile event rebuilds a hidden menubar as a full menuHidden-menu application accelerators can become active unexpectedlyAttach only the Profiles submenu when multi-account mode and hidden menubar are both active (app/…/index.js• L171-194)
Tray icon rendering completes out of orderAn old unread count can replace a newer tray stateDiscard superseded render sequences before sending tray-update (app/…/trayIconRenderer.js• L48-87)
A custom icon is too small for the macOS dockThe dock receives an unsuitable icon sizeResize small dock images to at least the platform minimum (app/…/index.js• L348-362, app/…/index.js• L695-711)
The main window closes while quit is not allowedThe app appears to disappear while its process remains activeHide or minimize on close and keep the tray available for restore (app/…/index.js• L298-311, app/…/tray.js• L46-57)

Key files

FileWhy to read it
app/…/index.jsMain coordinator for menu attachment, tray setup, close behavior, profile updates, and native actions.
app/…/appMenu.jsDefines the user-facing application commands and their focused-window accelerators.
app/…/profilesMenu.jsShows how multi-account actions and pinned profile shortcuts reach the native menu.
app/…/tray.jsDefines tray click behavior, context-menu use, tooltip state, and tray cleanup.
app/…/index.jsDefines the system-wide shortcut contract and forwarding path into Teams.
app/…/shortcuts.jsDefines focused-window zoom and navigation shortcuts in the Teams page.
app/…/trayIconRenderer.jsConnects unread activity to tray images, flashing, and badge updates.
app/…/dockIconRenderer.jsConnects local user status to the macOS dock icon.
app/…/options.jsDefines the user-facing configuration for menubar, tray, badges, close behavior, and shortcut surfaces.