Bug 494467 - Reset Calibration Option
Summary: Reset Calibration Option
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_tablet (show other bugs)
Version: 6.2.0
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-10-10 16:35 UTC by donovan.delaughter
Modified: 2025-04-12 17:47 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.3.0
Sentry Crash Report:


Attachments
Broken calibration (45.76 KB, image/png)
2025-02-05 15:55 UTC, Sollace
Details

Note You need to log in before you can comment on or make changes to this bug.
Description donovan.delaughter 2024-10-10 16:35:05 UTC
SUMMARY
There is no way to reset the calibration on the tablet to default. This is important because in the case the tablet calibration is performed incorrectly, it will be impossible to complete the calibration to fix it (as the calibration matrix misses some regions of the screen).

STEPS TO REPRODUCE
1. Start calibrating your tablet
2. Make a mistake when calibrating such that the input is on the wrong side of the screen
3. Your tablet is now in an unusable state with no way to reset it

OBSERVED RESULT
Broken tablet configuration with no way to revert

EXPECTED RESULT
A button to reset calibration to default so I can re-attempt the calibration.

SOFTWARE/OS VERSIONS
Linux: Arch Linux
KDE Plasma Version: 6.20
Comment 1 Nate Graham 2024-10-10 19:57:55 UTC
Can't you just re-run the calibration wizard and start over with a new calibration?
Comment 2 donovan.delaughter 2024-10-11 13:54:55 UTC
(In reply to Nate Graham from comment #1)
> Can't you just re-run the calibration wizard and start over with a new
> calibration?

The issue is that when you re-run the calibration wizard, it starts by default with your existing configuration as opposed to a blank one. I was able to actually fix my issue by mashing through the calibration wizard and then using my mouse to click "Calibrate from scratch". The trick was also finding where on my tablet I could hold the pen to make the cursor show on screen.
Comment 3 donovan.delaughter 2024-10-11 14:16:51 UTC
Here is a video link of me demonstrating the issue. Prior to going in, I just double tapped one corner to simulate what a misinput would look like. This configuration is so bad that I actually can't use my fix to restart the calibration from scratch. https://youtu.be/I1VDmtXyD9U
Comment 4 Martyna Kowalska 2024-10-12 10:15:54 UTC
I ran into the same problem, the calibration got so bad that I can't reset it in any way. Does anyone know, as a workaround, if the tool edits some config file I can manually modify to change the calibration? Couldn't find anything in the docs.
Comment 5 Martyna Kowalska 2024-10-12 10:34:07 UTC
(In reply to Martyna Kowalska from comment #4)
> I ran into the same problem, the calibration got so bad that I can't reset
> it in any way. Does anyone know, as a workaround, if the tool edits some
> config file I can manually modify to change the calibration? Couldn't find
> anything in the docs.

As a follow-up, connecting a different tablet at the same time and using it to recalibrate the broken one from scratch somehow worked.
Comment 6 Joshua Goins 2024-10-14 23:17:26 UTC
Fixed this but didn't reference the bug: https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/2576
Comment 7 Sollace 2025-02-05 15:53:22 UTC
Using plasma 6.2.5 and I am having this problem. My calibration was messed up and I'm unable to recalibrate it. Three of the points are off the screen and my stylus does not map to any point on any of the screens that I can see.

Clicking "Defaults" doesn't appear to do anything.

Can the calibration program not just have a "start from scratch" button when you launch it?
Comment 8 Sollace 2025-02-05 15:55:13 UTC
Created attachment 177994 [details]
Broken calibration
Comment 9 Sollace 2025-02-05 16:10:48 UTC
As a workaround (thanks to the people over at endeavoros who documented it over here https://forum.endeavouros.com/t/reset-pen-tablet-calibration/64464/6 ):

I was able to reset it manually by editing ~/.config/kcminputrc to remove "CalibrationMatrix" line.

#CalibrationMatrix=-5.252659320831299e-07,-0.5096684098243713,1.5764576059493218e-12,0,-1.6921096630539978e-06,0.6959778070449829,2.694799068679414e-14,0,0,0,1,0,0,0,0,1

After a reboot the tablet is working again, though I don't intend on using the calibration function any time soon. Overall experience is it doesn't work very well and I'm able to get better results by using OpenTabletDriver and adjusting the X/Y/Width/Height values in there.
Comment 10 Joshua Goins 2025-02-06 02:25:11 UTC
(In reply to Sollace from comment #7)
> Clicking "Defaults" doesn't appear to do anything.

Note that this specific part of the bug is fixed in 6.3, so hitting the "Reset" and "Defaults" buttons should work as expected wrt calibration matrix.
Comment 11 Bug Janitor Service 2025-02-06 03:21:00 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/2793
Comment 12 Sollace 2025-02-08 22:48:51 UTC
(In reply to Joshua Goins from comment #10)
> (In reply to Sollace from comment #7)
> > Clicking "Defaults" doesn't appear to do anything.
> 
> Note that this specific part of the bug is fixed in 6.3, so hitting the
> "Reset" and "Defaults" buttons should work as expected wrt calibration
> matrix.

Wonderful!

And sorry, since the bug was marked as fixed in 6.2.1 it was my expectation it should have been fixed in 6.2.5 (my current version). If it won't be fixed in 6.3 can the bug tracker be updated to reflect that?

Thanks.
Comment 13 Sollace 2025-03-10 16:16:02 UTC
Confirmed not working in 6.3.2. Clicking "Defaults" and then "Apply" does not reset the projection matrix.
Comment 14 Joshua Goins 2025-04-12 17:47:10 UTC
Git commit c39dff0352f24d9e40da1b9c4f8c5bdaca927876 by Joshua Goins.
Committed on 12/04/2025 at 17:33.
Pushed by redstrate into branch 'master'.

kcms/tablet: Add a confirmation before saving calibration settings

There's still a UX issue with the calibration tool, where it's easy to
create a broken calibration matrix that makes the device unusable and
there's no clear way to reset it back to a usable state.

This tries to fix it from multiple angles:
1. Add a reset timer and a new confirmation stage to the calibration
process. This should ensure the user has consciously tested the new
calibration before stopping the process.
2. Add a reset button next to the "Calibrate" button to reset it back to
default. This does the same thing as the "Defaults" button without
resetting the rest of your tablet settings.
3. Add a label that states that if your tablet no longer works, try resetting
the calibration matrix first.

M  +1    -4    kcms/libkwindevices/inputdevice.cpp
M  +7    -0    kcms/libkwindevices/inputdevice.h
M  +124  -75   kcms/tablet/calibrationtool.cpp
M  +42   -7    kcms/tablet/calibrationtool.h
M  +10   -6    kcms/tablet/tests/tst_calibrationtool.cpp
M  +28   -14   kcms/tablet/ui/Calibration.qml
M  +60   -36   kcms/tablet/ui/StylusTab.qml

https://invent.kde.org/plasma/plasma-desktop/-/commit/c39dff0352f24d9e40da1b9c4f8c5bdaca927876