Skip to content

Commit c1e400c

Browse files
authored
Fix: Some errors
1 parent 37c5d29 commit c1e400c

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

scripts/tabs/drag.mts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ function add(id: number, _detachedTab: boolean = false, fromTitleBar: boolean =
226226

227227
sendAttachedTab(tab, false);
228228

229-
if(tabs.tabs.length === 1)
229+
if(singleTab && tabs.tabs.length === 1 && !tabFromOtherWindowEvent)
230230
{
231231
if(useScreenPointTabs)
232232
{
@@ -257,7 +257,6 @@ function add(id: number, _detachedTab: boolean = false, fromTitleBar: boolean =
257257
currentDetachedWindowId = await openPathInNewWindow(history.current.path, history.current.mainPath, history, {showInactive: false}) as number;
258258

259259
followScreenPoint(currentDetachedWindowId, tab);
260-
261260
}
262261

263262
return;
@@ -283,6 +282,8 @@ function add(id: number, _detachedTab: boolean = false, fromTitleBar: boolean =
283282
const win = electronRemote.BrowserWindow.fromId(currentDetachedWindowId);
284283
if(win) win.hide();
285284
}
285+
286+
electronRemote.getCurrentWindow().focus();
286287
}
287288

288289
tab.element.style.transform = `translateX(calc(((var(--tabs-bar-tab-width) + 6px) * ${tab.position}) + ${data.diffX}px))`;
@@ -337,7 +338,7 @@ function add(id: number, _detachedTab: boolean = false, fromTitleBar: boolean =
337338
return;
338339
}
339340

340-
if(tabs.tabs.length === 1)
341+
if(singleTab)
341342
{
342343
electronRemote.getCurrentWindow().show();
343344
detachedTab = false;
@@ -685,7 +686,6 @@ function attachedTab(tab: Tab, attached: boolean = false) {
685686
else
686687
win.show();
687688
}
688-
689689
}
690690

691691
function startDragTab({x, y}) {

scripts/title-bar.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@ function setColors()
151151
{
152152
let computedStyle = getComputedStyle(document.querySelector('.app'));
153153

154-
let symbolColor = computedStyle.getPropertyValue('--md-sys-color-on-surface-variant');
155-
let backgroundColor = computedStyle.getPropertyValue('--md-sys-color-surface-container');
154+
let symbolColor = computedStyle.getPropertyValue('--md-sys-color-on-surface-variant').trim() || '#7F7F7F';
155+
let backgroundColor = computedStyle.getPropertyValue('--md-sys-color-surface-container').trim() || '#7F7F7F';
156156

157157
let win = electronRemote.getCurrentWindow();
158158
win.setBackgroundColor(backgroundColor);
@@ -163,7 +163,7 @@ function setColors()
163163
height: 29,
164164
};
165165

166-
if(process.platform == 'win32' || process.platform == 'win64')
166+
if(process.platform == 'win32')
167167
{
168168
if(first)
169169
win.setTitleBarOverlay(colors);

0 commit comments

Comments
 (0)