Skip to content

Commit

Permalink
update pkgrel and re-add a missing alt-tab refinement patch
Browse files Browse the repository at this point in the history
  • Loading branch information
whrvt committed Sep 15, 2024
1 parent b7d6d49 commit a0e8cb9
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 5c8c060fc9d1d20eebe12da2e6dacddd88c07d82 Mon Sep 17 00:00:00 2001
From: Torge Matthies <[email protected]>
Date: Sun, 26 Nov 2023 18:29:53 +0100
Subject: [PATCH] HACK: Fix osu! alt-tab.
Subject: [PATCH 1/2] HACK: Fix osu! alt-tab.

---
dlls/win32u/window.c | 4 ++++
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
From 719056116394fc694ed307352d0ed877aca6ceae Mon Sep 17 00:00:00 2001
From: NelloKudo <[email protected]>
Date: Tue, 11 Jun 2024 17:33:35 +0200
Subject: [PATCH 2/2] HACK: Add WM specific flags for osu alt tab fix.

Edit of the original patch from openglfreak that fixed focus-in when running osu! as fullscreen:
adding such flags breaks alt-tabbing in Windowed mode on GNOME and KDE, forcing osu! to stay on top of other apps.
This depends on Proton's WM detection function.
---
dlls/win32u/window.c | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c
index 11111111111..11111111111 100644
--- a/dlls/win32u/window.c
+++ b/dlls/win32u/window.c
@@ -3447,10 +3447,23 @@ BOOL set_window_pos( WINDOWPOS *winpos, int parent_x, int parent_y )

orig_flags = winpos->flags;

- /* HACK: fix osu! taking back focus immediately when it is unfocused. */
+ LONG_PTR wm = __wine_get_window_manager();
+
+ /* HACK: fix osu! taking back focus immediately when it is unfocused depending on WM */
if (winpos->hwndInsertAfter == HWND_NOTOPMOST &&
- (get_window_long( winpos->hwnd, GWL_EXSTYLE ) & WS_EX_TOPMOST))
- winpos->flags |= SWP_NOACTIVATE | SWP_NOZORDER;
+ (get_window_long(winpos->hwnd, GWL_EXSTYLE) & WS_EX_TOPMOST))
+ {
+ /* If on KDE or GNOME, alt-tab on Fullscreen AND Windowed only works without the SWP_NOZORDER flag. */
+ if (wm == WINE_WM_X11_KDE || wm == WINE_WM_X11_MUTTER)
+ {
+ winpos->flags |= SWP_NOACTIVATE | SWP_NOOWNERZORDER;
+ }
+ /* In any other case, SWP_NOZORDER is enough to get the game working fine and not take focus on other apps when windowed. */
+ else
+ {
+ winpos->flags |= SWP_NOACTIVATE | SWP_NOZORDER;
+ }
+ }

/* First, check z-order arguments. */
if (!(winpos->flags & SWP_NOZORDER))
--
0.0.0
2 changes: 1 addition & 1 deletion setup.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
pkgrel=9-1
pkgrel=9-3
pkgname="proton-osu-${pkgrel}"
buildname="proton-osu"
protonurl=https://github.com/CachyOS/proton-cachyos.git
Expand Down

0 comments on commit a0e8cb9

Please sign in to comment.