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

Ignore missing feedback api #6176

Merged
merged 3 commits into from
Feb 6, 2024
Merged

Conversation

Feodor0090
Copy link
Contributor

@smoogipoo
Copy link
Contributor

I think it'd be better if this was try-caught in the native function, for if anything else uses it they'd need to be aware that this is the case.

Also, can you test that calling another function like GetSystemMetrics() from that class doesn't crash? The way I remember these used to work is that they were TypeLoadExceptions or similar (basically as part of the static constructor), while that doesn't look to be the case here.

@Feodor0090
Copy link
Contributor Author

TL:DR; it works.

diff --git a/osu.Framework/Platform/Windows/WindowsWindow.cs b/osu.Framework/Platform/Windows/WindowsWindow.cs
index fa4c144a4..7be5cb008 100644
--- a/osu.Framework/Platform/Windows/WindowsWindow.cs
+++ b/osu.Framework/Platform/Windows/WindowsWindow.cs
@@ -6,6 +6,7 @@
 using System.Runtime.InteropServices;
 using System.Runtime.Versioning;
 using osu.Framework.Input.Handlers.Mouse;
+using osu.Framework.Logging;
 using osu.Framework.Platform.SDL2;
 using osu.Framework.Platform.Windows.Native;
 using osuTK;
@@ -87,6 +88,10 @@ public override void Create()
             foreach (var feedbackType in Enum.GetValues<FeedbackType>())
                 Native.Input.SetWindowFeedbackSetting(WindowHandle, feedbackType, false);
 
+            // another native call:
+            var rect = Native.Input.GetVirtualScreenRect();
+            Logger.Log($"Virtual screen rect: {rect.X}:{rect.Y} {rect.Width}x{rect.Height}");
+
             // enable window message events to use with `OnSDLEvent` below.
             SDL.SDL_EventState(SDL.SDL_EventType.SDL_SYSWMEVENT, SDL.SDL_ENABLE);
         }

1707229158.runtime.log

Copy link
Contributor

@smoogipoo smoogipoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty happy this in even if we don't support Windows 7 anymore. We should try support as far back as possible in general imo.

@smoogipoo smoogipoo merged commit bb8922f into ppy:master Feb 6, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants