mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Ensure custom title bar is always updated when document.title changes
This commit uses a new private API on Workspace that emits an event every time the window title gets updated (e.g. as a result of an active pane item changing, the project paths changing, etc.). This fixes a bug that left the custom title bar with a stale document.title under some circumstances. Signed-off-by: Jason Rudolph <jasonrudolph@github.com>
This commit is contained in:
committed by
Jason Rudolph
parent
5a8dce1175
commit
62ee913567
@@ -10,7 +10,7 @@ class TitleBar
|
||||
|
||||
@element.addEventListener 'dblclick', @dblclickHandler
|
||||
|
||||
@workspace.onDidChangeActivePaneItem => @updateTitle()
|
||||
@workspace.onDidChangeWindowTitle => @updateTitle()
|
||||
@themes.onDidChangeActiveThemes => @updateWindowSheetOffset()
|
||||
|
||||
@updateTitle()
|
||||
|
||||
@@ -587,6 +587,7 @@ module.exports = class Workspace extends Model {
|
||||
|
||||
document.title = titleParts.join(' \u2014 ')
|
||||
this.applicationDelegate.setRepresentedFilename(representedPath)
|
||||
this.emitter.emit('did-change-window-title')
|
||||
}
|
||||
|
||||
// On macOS, fades the application window's proxy icon when the current file
|
||||
@@ -864,6 +865,10 @@ module.exports = class Workspace extends Model {
|
||||
return this.emitter.on('did-add-text-editor', callback)
|
||||
}
|
||||
|
||||
onDidChangeWindowTitle (callback) {
|
||||
return this.emitter.on('did-change-window-title', callback)
|
||||
}
|
||||
|
||||
/*
|
||||
Section: Opening
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user