Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6093f102 authored by Josh Thielen's avatar Josh Thielen
Browse files

Fix touch reset when enable state is unchanged

Bug: 267543995
Test: Manual
Change-Id: I6233f4a0bab8b2b1a3aae1af4f09fd6866c554fd
parent 63c9d5cf
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -1159,6 +1159,8 @@ void NativeInputManager::setTouchpadRightClickZoneEnabled(bool enabled) {
}

void NativeInputManager::setInputDeviceEnabled(uint32_t deviceId, bool enabled) {
    bool refresh = false;

    { // acquire lock
        std::scoped_lock _l(mLock);

@@ -1166,15 +1168,19 @@ void NativeInputManager::setInputDeviceEnabled(uint32_t deviceId, bool enabled)
        bool currentlyEnabled = it == mLocked.disabledInputDevices.end();
        if (!enabled && currentlyEnabled) {
            mLocked.disabledInputDevices.insert(deviceId);
            refresh = true;
        }
        if (enabled && !currentlyEnabled) {
            mLocked.disabledInputDevices.erase(deviceId);
            refresh = true;
        }
    } // release lock

    if (refresh) {
        mInputManager->getReader().requestRefreshConfiguration(
                InputReaderConfiguration::Change::ENABLED_STATE);
    }
}

void NativeInputManager::setShowTouches(bool enabled) {
    { // acquire lock