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
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