mirror of
https://github.com/tiddly-gittly/TidGi-Desktop.git
synced 2026-03-21 06:10:52 -07:00
Fix window title is not in synced with workspace (#308)
This commit is contained in:
parent
51b43e83af
commit
e6902df4f3
3 changed files with 12 additions and 6 deletions
|
|
@ -389,6 +389,7 @@ const addView = (browserWindow, workspace) => {
|
|||
|
||||
if (workspaceObj.active) {
|
||||
sendToAllWindows('update-title', title);
|
||||
browserWindow.setTitle(title);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -694,6 +695,7 @@ const setActiveView = (browserWindow, id) => {
|
|||
|
||||
sendToAllWindows('update-address', view.webContents.getURL(), false);
|
||||
sendToAllWindows('update-title', view.webContents.getTitle());
|
||||
browserWindow.setTitle(view.webContents.getTitle());
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
const { session } = require('electron');
|
||||
const { app, session } = require('electron');
|
||||
|
||||
const {
|
||||
countWorkspaces,
|
||||
|
|
@ -79,11 +79,15 @@ const setActiveWorkspaceView = (id) => {
|
|||
};
|
||||
|
||||
const removeWorkspaceView = (id) => {
|
||||
// if there's only one workspace left, clear all
|
||||
if (countWorkspaces() === 1) {
|
||||
mainWindow.get().setBrowserView(null);
|
||||
}
|
||||
|
||||
if (getWorkspace(id).active && countWorkspaces() > 1) {
|
||||
const win = mainWindow.get();
|
||||
if (win) {
|
||||
win.setBrowserView(null);
|
||||
win.setTitle(app.name);
|
||||
sendToAllWindows('update-title', '');
|
||||
}
|
||||
} else if (countWorkspaces() > 1 && getWorkspace(id).active) {
|
||||
setActiveWorkspaceView(getPreviousWorkspace(id).id);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ const FakeTitleBar = (props) => {
|
|||
}
|
||||
}}
|
||||
>
|
||||
{(window.mode === 'main' || window.mode === 'menubar') && title ? title : window.require('electron').remote.getCurrentWindow().getTitle()}
|
||||
{(window.mode === 'main' || window.mode === 'menubar') && title ? title : window.require('electron').remote.app.name}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue