arcade icon indicating copy to clipboard operation
arcade copied to clipboard

Using screen dimensions for window is too big

Open kmecpp opened this issue 2 months ago • 2 comments

I'm using a Windows machine and a monitor with 2560 x 1440 resolution. If I do

screen_width, screen_height = arcade.get_display_size()
Window(width=screen_width, height=screen_height)

Then Arcade creates a Window that doesn't fit on my screen because it's way too big.

Similarly, if I try to then to .maximize() then the window gets scaled down.

Why is Arcade not properly using all of the pixels in my monitor?

Full working example:

import arcade


class ScreenSizeTest(arcade.View):

    def on_resize(self, width: int, height: int) -> bool | None:
        print(f"NEW SIZE: {width} x {height}")


screen_width, screen_height = arcade.get_display_size()

print(f"Screen Size: {screen_width} x {screen_height}")
window = arcade.Window(width=screen_width, height=screen_height)
window.maximize()

view = ScreenSizeTest()
window.show_view(view)
arcade.run()

Output:

Screen Size: 2560 x 1440
NEW SIZE: 2560 x 1440
NEW SIZE: 2048 x 1128

kmecpp avatar Oct 30 '25 07:10 kmecpp

Which Arcade version is this?

Also, what happens when you run with other dpi scaling modes? i.e. at the top of the file:

import pyglet
pyglet.options.dpi_scaling = "platform"

import arcade
# [ The rest of the file here ]

The default DPI scaling value is "real" (iirc) but you should try other options as well. For example, a PR changing pyglet's default scaling value just got merged upstream: https://github.com/pyglet/pyglet/pull/1383

pushfoo avatar Oct 30 '25 09:10 pushfoo

Using Arcade v3.3.3

"platform" isn't a valid DPI scaling mode in the version that I'm using. I get this warning: Expected type 'Literal["real", "scaled", "stretch"]', got 'Literal["platform"]' instead

It looks like the default dpi_scaling mode is stretch and changing it to literally any other value fixes the problem but only if it's set after import arcade

This works:

import pyglet
import arcade

pyglet.options.dpi_scaling = "wtf"

Printed out dpi_scaling after each import

import pyglet
print("PYGLET:", pyglet.options.dpi_scaling) # PYGLET: real
import arcade
print("ARCADE:", pyglet.options.dpi_scaling) # ARCADE: stretch

kmecpp avatar Nov 04 '25 02:11 kmecpp