Comment 1 for bug 1454950

Revision history for this message
Franz Hsieh (franz-hsieh) wrote :

I add some debug message in unity-settings-daemon/plugins/mouse module, and run tests.
Here are my founds:

1-a) Press Fn+F9, function touchpad_callback disables the touchpad.
1-b) However after touchpad is disabled, device_removed_cb is invoked, and it then calls ensure_touchpad_active.
1-c) The ensure_touchpad_active checks if toucpad is the only one pointer device on the platform, it will make touchpad always enabled.
1-d) However ensure_touchpad_active only changes the gsettings entries but leave the device disabled.

* Press Fn+F9 to disable touchpad

=============================== 1st TOUCHPAD HOTKEY TRIGGER START ===============================

(lt-usd-test-mouse:16396): mouse-plugin-DEBUG: === DEBUG touchpad_callback ENTER ===
(lt-usd-test-mouse:16396): mouse-plugin-DEBUG: +++(1) gsettings KEY_TOUCHPAD_ENABLED value: 0
(lt-usd-test-mouse:16396): mouse-plugin-DEBUG: Trying to set device disabled for "ETPS/2 Elantech Touchpad" (12)
(lt-usd-test-mouse:16396): mouse-plugin-DEBUG: Disabled device "ETPS/2 Elantech Touchpad" (12)
(lt-usd-test-mouse:16396): mouse-plugin-DEBUG: +++(2) KEY_TOUCHPAD_ENABLED, value=0 +++
(lt-usd-test-mouse:16396): mouse-plugin-DEBUG: === DEBUG touchpad_callback EXIT ===
(lt-usd-test-mouse:16396): mouse-plugin-DEBUG: === DEBUG device_removed_cb ENTER ===
(lt-usd-test-mouse:16396): mouse-plugin-DEBUG: === DEBUG ensure_touchpad_active ENTER ===, gsettings key: 0
(lt-usd-test-mouse:16396): mouse-plugin-DEBUG: === DEBUG touchpad_callback ENTER ===
(lt-usd-test-mouse:16396): mouse-plugin-DEBUG: +++(2) KEY_TOUCHPAD_ENABLED, value=1 +++
(lt-usd-test-mouse:16396): mouse-plugin-DEBUG: === DEBUG touchpad_callback EXIT ===
(lt-usd-test-mouse:16396): mouse-plugin-DEBUG: === DEBUG ensure_touchpad_active EXIT ===, gsettings key: 1
(lt-usd-test-mouse:16396): mouse-plugin-DEBUG: === DEBUG device_removed_cb EXIT ===

=============================== 1st TOUCHPAD HOTKEY TRIGGER END ===============================

2-a) Press Fn+F9 again the touchpad is still disabled.
2-b) The gsettings KEY_TOUCHPAD_ENABLED is set to 0 (FALSE), I think it is changed by usd-media-key.
2-c) I think because device is removed from the list, nothing happend in this stage.

* Press Fn+F9 to enable touchpad
=============================== 2nd TOUCHPAD HOTKEY TRIGGER START ===============================

(lt-usd-test-mouse:16396): mouse-plugin-DEBUG: === DEBUG touchpad_callback ENTER ===
(lt-usd-test-mouse:16396): mouse-plugin-DEBUG: +++(2) KEY_TOUCHPAD_ENABLED, value=0 +++
(lt-usd-test-mouse:16396): mouse-plugin-DEBUG: === DEBUG touchpad_callback EXIT ===

=============================== 2nd TOUCHPAD HOTKEY TRIGGER END ===============================

3-a) Press Fn+F9 again, the gsettings KEY_TOUCHPAD_ENABLED is set to 1(TRUE), it should be set by usd-media-key
3-b) The touchpad_callback eanbles touchpad.

* Press Fn+F9 to enable touchpad
=============================== 3rd TOUCHPAD HOTKEY TRIGGER START ===============================

(lt-usd-test-mouse:16396): mouse-plugin-DEBUG: === DEBUG touchpad_callback ENTER ===
(lt-usd-test-mouse:16396): mouse-plugin-DEBUG: +++(2) KEY_TOUCHPAD_ENABLED, value=1 +++
(lt-usd-test-mouse:16396): mouse-plugin-DEBUG: @@@ set_toucpad_enabled :12 @@@
(lt-usd-test-mouse:16396): mouse-plugin-DEBUG: Trying to set device enabled for 12
(lt-usd-test-mouse:16396): mouse-plugin-DEBUG: Enabled device 12
(lt-usd-test-mouse:16396): mouse-plugin-DEBUG: === DEBUG touchpad_callback EXIT ===
(lt-usd-test-mouse:16396): mouse-plugin-DEBUG: === DEBUG device_added_cb ENTER ===
(lt-usd-test-mouse:16396): mouse-plugin-DEBUG: setting handedness on ETPS/2 Elantech Touchpad
(lt-usd-test-mouse:16396): mouse-plugin-DEBUG: setting tap to click on ETPS/2 Elantech Touchpad
(lt-usd-test-mouse:16396): mouse-plugin-DEBUG: setting motion on ETPS/2 Elantech Touchpad
(lt-usd-test-mouse:16396): mouse-plugin-DEBUG: Setting accel -1/-1, threshold -1 for device 'ETPS/2 Elantech Touchpad'
(lt-usd-test-mouse:16396): mouse-plugin-DEBUG: setting tap to click on ETPS/2 Elantech Touchpad
(lt-usd-test-mouse:16396): mouse-plugin-DEBUG: setting edge scroll on ETPS/2 Elantech Touchpad
(lt-usd-test-mouse:16396): mouse-plugin-DEBUG: setting horiz scroll on ETPS/2 Elantech Touchpad
(lt-usd-test-mouse:16396): mouse-plugin-DEBUG: Trying to set normal scroll for "ETPS/2 Elantech Touchpad"
(lt-usd-test-mouse:16396): mouse-plugin-DEBUG: === DEBUG device_added_cb EXIT ===

=============================== 3rd TOUCHPAD HOTKEY TRIGGER END ===============================

According to my analysis, the touchpad disable hotkey should work fine if ensure_touchpad_active does nothing.
I looks the changelog in unity-settings-daemon, this function is added because of the issue:
  https://bugzilla.gnome.org/show_bug.cgi?id=685941

I think users should be able to disable the touchpad if there has control keys.
Should we keep ensure_touchpad_active this function?