From 05f52653d586406d022c60c64f57656e742fd255 Mon Sep 17 00:00:00 2001 From: Axel Date: Thu, 31 Mar 2022 10:55:12 +0200 Subject: [PATCH 1/2] Fix building on windows At some point it's probably useful to use windows-latest again --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 64da0c4..6557008 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -76,7 +76,7 @@ jobs: ldd build/src/plugin/datareftool.xpl build-win: - runs-on: windows-latest + runs-on: windows-2019 steps: - name: Install dependencies run: vcpkg install libpng:x64-windows-static From ebe8a0207168fa96af1ee473b0ecb7d050ea229a Mon Sep 17 00:00:00 2001 From: Axel Date: Thu, 31 Mar 2022 10:59:48 +0200 Subject: [PATCH 2/2] Multi monitor fix Fix issue #82 --- lib/lb_xplane_ui/window11.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/lb_xplane_ui/window11.h b/lib/lb_xplane_ui/window11.h index fb95e0e..a01913a 100644 --- a/lib/lb_xplane_ui/window11.h +++ b/lib/lb_xplane_ui/window11.h @@ -129,6 +129,19 @@ class Window11Base { } // Centered on main screen +#ifdef XPLM300 + void setWindowCentered() { + int screen_left, screen_top, screen_right, screen_bottom; + XPLMGetScreenBoundsGlobal(&screen_left, &screen_top, &screen_right, &screen_bottom); + int screen_width = screen_right - screen_left; + int screen_height = screen_top - screen_bottom; + int left = screen_left + screen_width / 2 - getWidth() / 2; + int right = left + getWidth(); + int bottom = screen_bottom + screen_height / 2 - getHeight() / 2; + int top = bottom + getHeight(); + setWindowBounds(Rect{left, top, right, bottom}); + } +#else void setWindowCentered() { int screen_width, screen_height; XPLMGetScreenSize(&screen_width, &screen_height); @@ -138,6 +151,7 @@ class Window11Base { int bottom = screen_height / 2 - getHeight() / 2; setWindowBounds(Rect{left, top, right, bottom}); } +#endif void setWindowResizeLimits([[maybe_unused]] int min_width, [[maybe_unused]] int min_height, [[maybe_unused]] int max_width, [[maybe_unused]] int max_height) { #ifdef XPLM300