Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fullscreen on Linux doesn't quite stretch #453

Closed
MetalMaxMX opened this issue Mar 12, 2022 · 13 comments · Fixed by #1097
Closed

Fullscreen on Linux doesn't quite stretch #453

MetalMaxMX opened this issue Mar 12, 2022 · 13 comments · Fixed by #1097
Labels
bug Something isn't working

Comments

@MetalMaxMX
Copy link

Hi! So I am on Debian 11, x86_64 and I manually compiled ares and tried to test some games (Genesis, NES, etc.), there's a keybind for fullscreen on Linux but whenever I do that I don't get a fullscreen (like bsnes does) but rather a relatively tiny square at the corner of a screen, perhaps only outputting the original resolution without zooming in or something? I'd like to know if this is a bug or a configuration problem.

Cheers!
MetalMaxMX.

@Screwtapello
Copy link
Contributor

In Settings → Drivers, what video driver is ares using? If it's something like XShm, I'm not surprised it doesn't scale up — picking the OpenGL 3.2 driver will give you a much better experience.

@MetalMaxMX
Copy link
Author

Hi! I've tried with every driver that seems to work. OpenGL3.2, 2.0, X, etc. And everytime I do press the keybind (F11) to go fullscreen on Linux, it doesn't scale up. This however, does not happens on bsnes for instance, which is weird to me.

@Screwtapello
Copy link
Contributor

What window manager are you using?

@MetalMaxMX
Copy link
Author

Hey! I'm using XFCE with compositor disabled, XFCE 4.16 according to the version I have

@LukeUsher LukeUsher added the bug Something isn't working label Mar 14, 2022
@Datounejr
Copy link

To add some info, I came across the same issue running the latest Manjaro with XFCE. On another machine, also running the latest Manjaro but with Gnome under Wayland, fullscreen works as intended.
So on the first computer, I installed Cinnamon and ran it with the --replace argument (faster than logging out), fullscreen worked perfectly fine. The bug is 100% related to Xfwm4.

@ghost
Copy link

ghost commented Dec 5, 2022

I was about to submit a new issue for this, but found this issue thread.

This is also happening in Gamescope. I'm testing on the Steam Deck, in Game Mode (which uses Gamescope). In Desktop Mode (No Gamescope), fullscreen scales properly.

I can submit a separate issue, if they're not related, sorry!

@Screwtapello
Copy link
Contributor

So, here's what I think is going on.

In a single computer GUI like Windows or macOS, bsnes asks the OS to make a full-screen window, then the OS makes a full-screen window and says "here you go".

In a network-transparent GUI like X11, bsnes asks X11 to make a full-screen window, and X11 says "I'll pass that message on." X11 asks the window-manager to make a full-screen window, it does, then says to X11 "please notify the owner of this window that the width and height have changed". Eventually, at some later date while bsnes is doing something else, a notification arrives that the window is now full-screen.

Because bsnes' GUI is portable to Windows and macOS, it's built around the idea that asking for a full-screen window gets you a full-screen window immediately, not eventually. On X11, I think it sends the message and then waits for a notification that should mean the full-screen window is ready, then it proceeds as normal. Unfortunately, I think different window managers can send events in a different order, so if your window-manager does things differently, bsnes can get confused and pick a full-screen layout before the process is complete.

I guess this is a bug in bsnes, but I expect it would be really hard to fix.

@Sterophonick
Copy link

Bump. Still broken under Gamescope.

@endrift
Copy link

endrift commented Mar 20, 2023

How hard would saying "fuck X11" and adding Wayland support be? Gamescope is Wayland-based, so it'd cut out the need for X11 entirely.

@misyltoad
Copy link

Fwiw, Gamescope typically only supports XWayland clients. I recently added support for xdg-shell clients, but its not available by default (--expose-wayland) or preferable right now.

I can try and take a look at why it looks wrong in Gamescope.

@LukeUsher
Copy link
Member

I cannot reproduce this on ArchLinux using KDE/Wayland; using both the Flatpak and self compiled builds, fullscreen works as expected.

It does seem to be related to specific window managers somehow

@Castor215
Copy link

Castor215 commented Apr 29, 2023

I am having this issue on Debian Bookworm with XFCE. I have been poking around this issue and I think I found the problem. In ruby/video.cpp the function Video::monitor is called.

auto Video::monitor(string name) -> Monitor {
  auto monitors = Video::hasMonitors();
  //try to find by name if possible
  for(auto& monitor : monitors) {
    if(monitor.name == name) return monitor;
  }
  //fall back to primary if not found
  for(auto& monitor : monitors) {
    if(monitor.primary) return monitor;
  }
  //Video::monitors() should never let this occur
  Monitor monitor;
  monitor.name = "Primary";
  monitor.primary = true;
  monitor.x = 0;
  monitor.y = 0;
  monitor.width = 640;
  monitor.height = 480;
  return monitor;
}

When execution returns from hasMonitors(), the monitors vector has a single element with the name "DELL U2412M" (My monitor name).

Earlier a VideoGLX object is created with the name "Primary" - the code responsible is in video.hpp - the problem arises because Video::monitor is called with "Primary" as a parameter, but the only monitor in the vector is "DELL U2412M" so they don't match. Even though my monitor is the only one connected to my machine, it is not labelled as primary by default, so the fallback doesn't pick it up either. The small square OP is seeing is the default monitor at the bottom of the function, most likely.

@hristoast
Copy link

With d13715d fullscreen now works on my Steam Deck. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging a pull request may close this issue.

9 participants