Skip to content

Update immediately titlebar background color on D-Bus profile switch - #1111

Merged
mattrose merged 1 commit into
gnome-terminator:masterfrom
dereckson:dbus-switch-profile-fix-titlebar
Sep 6, 2026
Merged

Update immediately titlebar background color on D-Bus profile switch#1111
mattrose merged 1 commit into
gnome-terminator:masterfrom
dereckson:dbus-switch-profile-fix-titlebar

Conversation

@dereckson

Copy link
Copy Markdown
Contributor

When switching profile at runtime, for example through D-Bus using the command remotinator switch_profile -p <profile>, the titlebar color is not updated immediately. The color is only refreshed after the Terminator windows loses and regains focus.

Terminal.reconfigure() calls Titlebar.update() without providing the current focus context, so profile-dependent titlebar colors are not recalculated.

This change determines whether the toplevel window currently has input focus and update the titlebar accordingly.

When switching profile at runtime, for example through D-Bus using the command
`remotinator switch_profile -p <profile>`, the titlebar color is not updated
immediately. The color is only refreshed after the Terminator windows loses
and regains focus.

Terminal.reconfigure() calls Titlebar.update() without providing the current
focus context, so profile-dependent titlebar colors are not recalculated.

This change determines whether the toplevel window currently has input focus
and update the titlebar accordingly.
@dereckson

Copy link
Copy Markdown
Contributor Author

I've discovered this issue trying to switch from local to remote server profile, with two different backgrounds to give a hint where we are:

[...]

if [ -n "${TERMINATOR_UUID+1}" ]; then
        remotinator switch_profile -p "$SERVER"
        printf '\033]0;%s\007' "Servers   ::   $SERVER"
else
        printf '\033]0;%s\007' "$SERVER"
fi

ssh -t [...] tmux-reattach

if [ -n "${TERMINATOR_UUID+1}" ]; then
        remotinator switch_profile -p Local
        printf '\033]0;%s\007' "Local   ::   $HOSTNAME"
else
        printf '\033]0;%s\007' "$HOSTNAME"
fi

It's very convenient to update dynamically the profile. background and the title bar.

As I'm using a bordeau / lie-de-vin bar for local machine, and a teal bar for the remote server, I've noticed the issue and tried to fix it, hence this patch.

@dereckson

Copy link
Copy Markdown
Contributor Author

Can repro issue on:

  • Fedora RawHide on GNOME 51.beta, Wayland (my laptop)
  • Fedora 42 on Xorg on GNOME 48, X11 (my desktop)

On Wayland, the focus dance is more complicated to achieve: we need to do something forcing window redraw like set window to normal state and move it a little bit.

Can repro the fix on both environments too.

@mattrose

mattrose commented Sep 6, 2026

Copy link
Copy Markdown
Member

Fixes the problem nicely, tysm

@mattrose
mattrose merged commit 026d44e into gnome-terminator:master Sep 6, 2026
1 check passed
@dereckson
dereckson deleted the dbus-switch-profile-fix-titlebar branch September 7, 2026 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants