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.
=============================== 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.
=============================== 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.
(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?
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. touchpad_ active. touchpad_ active checks if toucpad is the only one pointer device on the platform, it will make touchpad always enabled. touchpad_ active only changes the gsettings entries but leave the device disabled.
1-b) However after touchpad is disabled, device_removed_cb is invoked, and it then calls ensure_
1-c) The ensure_
1-d) However ensure_
* Press Fn+F9 to disable touchpad
======= ======= ======= ======= === 1st TOUCHPAD HOTKEY TRIGGER START ======= ======= ======= ======= ===
(lt-usd- test-mouse: 16396): mouse-plugin-DEBUG: === DEBUG touchpad_callback ENTER === test-mouse: 16396): mouse-plugin-DEBUG: +++(1) gsettings KEY_TOUCHPAD_ ENABLED value: 0 test-mouse: 16396): mouse-plugin-DEBUG: Trying to set device disabled for "ETPS/2 Elantech Touchpad" (12) test-mouse: 16396): mouse-plugin-DEBUG: Disabled device "ETPS/2 Elantech Touchpad" (12) test-mouse: 16396): mouse-plugin-DEBUG: +++(2) KEY_TOUCHPAD_ ENABLED, value=0 +++ test-mouse: 16396): mouse-plugin-DEBUG: === DEBUG touchpad_callback EXIT === test-mouse: 16396): mouse-plugin-DEBUG: === DEBUG device_removed_cb ENTER === test-mouse: 16396): mouse-plugin-DEBUG: === DEBUG ensure_ touchpad_ active ENTER ===, gsettings key: 0 test-mouse: 16396): mouse-plugin-DEBUG: === DEBUG touchpad_callback ENTER === test-mouse: 16396): mouse-plugin-DEBUG: +++(2) KEY_TOUCHPAD_ ENABLED, value=1 +++ test-mouse: 16396): mouse-plugin-DEBUG: === DEBUG touchpad_callback EXIT === test-mouse: 16396): mouse-plugin-DEBUG: === DEBUG ensure_ touchpad_ active EXIT ===, gsettings key: 1 test-mouse: 16396): mouse-plugin-DEBUG: === DEBUG device_removed_cb EXIT ===
(lt-usd-
(lt-usd-
(lt-usd-
(lt-usd-
(lt-usd-
(lt-usd-
(lt-usd-
(lt-usd-
(lt-usd-
(lt-usd-
(lt-usd-
(lt-usd-
======= ======= ======= ======= === 1st TOUCHPAD HOTKEY TRIGGER END ======= ======= ======= ======= ===
2-a) Press Fn+F9 again the touchpad is still disabled. ENABLED is set to 0 (FALSE), I think it is changed by usd-media-key.
2-b) The gsettings KEY_TOUCHPAD_
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 === test-mouse: 16396): mouse-plugin-DEBUG: +++(2) KEY_TOUCHPAD_ ENABLED, value=0 +++ test-mouse: 16396): mouse-plugin-DEBUG: === DEBUG touchpad_callback EXIT ===
(lt-usd-
(lt-usd-
======= ======= ======= ======= === 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 === test-mouse: 16396): mouse-plugin-DEBUG: +++(2) KEY_TOUCHPAD_ ENABLED, value=1 +++ test-mouse: 16396): mouse-plugin-DEBUG: @@@ set_toucpad_enabled :12 @@@ test-mouse: 16396): mouse-plugin-DEBUG: Trying to set device enabled for 12 test-mouse: 16396): mouse-plugin-DEBUG: Enabled device 12 test-mouse: 16396): mouse-plugin-DEBUG: === DEBUG touchpad_callback EXIT === test-mouse: 16396): mouse-plugin-DEBUG: === DEBUG device_added_cb ENTER === test-mouse: 16396): mouse-plugin-DEBUG: setting handedness on ETPS/2 Elantech Touchpad test-mouse: 16396): mouse-plugin-DEBUG: setting tap to click on ETPS/2 Elantech Touchpad test-mouse: 16396): mouse-plugin-DEBUG: setting motion on ETPS/2 Elantech Touchpad test-mouse: 16396): mouse-plugin-DEBUG: Setting accel -1/-1, threshold -1 for device 'ETPS/2 Elantech Touchpad' test-mouse: 16396): mouse-plugin-DEBUG: setting tap to click on ETPS/2 Elantech Touchpad test-mouse: 16396): mouse-plugin-DEBUG: setting edge scroll on ETPS/2 Elantech Touchpad test-mouse: 16396): mouse-plugin-DEBUG: setting horiz scroll on ETPS/2 Elantech Touchpad test-mouse: 16396): mouse-plugin-DEBUG: Trying to set normal scroll for "ETPS/2 Elantech Touchpad" test-mouse: 16396): mouse-plugin-DEBUG: === DEBUG device_added_cb EXIT ===
(lt-usd-
(lt-usd-
(lt-usd-
(lt-usd-
(lt-usd-
(lt-usd-
(lt-usd-
(lt-usd-
(lt-usd-
(lt-usd-
(lt-usd-
(lt-usd-
(lt-usd-
(lt-usd-
(lt-usd-
======= ======= ======= ======= === 3rd TOUCHPAD HOTKEY TRIGGER END ======= ======= ======= ======= ===
According to my analysis, the touchpad disable hotkey should work fine if ensure_ touchpad_ active does nothing. daemon, this function is added because of the issue: /bugzilla. gnome.org/ show_bug. cgi?id= 685941
I looks the changelog in unity-settings-
https:/
I think users should be able to disable the touchpad if there has control keys. touchpad_ active this function?
Should we keep ensure_