Skip to content

fix(macos): reapply traffic light inset on title change and fullscreen exit - #1254

Merged
FabianLars merged 1 commit into
tauri-apps:devfrom
tenderdeve:fix/macos-traffic-light-reset
Jul 28, 2026
Merged

fix(macos): reapply traffic light inset on title change and fullscreen exit#1254
FabianLars merged 1 commit into
tauri-apps:devfrom
tenderdeve:fix/macos-traffic-light-reset

Conversation

@tenderdeve

Copy link
Copy Markdown
Contributor

Moving the traffic-light-reset fix down to tao, per the discussion on tauri-apps/tauri#15628.

What

On macOS the custom traffic light inset (set_traffic_light_inset) is lost on two events:

Both reporters noted resizing the window fixes it, which is the tell: draw_rect already re-insets on redraw (view.rs), but neither setTitle: nor windowDidExitFullScreen: triggers a drawRect:, so the position stays default until the next redraw.

How

Reapply the inset already stored on the view's ViewState (traffic_light_inset) after both events:

  • set_title_async re-insets right after setTitle:
  • window_did_exit_fullscreen re-insets after the transition completes

No new state — the value is read back from the existing taoState ivar, so it can't drift from what set_traffic_light_inset wrote. New helper reapply_traffic_light_inset(ns_window, ns_view) in view.rs.

@FabianLars this is the ivar-based version we talked about — supersedes your refresh-lights branch (that one threaded a new SharedState.traffic_lights_position and only covered the title case). Also covers fullscreen exit here. cargo check is green; I don't have a mac to smoke-test the button positions, so a visual check would be appreciated.

…n exit

setTitle: and leaving fullscreen reset the window buttons to their
default position without triggering a drawRect:, so the custom inset set
via set_traffic_light_inset was lost until the next redraw (e.g. a resize).

Reapply the inset already stored on the view's ViewState after both
events. No new state is introduced; the position is read back from the
taoState ivar.

Fixes the traffic light reset reported downstream in tauri-apps/tauri#13044
(title change) and tauri-apps/tauri#15451 (fullscreen exit).
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Package Changes Through 7d2cdb1

There are 1 changes which include tao with minor

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
tao 0.35.3 0.36.0

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

@FabianLars

Copy link
Copy Markdown
Member

the title fix works good. couldn't reproduce the fullscreen one, waiting a few days for the issue author to respond tauri-apps/tauri#15451

@FabianLars FabianLars left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

didn't hear back yet but the fullscreen change can't hurt i think so imo ready to go

@FabianLars
FabianLars merged commit 2ada91b into tauri-apps:dev Jul 28, 2026
20 checks passed
@github-actions github-actions Bot mentioned this pull request Jul 28, 2026
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