AuroraViola / ChillyGB

ChillyGB is a Game Boy (DMG) and Game Boy Color (CGB) emulator written C
https://chillygb.arci.me/
GNU General Public License v3.0
14 stars 1 forks source link

Window viewport is broken with display scaling #1

Open klazoklazo opened 1 week ago

klazoklazo commented 1 week ago

Using GNOME 46 in Ubuntu 24.04.1 LTS here, and trying to use the emulator with any scaling causes the game viewport to be too small and pushed off to the bottom left.

Here's an example of how this looks with 200% scaling:

image

This applies to the rest of the UI as well, meaning that the menu bar as well as any windows within the main window are shrunken down the same:

image

Mouse actions still act as if the viewport is properly scaled to the full window's size, so despite the fact that the menu bar is pushed off to the bottom left, in order to access it you must still move your mouse around at the top left of the window.

This issue is not apparent with 100% scaling but seeing as I have a 4K monitor, this isn't a good workaround.

AuroraViola commented 1 week ago

What version are you using? Are you using the WASM port or the native Linux executable? I develop the emulator on Fedora 41 with GNOME 47 and this issue doesn't seams to happen

klazoklazo commented 1 week ago

I'm utilizing the native executable obtained from the releases page here. Using 0.3.0.

image

AuroraViola commented 1 week ago

Hm, strange bug. I made a VM with Ubuntu 24.04.1 LTS and I don't get this issue. immagine Are you using Wayland or X11?

klazoklazo commented 1 week ago

I'm using Wayland. I tried using Visual Boy Advance - M and also ended up with the same bug, so this GitHub issue might also be related: https://github.com/visualboyadvance-m/visualboyadvance-m/issues/1364

AuroraViola commented 1 week ago

Does the issue still happens on X11?

klazoklazo commented 1 week ago

I checked and no, it seems the issue does not persist when using the Xorg option at login.

Pasted image

scudo005 commented 1 week ago

Hi, can you test if this is an issue or not under xwayland? It's not perfect but it should work.

klazoklazo commented 1 week ago

image

I tried running the command GDK_BACKEND=x11 ./ChillyGB which creates the same issue albeit this time without any window decorations.

AuroraViola commented 1 week ago

It happens to be a Raylib building issue with the CI builds. If I use my OS Raylib libraries the issue doesn't show up

scudo005 commented 1 week ago

I think this issue is caused by poor Wayland support by Raylib.

I don't know how good X11 support is under GNOME's compositor running under Wayland, but to me it looks like it's a Raylib issue. They know about it and they're trying to work around Wayland's limitations, so I'd guess (and hope) that this issue will fix itself in future Raylib releases.

edit: I suggest running this application under X11 for now.

klazoklazo commented 1 week ago

Would you know how to run the application under X11 then? My attempt didn't seem to pan out too well in the sense that it did not fix the issue (I'm not even sure if it actually ended up running under X11).

scudo005 commented 1 week ago

Sorry, I meant under an X11 session. It's not a good idea, but it works.