mirror of
https://github.com/Kvan7/Exiled-Exchange-2.git
synced 2026-09-25 22:25:58 +00:00
WIP linus seems to work
This commit is contained in:
+4
-1
@@ -54,7 +54,10 @@ app.on('ready', async () => {
|
||||
PoeWindow.startPolling()
|
||||
setupConfig()
|
||||
setupShowHide()
|
||||
createWindow()
|
||||
setTimeout(
|
||||
createWindow, // fix: linux window black instead of transparent
|
||||
process.platform === 'linux' ? 1000 : 0
|
||||
)
|
||||
createTray()
|
||||
setupShortcuts()
|
||||
|
||||
|
||||
+7
-11
@@ -19,22 +19,16 @@ let browserViewExternal: BrowserView | undefined
|
||||
|
||||
export function showWindow () {
|
||||
positionWindow(win)
|
||||
const wasLockedLinux = isWindowLocked
|
||||
if (isWindowShown && isWindowLocked) {
|
||||
logger.debug('Hide the window (was left in background)', { source: 'price-check', fn: 'showWindow' })
|
||||
hideWindow()
|
||||
hideWindow(true)
|
||||
}
|
||||
|
||||
isWindowShown = true
|
||||
win.showInactive()
|
||||
if (process.platform === 'linux') {
|
||||
if (wasLockedLinux && config.get('altTabToGame')) {
|
||||
win.setSkipTaskbar(true) // fix: GNOME window is ready
|
||||
}
|
||||
win.setAlwaysOnTop(true) // X11: alwaysOnTop resets on show/hide
|
||||
}
|
||||
}
|
||||
|
||||
function hideWindow () {
|
||||
function hideWindow (willShow?: boolean) {
|
||||
logger.verbose('Hide window', { source: 'price-check', fn: 'hideWindow', wasLocked: isWindowLocked })
|
||||
|
||||
isWindowShown = false
|
||||
@@ -42,13 +36,15 @@ function hideWindow () {
|
||||
win.setSkipTaskbar(true)
|
||||
win.setAlwaysOnTop(true, 'screen-saver')
|
||||
}
|
||||
win.hide()
|
||||
if (!willShow) {
|
||||
win.hide()
|
||||
}
|
||||
win.setIgnoreMouseEvents(true)
|
||||
|
||||
if (isWindowLocked) {
|
||||
isWindowLocked = false
|
||||
PoeWindow.isActive = true
|
||||
if (process.platform === 'win32') {
|
||||
if (process.platform === 'win32' && !willShow) {
|
||||
windowManager.focusWindowById(PoeWindow.pid!)
|
||||
}
|
||||
if (browserViewExternal) {
|
||||
|
||||
+3
-1
@@ -19,6 +19,7 @@ export function createWindow () {
|
||||
frame: false,
|
||||
show: false,
|
||||
transparent: true,
|
||||
fullscreen: true, // linux does not support changing at runtime, add config?
|
||||
resizable: false,
|
||||
// backgroundColor: '#2d3748', // gray-800
|
||||
webPreferences: {
|
||||
@@ -38,9 +39,10 @@ export function createWindow () {
|
||||
checkForUpdates()
|
||||
}
|
||||
|
||||
win.setAlwaysOnTop(true, 'screen-saver')
|
||||
win.setIgnoreMouseEvents(true)
|
||||
win.once('ready-to-show', () => {
|
||||
// place here because of linux
|
||||
win.setAlwaysOnTop(true, 'screen-saver')
|
||||
// win.show()
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user