mirror of
https://github.com/Boof2015/prism.git
synced 2026-08-12 05:10:51 +02:00
initial commit to fix windows scaling issue
This commit is contained in:
@@ -76,6 +76,13 @@ function resolveLinuxDisplayServer(
|
||||
}
|
||||
|
||||
export function resolveWindowCapabilities(options: WindowCapabilityResolutionOptions): WindowCapabilities {
|
||||
if (options.platform === 'win32') {
|
||||
return {
|
||||
...DEFAULT_WINDOW_CAPABILITIES,
|
||||
useNativeDragRegions: true,
|
||||
}
|
||||
}
|
||||
|
||||
if (options.platform !== 'linux') {
|
||||
return { ...DEFAULT_WINDOW_CAPABILITIES }
|
||||
}
|
||||
|
||||
@@ -2625,6 +2625,22 @@ test('resolveWindowCapabilities leaves non-Linux platforms on the full-featured
|
||||
)
|
||||
})
|
||||
|
||||
test('resolveWindowCapabilities uses native drag regions on Windows while preserving geometry controls', () => {
|
||||
assert.deepEqual(
|
||||
resolveWindowCapabilities({
|
||||
platform: 'win32',
|
||||
argv: [],
|
||||
env: {},
|
||||
}),
|
||||
{
|
||||
displayServer: 'other',
|
||||
useNativeDragRegions: true,
|
||||
supportsProgrammaticReposition: true,
|
||||
supportsGeometryPersistence: true,
|
||||
},
|
||||
)
|
||||
})
|
||||
|
||||
test('Wayland window controls use native drag regions and omit unsupported reposition/geometry paths', async () => {
|
||||
const toolbarSource = await readFile(join(process.cwd(), 'src', 'renderer', 'components', 'Toolbar.tsx'), 'utf8')
|
||||
const appSource = await readFile(join(process.cwd(), 'src', 'renderer', 'App.tsx'), 'utf8')
|
||||
|
||||
Reference in New Issue
Block a user