Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions internal/platform/darwin/native.m
Original file line number Diff line number Diff line change
Expand Up @@ -6250,6 +6250,12 @@ - (void)setWindowTitle:(NSString *)title {
_title = [title copy];
if (_window != nil) {
_window.title = _title;
/* A new title lays the titlebar out again, and AppKit sets the zoom
* button back at the system's height without reporting the move as a
* frame change, so keepTrafficLightsCentered never hears of it. */
if (_windowMode == VIVA_WINDOW_CUSTOM_TITLEBAR) {
viva_place_traffic_lights(_window, _titlebarHeight);
}
}
}

Expand Down
7 changes: 7 additions & 0 deletions internal/platform/darwin/testdata/traffic_lights.m
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,13 @@ int main(void) {
window.titlebarAppearsTransparent = NO;
window.titlebarAppearsTransparent = YES;
assertCenter(window, 18, "after the titlebar was restyled");
// A new title lays the titlebar out too, and AppKit moves the zoom
// button back without reporting it as a frame change.
[delegate setWindowTitle:@"project"];
assertCenter(window, 18, "after the title changed");
assertAligned(window, "after the title changed");
[delegate setWindowTitle:@"project - file"];
assertAligned(window, "after the title changed again");
[delegate setAlwaysOnTop:YES];
assert(window.level == NSFloatingWindowLevel);
[delegate setAlwaysOnTop:NO];
Expand Down