mirror of
https://github.com/Andre-Bzk/twitch4steamdeck.git
synced 2026-11-15 15:43:08 +01:00
feat: maximize window on Linux to fill screen, bump version to 0.3.3
On Linux, the primary display resolution is queried and the window is maximized on startup. This ensures a fullscreen experience both on the Steam Deck display and on external monitors/TVs when docked. Windows/dev behavior unchanged.
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "twitch4steamdeck",
|
"name": "twitch4steamdeck",
|
||||||
"version": "0.3.2",
|
"version": "0.3.3",
|
||||||
"description": "Werbefreier Twitch-Client für das Steam Deck (Live & VOD, Big-Screen-UI)",
|
"description": "Werbefreier Twitch-Client für das Steam Deck (Live & VOD, Big-Screen-UI)",
|
||||||
"main": "out/main/index.js",
|
"main": "out/main/index.js",
|
||||||
"author": "twitch4steamdeck",
|
"author": "twitch4steamdeck",
|
||||||
|
|||||||
+12
-4
@@ -1,4 +1,4 @@
|
|||||||
import { app, BrowserWindow, shell } from 'electron'
|
import { app, BrowserWindow, shell, screen } from 'electron'
|
||||||
import { join } from 'node:path'
|
import { join } from 'node:path'
|
||||||
import { AuthService } from './auth/authService'
|
import { AuthService } from './auth/authService'
|
||||||
import { HelixClient } from './twitch/helixClient'
|
import { HelixClient } from './twitch/helixClient'
|
||||||
@@ -9,9 +9,14 @@ import { startGamepadReader } from './input/gamepadReader'
|
|||||||
const isDev = !app.isPackaged
|
const isDev = !app.isPackaged
|
||||||
|
|
||||||
function createWindow(): BrowserWindow {
|
function createWindow(): BrowserWindow {
|
||||||
|
const isLinux = process.platform === 'linux'
|
||||||
|
const { width, height } = isLinux
|
||||||
|
? screen.getPrimaryDisplay().workAreaSize
|
||||||
|
: { width: 1280, height: 800 }
|
||||||
|
|
||||||
const win = new BrowserWindow({
|
const win = new BrowserWindow({
|
||||||
width: 1280,
|
width,
|
||||||
height: 800,
|
height,
|
||||||
minWidth: 1024,
|
minWidth: 1024,
|
||||||
minHeight: 640,
|
minHeight: 640,
|
||||||
show: false,
|
show: false,
|
||||||
@@ -25,7 +30,10 @@ function createWindow(): BrowserWindow {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
win.once('ready-to-show', () => win.show())
|
win.once('ready-to-show', () => {
|
||||||
|
if (isLinux) win.maximize()
|
||||||
|
win.show()
|
||||||
|
})
|
||||||
|
|
||||||
win.webContents.setWindowOpenHandler(({ url }) => {
|
win.webContents.setWindowOpenHandler(({ url }) => {
|
||||||
shell.openExternal(url)
|
shell.openExternal(url)
|
||||||
|
|||||||
Reference in New Issue
Block a user