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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 1.0.72

- Fix: window-toggle actions bring window to front when covered by another app (Normal mode)
- `Cmd+Ctrl+R` (Quick Switcher), `Cmd+Ctrl+T` (Terminal), and tray left-click
- Previously: visible-but-unfocused first press hid the window
- Now: visible+unfocused → focus to top; visible+focused → hide (or toggle Terminal tab)
- Menu bar mode unaffected (`onBlur` auto-hide makes the state unreachable)

## 1.0.71

- Fix: use `setActivationPolicy` instead of `app.dock.hide/show` for proper Dock behavior
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "CodeV",
"productName": "CodeV",
"version": "1.0.71",
"version": "1.0.72",
"description": "Quick switcher for VS Code, Cursor, and Claude Code sessions",
"repository": {
"type": "git",
Expand Down
56 changes: 45 additions & 11 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1002,12 +1002,24 @@ const trayToggleEvtHandler = async () => {
showSwitcherWindow();
} else {
const window = getSwitcherWindow();

if (window && window.isVisible()) {
if (isDebug) {
console.log('is visible, to hide');

if (window && window.isVisible() && !window.isMinimized()) {
if (window.isFocused()) {
if (isDebug) {
console.log('is visible and focused, to hide');
}
hideSwitcherWindow();
} else {
// Visible but covered by another app — bring to front instead of hiding
if (isDebug) {
console.log('is visible but unfocused, bringing to front');
}
if (appMode === 'normal') {
app.focus({ steal: true });
}
window.show();
window.focus();
}
hideSwitcherWindow();
} else if (window) {
if (isDebug) {
console.log('is not visible, to show');
Expand Down Expand Up @@ -1327,10 +1339,22 @@ const trayToggleEvtHandler = async () => {
const window = getSwitcherWindow();

if (window && window.isVisible() && !window.isMinimized()) {
if (isDebug) {
console.log('Switcher window visible, hiding it');
if (window.isFocused()) {
if (isDebug) {
console.log('Switcher window visible and focused, hiding it');
}
hideSwitcherWindow();
} else {
// Visible but covered by another app — bring to top instead of hiding
if (isDebug) {
console.log('Switcher window visible but unfocused, bringing to front');
}
if (appMode === 'normal') {
app.focus({ steal: true });
}
window.show();
window.focus();
}
hideSwitcherWindow();
} else if (window) {
if (isDebug) {
console.log('Switcher window exists but hidden, showing it');
Expand Down Expand Up @@ -1626,9 +1650,19 @@ const trayToggleEvtHandler = async () => {
switcherWindow = createSwitcherWindow();
}
const window = getSwitcherWindow();
if (window && window.isVisible()) {
// If already showing Terminal tab, hide; otherwise switch to Terminal
window.webContents.send('check-terminal-and-hide');
if (window && window.isVisible() && !window.isMinimized()) {
if (window.isFocused()) {
// If already showing Terminal tab, hide; otherwise switch to Terminal
window.webContents.send('check-terminal-and-hide');
} else {
// Visible but covered — bring to front and switch to Terminal tab
if (appMode === 'normal') {
app.focus({ steal: true });
}
window.show();
window.focus();
window.webContents.send('switch-to-terminal');
}
} else if (window) {
window.webContents.send('switch-to-terminal');
showSwitcherWindow();
Expand Down