mirror of
https://github.com/aaddrick/claude-desktop-debian.git
synced 2026-05-17 00:26:21 +03:00
fix: add isDestroyed guard in setApplicationMenu and TODO for getWindow fallback
Add isDestroyed() check in the setApplicationMenu interceptor to skip destroyed windows when hiding menu bars, matching the defensive pattern used elsewhere in the codebase. Add TODO comment on getWindow() popup fallback limitation to flag that callers like getIsMaximized() may behave unexpectedly when a popup is returned instead of the main window. Co-Authored-By: Claude <claude@anthropic.com>
This commit is contained in:
@@ -13,6 +13,8 @@ function getWindow() {
|
||||
const { BrowserWindow } = require('electron');
|
||||
const focused = BrowserWindow.getFocusedWindow();
|
||||
if (focused) return focused;
|
||||
// TODO: Fallback may return a popup window; callers like
|
||||
// getIsMaximized() may behave unexpectedly on popups.
|
||||
const win = BrowserWindow.getAllWindows().find(
|
||||
(w) => !w.isDestroyed()
|
||||
);
|
||||
|
||||
@@ -139,6 +139,7 @@ Module.prototype.require = function(id) {
|
||||
if (process.platform === 'linux') {
|
||||
// Hide menu bar on all existing windows after menu is set
|
||||
for (const win of module.BrowserWindow.getAllWindows()) {
|
||||
if (win.isDestroyed()) continue;
|
||||
win.setMenuBarVisibility(false);
|
||||
}
|
||||
console.log('[Frame Fix] Menu bar hidden on all windows');
|
||||
|
||||
Reference in New Issue
Block a user