Fix crash in the touchpad kded
AbandonedPublic

Authored by aacid on Jun 19 2019, 8:53 PM.

Details

Reviewers
None
Summary

My libinput touchpad doesn't have an enabled atom so doing

*m_atoms[QLatin1Literal("enabled")].data()

and then using that atom ends up with a crash

So instead of asking the atom out, just pass the atom to compare in

Test Plan

Unfortunately i can't really really reproduce the crash, it just happens every other day, so i can only say "this code is safer and should crash less"

Diff Detail

Repository
R119 Plasma Desktop
Branch
Plasma/5.16
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 12988
Build 13006: arc lint + arc unit
aacid created this revision.Jun 19 2019, 8:53 PM
Restricted Application added a project: Plasma. · View Herald TranscriptJun 19 2019, 8:53 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
aacid requested review of this revision.Jun 19 2019, 8:53 PM
aacid updated this revision to Diff 60091.Jun 19 2019, 8:53 PM

-mutable

aacid added a comment.Jun 19 2019, 8:54 PM

The other question is if "enabled" was ever the correct atom to check for

In my system the atoms names are
libinput Send Events Mode Enabled
libinput Send Events Mode Enabled Default
libinput Send Events Modes Available
libinput Left Handed Enabled Default
libinput Left Handed Enabled
libinput Disable While Typing Enabled Default
libinput Disable While Typing Enabled
libinput Middle Emulation Enabled Default
libinput Middle Emulation Enabled
libinput Tapping Enabled
libinput Tapping Enabled Default
libinput Tapping Button Mapping Default
libinput Tapping Button Mapping Enabled
libinput Tapping Drag Enabled Default
libinput Tapping Drag Enabled
libinput Tapping Drag Lock Enabled Default
libinput Tapping Drag Lock Enabled
libinput Accel Speed Default
libinput Accel Speed
libinput Accel Profiles Available
libinput Accel Profile Enabled Default
libinput Accel Profile Enabled
libinput Natural Scrolling Enabled Default
libinput Natural Scrolling Enabled
libinput Horizontal Scroll Enabled
libinput Scroll Methods Available
libinput Scroll Method Enabled Default
libinput Scroll Method Enabled
libinput Button Scrolling Button Default
libinput Button Scrolling Button
libinput Click Methods Available
libinput Click Method Enabled Default
libinput Click Method Enabled

The other question is if "enabled" was ever the correct atom to check for

libinput Tapping Enabled

I'm fairly sure we were checking for libinput Tapping Enabled atom in the past, and so does GNOME: https://gitlab.gnome.org/GNOME/gtk/blob/master/gdk/x11/gdkdevicemanager-xi2.c#L410

aacid added a subscriber: atulbi.Jun 20 2019, 6:05 PM

The other question is if "enabled" was ever the correct atom to check for

libinput Tapping Enabled

I'm fairly sure we were checking for libinput Tapping Enabled atom in the past, and so does GNOME: https://gitlab.gnome.org/GNOME/gtk/blob/master/gdk/x11/gdkdevicemanager-xi2.c#L410

I can't find any use of that, the current use of "enabled" was added by @atulbi

The other question is if "enabled" was ever the correct atom to check for

libinput Tapping Enabled

I'm fairly sure we were checking for libinput Tapping Enabled atom in the past, and so does GNOME: https://gitlab.gnome.org/GNOME/gtk/blob/master/gdk/x11/gdkdevicemanager-xi2.c#L410

I can't find any use of that, the current use of "enabled" was added by @atulbi

Whoops... It should be "libinput Send Events Mode Enabled" or LIBINPUT_PROP_SENDEVENTS_ENABLED rather than enabled. my bad ;) , Just replacing "enabled" fixes the issue :D