FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Surface Pro 7+ / KDE Wayland: absolute stylus shows mouse cursor on proximity — working KWin patch · Issue #2250 · linux-surface/linux-surface · GitHub

Surface Pro 7+ / KDE Wayland: absolute stylus shows mouse cursor on proximity — working KWin patch #2250

Description

Hardware / software
Microsoft Surface Pro 7+
Intel i7-1165G7
Fedora 44 KDE Plasma / Wayland
linux-surface kernel: 6.19.8-3.surface.fc43.x86_64
iptsd-3.1.0-1.fc43.x86_64
KWin 6.6.4
Problem

With the Surface pen used as an absolute tablet tool, KWin displays the normal mouse cursor whenever the pen enters proximity.

I wanted normal tablet/stylus behaviour:

Pen enters proximity → mouse cursor hidden
Pen tip continues to work normally
Pen button/right-click continues to work
Moving a real mouse → normal mouse cursor appears
Bringing the pen back into proximity → cursor hides again

The issue appears to come from KWin rather than IPTSD/linux-surface.

In KWin 6.6.4, src/hide_cursor_spy.cpp contains:

void HideCursorSpy::tabletToolProximityEvent(TabletToolProximityEvent *event)
{
if (event->type == TabletToolProximityEvent::Type::LeaveProximity) {
if (!event->device->tabletToolIsRelative()) {
hideCursor();
}
} else {
showCursor();
}
}

This means entering proximity always calls showCursor(), including for an absolute pen.

Working patch

I changed the proximity-enter behaviour so absolute tablet tools hide the cursor, while relative tablet tools still show it:

void HideCursorSpy::tabletToolProximityEvent(TabletToolProximityEvent *event)
{
if (event->type == TabletToolProximityEvent::Type::LeaveProximity) {
if (!event->device->tabletToolIsRelative()) {
hideCursor();
}
} else {
if (!event->device->tabletToolIsRelative()) {
hideCursor();
} else {
showCursor();
}
}
}

I rebuilt KWin with this change and tested it on the Surface Pro 7+.

Result

The behaviour is now exactly what I was trying to achieve:

Absolute Surface pen proximity hides the cursor
Pen tip input works
Pen button/right-click works
Real mouse movement restores the normal mouse cursor
Pen proximity hides it again
Reapplying the KDE Drawing Tablet mapping does not bring the cursor back
Behaviour continues to work with or without an external keyboard/mouse connected

I have attached the source patch:

0001-hide-absolute-tablet-cursor.patch

I am posting this here because Surface users using IPTSD are likely to encounter it, although the actual behaviour appears to be implemented in KWin and may ultimately belong upstream in KDE/KWin.

I have also been investigating a separate intermittent Plasma/display stability issue on this machine. Current testing indicates that issue predates and is unrelated to this cursor patch; the patched system is currently stable.

0001-hide-absolute-tablet-cursor.patch

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


    Back | FazBrowse Home | New Git URL