Commit Graph

2407 Commits

Author SHA1 Message Date
Yaroslav Chvanov
40e1785bcc sinowealth: check for device compatibility as soon as possible 2023-03-07 03:13:23 +03:00
Yaroslav Chvanov
9a0972891a sinowealth: update the comment about profile count 2023-03-07 03:04:53 +03:00
Yaroslav Chvanov
224985e28c sinowealth: add command IDs for the third profile 2023-03-07 02:55:09 +03:00
Yaroslav Chvanov
3b7fc7a662 ratbagctl: show if a profile is dirty 2023-03-07 00:31:10 +03:00
Yaroslav Chvanov
c4ee9d707d ratbagd.py: sync with Piper
- Fix a regression of profile not getting dirty after property changes.
- Add `notify` signals for more things.
- Do some minor refactoring.
2023-03-07 00:23:14 +03:00
Yaroslav Chvanov
52e21d767d libratbag: take constant pointers where possible 2023-03-07 00:12:09 +03:00
Yaroslav Chvanov
364948c32a libratbag: remove fall back for Logitech devices
This should be unreachable because we `Driver` field must be set in
device files, otherwise they are ignored. Our tests also catch this.

Anyway, it's always better to be explicit about this.
2023-03-06 23:44:06 +03:00
Yaroslav Chvanov
e9604305d1 libratbag-data: use the dpi_list_free helper 2023-03-06 23:42:31 +03:00
Yaroslav Chvanov
2734bc17de libratbag-util: make dpi_list_free() be able to take NULL
free() can take NULL without errors, and so should such helper.
2023-03-06 23:41:40 +03:00
Yaroslav Chvanov
2a356736f7 Fix drivers making profiles dirty while probing
Fixes drivers calling public API functions which should only be called
by the consumers of the library. The real problem here is that we don't
have a clear separation between driver API and public API.
This is just a simple search and replace, so there be more such things.
2023-03-05 16:32:03 +03:00
Yaroslav Chvanov
822f37a68c libratbag: check if profile is dirty in sanity check 2023-03-05 16:32:03 +03:00
Yaroslav Chvanov
1df7316195 libratbag: check if driver supports committing
There could be segmentation faults with the openinput driver.
2023-03-05 16:32:03 +03:00
Yaroslav Chvanov
44af3f145d ratbagd.py: use the IsDirty property of the DBus API 2023-03-05 13:39:33 +03:00
Yaroslav Chvanov
f1118b5b64 ratbagd: add IsDirty property to profiles 2023-03-05 13:39:33 +03:00
Yaroslav Chvanov
3e42349daa libratbag: add API for checking if profile is dirty 2023-03-05 13:26:27 +03:00
Yaroslav Chvanov
9f031e58a1 libratbag: fix profile not becoming dirty on active profile switch 2023-03-05 13:25:53 +03:00
Yaroslav Chvanov
2b47f5b942 data: add Sinowealth Generic Mouse (258a:0051) 2023-03-05 05:42:36 +03:00
Yaroslav Chvanov
78f68d2470 data: add links to device issues with raw configuration data 2023-03-05 05:39:40 +03:00
Yaroslav Chvanov
4a0d906092 sinowealth: add support for PMW3212 sensor
Not tested if it needs off-by-one adjustment like some other sensors do.
Although it could've been an ideal opportunity to add support for all of
the possible sensors, I didn't do it for the same reason.
2023-03-05 05:39:40 +03:00
Yaroslav Chvanov
53f09ed8c7 sinowealth: add more debug logging for easier device file creation 2023-03-05 05:39:40 +03:00
Yaroslav Chvanov
f96c5e2499 sinowealth: fix incorrect placement of sensor_type in config data
Oh wow.
2023-03-05 05:39:40 +03:00
Matthias Bach
6a07d0ec9c build: install ratbagd into sbindir
Ratbagd requires to be run by root. It should thus live in the system binary
directory.
2023-03-04 22:00:02 +03:00
Yaroslav Chvanov
84e8e63752 libratbag: don't apply active profile change until committing 2023-03-04 04:07:32 +03:00
Yaroslav Chvanov
a3f0ea9a52 tools: skip linter checks if linters are not installed 2023-03-04 03:37:31 +03:00
Yaroslav Chvanov
4b8ac177d1 tools: print errors to stderr 2023-03-04 03:34:12 +03:00
Yaroslav Chvanov
0e3f909264 ratbagd.py: add back .keys() calls on all GLib.Variant
This causes crashes on Piper side.
2023-03-03 23:37:26 +03:00
Kyoken
3f1e0f09cc ratbagd.py: don't mark a profile as dirty on active profile switch 2023-03-03 15:40:06 +03:00
Yaroslav Chvanov
b0d3f86287 build: add a missing dependency to a test
This fixes tests failing if you run `meson test` without running a
`meson compile` first.
2023-03-02 14:24:57 +03:00
Yaroslav Chvanov
a9545b2b63 test: use a simply assert instead of using a helper 2023-03-02 14:05:37 +03:00
Yaroslav Chvanov
1d24aa71d3 build: use project-local build and source directories
I think it should be possible to embed libratbag as a meson subproject
now (not tested).
2023-03-02 13:58:21 +03:00
Yaroslav Chvanov
a00531fe8b lint: exit early if git ls-files doesn't find anything 2023-03-02 13:48:03 +03:00
Yaroslav Chvanov
265e1cee1a test: fix traceback.print_exception() usage on older Python versions 2023-03-02 05:48:40 +03:00
Yaroslav Chvanov
e7a738086c lint: enable flake8-return 2023-03-02 05:30:31 +03:00
Yaroslav Chvanov
40fb7430db lint: enable flake8-simplify 2023-03-02 05:30:30 +03:00
Yaroslav Chvanov
27d74ae0f0 Use 'a != b' instead of 'not a == b' 2023-03-02 05:30:30 +03:00
Yaroslav Chvanov
80fa7f5b8f Use 'key in dict' instead of 'key in dict.keys()' 2023-03-02 05:30:30 +03:00
Yaroslav Chvanov
78b56d6ea0 tools: make all exceptions types have Error as the sufix 2023-03-02 05:30:30 +03:00
Yaroslav Chvanov
e84a56c424 test: don't return anything from main() 2023-03-02 04:32:40 +03:00
Yaroslav Chvanov
04b77a3b9b test: raise ValueError instead of AssertionError manually 2023-03-02 04:32:40 +03:00
Yaroslav Chvanov
57323ac978 ratbagctl: remove unnecessary else 2023-03-02 04:32:40 +03:00
Yaroslav Chvanov
8455c3ea71 ratbagctl: use standard exception types 2023-03-02 04:32:40 +03:00
Yaroslav Chvanov
3252d57b50 ratbagctl: fix an incorrect type hint 2023-03-02 04:32:40 +03:00
Yaroslav Chvanov
4b506a4ece lint: enable flake8-pie lints 2023-03-02 04:32:40 +03:00
Yaroslav Chvanov
7551bdaeff tools: remove unnecessary pass statements 2023-03-02 04:32:40 +03:00
Yaroslav Chvanov
ef2049643c ratbagctl: use textwrap.indent instead of inventing the wheel ourselves 2023-03-02 04:32:39 +03:00
Yaroslav Chvanov
681153ad4d doc: add angle snapping and debounce time 2023-03-02 03:01:06 +03:00
Yaroslav Chvanov
382df65a5d sinowealth: implement debounce time reading/writing 2023-03-02 03:01:06 +03:00
Kyoken
51edc2967b add angle snapping and debounce 2023-03-02 02:59:42 +03:00
Yaroslav Chvanov
37628da52f Remove flake8 configuration file
We now use black and ruff instead.
2023-03-01 23:52:11 +03:00
Yaroslav Chvanov
1b2259a8cb ratbagctl: rename a member function to prevent incorrect overriding 2023-03-01 23:01:10 +03:00