Skip to content

[FEATURE] Media panel: click Now Playing card to raise/focus the source player #4574

Open

Description

@kishansundar

Submission checklist

  • I have searched existing issues and confirmed this has not been requested before.
  • I have checked existing pull requests for similar changes.

Feature type

New functionality

Feature summary

In the control center's Media tab, clicking the artwork or the title/artist in the "Now Playing" card should bring the source player to the front (Spotify, browser, mpv, …) and close the panel. Right now clicking the card does nothing.

Motivation / use case

With several apps or browser windows open, the Media panel shows what is playing but gives no quick way to jump to where it's playing. Clicking the track info to go to the player is a common pattern in other shells and media widgets.

Proposed solution

  • Clicking the artwork, title or artist calls org.mpris.MediaPlayer2.Raise on the active player (when CanRaise is true) and closes the panel.
  • Better yet, on compositors Noctalia already integrates with (Hyprland, niri, …), focus the toplevel owned by the player's D-Bus connection PID (or one of its ancestors). Browsers like Firefox/Zen report CanRaise = true, but their Raise often doesn't actually focus the window on Wayland.
  • Optionally make it configurable, e.g. click_to_raise = true.

Code-wise, in src/shell/control_center/tabs/media_tab.cpp the artwork row (m_artworkRow, around line 238) and the title/artist labels could take an onClick the same way the transport buttons already do.

Alternatives considered

As a workaround I bind a script to the bar media widget:

[widget.media.actions]
middle = "exec ~/.local/bin/media-focus"

The script picks the playing MPRIS player, looks up its PID via busctl --user status, and focuses the matching Hyprland client (temporarily setting cursor:no_warps so the pointer doesn't jump). It works, but it's only on the bar pill, not the panel where you'd naturally click.

Additional context

Noctalia 5.1.0, Hyprland 0.56.2, CachyOS (Arch-based).

Activity

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