summarylogtreecommitdiffstats
path: root/add-hidpi-support.patch
blob: 5591f7a82ea6b6a672aeefc27dea4c13796b50e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/ion/src/simulator/shared/window.cpp b/ion/src/simulator/shared/window.cpp
index 2275a99450..80b9514a7a 100644
--- a/ion/src/simulator/shared/window.cpp
+++ b/ion/src/simulator/shared/window.cpp
@@ -23,6 +23,16 @@ static SDL_Rect sScreenRect;
 bool isHeadless() { return sWindow == nullptr; }
 
 void init() {
+  /*
+   * This app is known to work just fine under the Wayland driver,
+   * so make that driver the default when on a Wayland compositor.
+   * Users can still override by setting the `SDL_VIDEODRIVER`
+   * environment variable to `x11`.
+   */
+  if (getenv("WAYLAND_DISPLAY")) {
+    SDL_SetHint(SDL_HINT_VIDEODRIVER, "wayland,x11");
+  }
+
   if (SDL_Init(SDL_INIT_VIDEO) != 0) {
     SDL_Log("Could not init video");
     return;