Skip to content

Commit

Permalink
fixed weird bug for undetectability from nuke guy
Browse files Browse the repository at this point in the history
  • Loading branch information
ibttf committed Feb 2, 2025
1 parent 828cbb0 commit 187beaf
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 26 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@

An invisible desktop application that will help you pass your technical interviews.


https://github.com/user-attachments/assets/0615b110-2670-4b0e-bc69-3c32a2d8a996


## Invisibility Compatibility

The application is invisible to:
Expand Down
19 changes: 10 additions & 9 deletions electron/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,12 +375,13 @@ function hideMainWindow(): void {
state.windowPosition = { x: bounds.x, y: bounds.y }
state.windowSize = { width: bounds.width, height: bounds.height }
state.mainWindow.setIgnoreMouseEvents(true, { forward: true })
state.mainWindow.setFocusable(false)
state.mainWindow.setAlwaysOnTop(true, "floating", 1)
state.mainWindow.setVisibleOnAllWorkspaces(true, {
visibleOnFullScreen: true
})
state.mainWindow.setOpacity(0)
state.mainWindow.hide()
state.isWindowVisible = false
// Ensure we don't steal focus when hiding
app.hide()
}
}

Expand All @@ -393,15 +394,15 @@ function showMainWindow(): void {
})
}
state.mainWindow.setIgnoreMouseEvents(false)
state.mainWindow.setFocusable(true)
state.mainWindow.setAlwaysOnTop(true, "floating", 1)
state.mainWindow.setVisibleOnAllWorkspaces(true, {
visibleOnFullScreen: true
})
state.mainWindow.setContentProtection(true)
state.mainWindow.setOpacity(0)
state.mainWindow.show()
state.mainWindow.setOpacity(1)
// Use showInactive to prevent stealing focus
state.mainWindow.showInactive()
state.mainWindow.setOpacity(1)
state.isWindowVisible = true
// Ensure we don't activate the app
app.hide()
}
}

Expand Down
14 changes: 0 additions & 14 deletions electron/shortcuts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,20 +77,6 @@ export class ShortcutsHelper {

globalShortcut.register("CommandOrControl+B", () => {
this.deps.toggleMainWindow()
// If window exists and we're showing it, bring it to front
const mainWindow = this.deps.getMainWindow()
if (mainWindow && !this.deps.isVisible()) {
// Force the window to the front on macOS
if (process.platform === "darwin") {
mainWindow.setAlwaysOnTop(true, "normal")
// Reset alwaysOnTop after a brief delay
setTimeout(() => {
if (mainWindow && !mainWindow.isDestroyed()) {
mainWindow.setAlwaysOnTop(true, "floating")
}
}, 100)
}
}
})

// Unregister shortcuts when quitting
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "interview-coder-v1",
"version": "1.0.9",
"version": "1.0.10",
"main": "dist-electron/main.js",
"scripts": {
"clean": "rimraf dist dist-electron",
Expand Down

0 comments on commit 187beaf

Please sign in to comment.