|
6 | 6 | using System.Diagnostics;
|
7 | 7 | using osu.Framework.Bindables;
|
8 | 8 | using osu.Framework.Extensions.EnumExtensions;
|
| 9 | +using osu.Framework.Input.Handlers.Pen; |
9 | 10 | using osu.Framework.Input.StateChanges;
|
10 | 11 | using osu.Framework.Platform;
|
11 | 12 | using osu.Framework.Statistics;
|
@@ -37,8 +38,6 @@ public class MouseHandler : InputHandler, IHasCursorSensitivity, INeedsMousePosi
|
37 | 38 | Precision = 0.01
|
38 | 39 | };
|
39 | 40 |
|
40 |
| - public override bool IsOsCursor => true; |
41 |
| - |
42 | 41 | public override string Description => "Mouse";
|
43 | 42 |
|
44 | 43 | public override bool IsActive => true;
|
@@ -139,12 +138,16 @@ public override bool Initialize(GameHost host)
|
139 | 138 | return true;
|
140 | 139 | }
|
141 | 140 |
|
142 |
| - public virtual void FeedbackMousePositionChange(Vector2 position, bool isSelfFeedback, bool isOsCursor) |
| 141 | + public virtual void FeedbackMousePositionChange(Vector2 position, InputHandler handler) |
143 | 142 | {
|
144 | 143 | if (!Enabled.Value)
|
145 | 144 | return;
|
146 | 145 |
|
147 |
| - if (!isSelfFeedback && !isOsCursor && isActive.Value) |
| 146 | + // https://github.com/ppy/osu/issues/31948 |
| 147 | + // Pen malfunctions if MouseHandler tries to move the mouse cursor to pen position on Linux/X11. |
| 148 | + bool disableUpdatingMousePosition = handler is PenHandler && RuntimeInfo.OS == RuntimeInfo.Platform.Linux && FrameworkEnvironment.UseSDL3; |
| 149 | + |
| 150 | + if (handler != this && isActive.Value && !disableUpdatingMousePosition) |
148 | 151 | // if another handler has updated the cursor position, handle updating the OS cursor so we can seamlessly revert
|
149 | 152 | // to mouse control at any point.
|
150 | 153 | window.UpdateMousePosition(position);
|
|
0 commit comments