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