Skip to content

Commit

Permalink
fix: automerge and overlay
Browse files Browse the repository at this point in the history
Signed-off-by: Anthony Rabbito <[email protected]>
  • Loading branch information
anthr76 committed Jun 30, 2024
1 parent 404332f commit b16fc8b
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"enabled": true
},
"lockFileMaintenance": {
"enabled": true
"enabled": true,
"automerge": true
}
}
14 changes: 7 additions & 7 deletions home-manager/users/anthony/linux.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
"x-scheme-handler/tg" = "org.telegram.desktop.desktop";
};
defaultApplications = {
"text/html" = "firefox.desktop";
"x-scheme-handler/http" = "firefox.desktop";
"x-scheme-handler/https" = "firefox.desktop";
"x-www-browser" = "firefox.desktop";
"x-scheme-handler/about" = "firefox.desktop";
"x-scheme-handler/unknown" = "firefox.desktop";
"application/pdf" = "firefox.desktop";
"text/html" = "chromium-browser.desktop ";
"x-scheme-handler/http" = "chromium-browser.desktop ";
"x-scheme-handler/https" = "chromium-browser.desktop ";
"x-www-browser" = "chromium-browser.desktop ";
"x-scheme-handler/about" = "chromium-browser.desktop ";
"x-scheme-handler/unknown" = "chromium-browser.desktop ";
"application/pdf" = "chromium-browser.desktop ";
"x-scheme-handler/element" = "element-desktop.desktop";
};
};
Expand Down
5 changes: 5 additions & 0 deletions nixos/hosts/fw1-nwk3/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ in
}
];
subnet = "192.168.17.0/24";
id = 17;
option-data = [
{
name = "routers";
Expand All @@ -82,6 +83,7 @@ in
}
];
subnet = "192.168.16.0/24";
id = 16;
option-data = [
{
name = "routers";
Expand All @@ -96,6 +98,7 @@ in
}
];
subnet = "10.40.99.0/24";
id = 99;
option-data = [
{
name = "routers";
Expand All @@ -110,6 +113,7 @@ in
}
];
subnet = "192.168.14.0/24";
id = 14;
option-data = [
{
name = "routers";
Expand All @@ -124,6 +128,7 @@ in
}
];
subnet = "192.168.13.0/24";
id = 13;
option-data = [
{
name = "routers";
Expand Down
1 change: 1 addition & 0 deletions overlays/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
patches = oldAttrs.patches ++ [
./gamescope-native-res.patch
./0001-allow-gamescope-to-set-ctx-priority.patch
./gamescope-overlay.patch
];
});
logiops = prev.logiops.overrideAttrs (oldAttrs: {
Expand Down
74 changes: 74 additions & 0 deletions overlays/gamescope-overlay.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
From f8dcccb8b6f8269e1f4c53171012dd36bd7d332b Mon Sep 17 00:00:00 2001
From: Anthony Rabbito <[email protected]>
Date: Sun, 30 Jun 2024 18:18:18 -0400
Subject: [PATCH] ./1232.patch

---
src/main.cpp | 2 ++
src/steamcompmgr.cpp | 9 ++++++++-
2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/main.cpp b/src/main.cpp
index 31bee29..8246f2c 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -120,6 +120,7 @@ const struct option *gamescope_options = (struct option[]){
{ "debug-hud", no_argument, nullptr, 'v' },
{ "debug-events", no_argument, nullptr, 0 },
{ "steam", no_argument, nullptr, 'e' },
+ { "overlay-workaround", no_argument, nullptr, 0 },
{ "force-composition", no_argument, nullptr, 'c' },
{ "composite-debug", no_argument, nullptr, 0 },
{ "disable-xres", no_argument, nullptr, 'x' },
@@ -184,6 +185,7 @@ const char usage[] =
" -T, --stats-path write statistics to path\n"
" -C, --hide-cursor-delay hide cursor image after delay\n"
" -e, --steam enable Steam integration\n"
+ " --overlay-workaround workaround steam overlay's issues with wayland by allowing the overlay attach to the game rather than gamescope\n"
" --xwayland-count create N xwayland servers\n"
" --prefer-vk-device prefer Vulkan device for compositing (ex: 1002:7300)\n"
" --force-orientation rotate the internal display (left, right, normal, upsidedown)\n"
diff --git a/src/steamcompmgr.cpp b/src/steamcompmgr.cpp
index 25630b0..f671b6e 100644
--- a/src/steamcompmgr.cpp
+++ b/src/steamcompmgr.cpp
@@ -948,6 +948,7 @@ static bool debugEvents = false;
extern bool steamMode;

gamescope::ConVar<bool> cv_composite_force{ "composite_force", false, "Force composition always, never use scanout" };
+bool overlayWorkaround = false;
static bool useXRes = true;

struct wlr_buffer_map_entry {
@@ -6325,6 +6326,10 @@ spawn_client( char **argv, bool bAsyncChild )
const char *pchCurrentPreload = getenv( "LD_PRELOAD" );
bool bFirst = true;

+ if( overlayWorkaround ){
+ xwm_log.debugf( "Working around steam overlay" );
+ }
+
if ( pchCurrentPreload != nullptr )
{
pchPreloadCopy = strdup( pchCurrentPreload );
@@ -6345,7 +6350,7 @@ spawn_client( char **argv, bool bAsyncChild )
// If there's a string and it's not gameoverlayrenderer, append it to our new LD_PRELOAD
if ( pchPreloadCopy[ i ] != '\0' )
{
- if ( strstr( pchPreloadCopy + i, "gameoverlayrenderer.so" ) == nullptr )
+ if ( overlayWorkaround || strstr( pchPreloadCopy + i, "gameoverlayrenderer.so" ) == nullptr )
{
if ( bFirst == false )
{
@@ -7199,6 +7204,8 @@ steamcompmgr_main(int argc, char **argv)
debugFocus = true;
} else if (strcmp(opt_name, "synchronous-x11") == 0) {
synchronize = true;
+ } else if (strcmp(opt_name, "overlay-workaround") == 0) {
+ overlayWorkaround = true;
} else if (strcmp(opt_name, "debug-events") == 0) {
debugEvents = true;
} else if (strcmp(opt_name, "cursor") == 0) {
--
2.45.1

0 comments on commit b16fc8b

Please sign in to comment.