1
0
forked from drath/libratbag
Commit Graph

1295 Commits

Author SHA1 Message Date
Peter Hutterer
afaf3fa83d ratbagd: Drop KeyMapping from the DBus interface
Plan is to remove the key mapping altogether and make it transparent from the
Macro mappings (in libratbag/the drivers). Meanwhile, remove the DBus API so
nothing can actually start using it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-09-07 08:25:59 +02:00
Peter Hutterer
4c7f644599 hwdb: drop the remaining hwdb files
Now that we use the .ini style device configuration and everything has been
migrated, we don't need the hwdb/rules files anymore

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-09-07 09:21:45 +10:00
Peter Hutterer
692f7f008a Fix typo
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-09-07 09:21:45 +10:00
Benjamin Tissoires
0a62c3dfa8 hidpp20: fix mem leak
Valgrind complains about it, so let's fix it.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-09-05 19:18:10 +10:00
Benjamin Tissoires
7cd2cfed44 tools: ratbagctl.devel: fix commit() async call
If we leave ratbagctl.devel too soon, ratbagd gets killed before it even
receives the async call for commmit(), meaning everything we do on the
device is lost.

0.5 is empirical. It seems on my system 0.2 is enough (0.1 doesn't seem
to work). Hopefully this value is not device dependent.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-09-04 19:55:53 +10:00
Benjamin Tissoires
c31e11d385 tools: fix permissions for ratbagctl
not sure why, but stat.S_IEXEC only sets exec permission for the user,
meaning that the installed file can't be run by anybody else than root.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-09-04 19:55:53 +10:00
Thomas Hindoe Paaboel Andersen
efe6021e76 G300: fix profile switching
The profile ID's used are:
  profile 0: 0x80
  profile 1: 0x90
  profile 2: 0xA0

These were miscalculated as 0x80, 0x81, and 0x82.
2017-09-04 09:25:38 +10:00
Stephen Kitt
8d67389042 Don't install ratbag-command manpage
Since we no longer install ratbag-command itself, there isn't much
point installing its manpage.

Signed-off-by: Stephen Kitt <steve@sk2.org>
2017-09-04 08:24:34 +10:00
Peter Hutterer
4037587f74 Get the libratbag data dir from the environment variable
And set it for the tests, so we can test with in-tree files.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-09-01 09:49:32 +02:00
Peter Hutterer
94daeb1444 ratbagd: split the test device out into a seprate file
It always bothered me that it was in the middle of the normal ratbagd, which
made fiding it more effort than neccessary. Split it out into a separate file
so it's easily identifiable.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-09-01 09:30:38 +02:00
Peter Hutterer
937b30c415 circle.yml: set LANG to UTF-8
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-09-01 07:37:03 +02:00
Peter Hutterer
6f0242f05b Add missing include for stdint.h to libratbag-test.h
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-09-01 10:53:37 +10:00
Thomas Hindoe Paaboel Andersen
921837fd0f ratbagctl: typo fix 2017-08-31 21:32:28 +02:00
Jente Hidskes
d06cdcc53c tools/ratbagd.py: sync with Piper 2017-08-31 15:25:38 +02:00
Benjamin Tissoires
5828355426 Fix flake 8 warnings
./tools/toolbox.py:105:1: E302 expected 2 blank lines, found 1
tools/ratbagctl.in:369:13: F821 undefined name 'RatbagdMacro'

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-08-31 15:06:08 +02:00
Jente Hidskes
50dc321b7b tools/ratbagctl.in: use RatbagDevice's active_profile property 2017-08-31 14:34:03 +02:00
Jente Hidskes
43f033db80 tools/ratbagctl.in: use RatbagProfile's active_resolution property 2017-08-31 14:34:03 +02:00
Jente Hidskes
623c53f1e4 tools/ratbagctl.in: use RatbagdMacro to print the macro 2017-08-31 14:34:03 +02:00
Jente Hidskes
39762718b9 tools/ratbagd.py: sync with Piper 2017-08-31 14:34:03 +02:00
Benjamin Tissoires
ae3804f7b4 tools/toolbox.py: add dbus sync helper function
A quick and easy way to sync anything coming from dbus (like property updates)
without needing to be hooked into a glib mainloop directly.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-08-31 14:34:03 +02:00
Peter Hutterer
0dd08dfb84 tools/ratbagctl.test.in: decode ratbagctl output with utf8 for the tests
The macros with their fancy characters need utf8, not ascii

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-08-31 14:34:03 +02:00
Peter Hutterer
bb23f68d53 util: avoid reallocation of zero-sized memory in dpi list parsing
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-08-31 09:48:52 +02:00
Peter Hutterer
83345a17d2 hidpp20: add an assert to shut up scan-build
Not sure why it thinks we're potentially dereferencing a NULL-pointer here but
from the trace it looks like it thinks macro and a previously nullified
profile->macros are the same. They aren't, macro was just allocated here and
shouldn't be NULL if we get here.

Anyway, add an assert and move on.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-08-31 09:48:52 +02:00
Peter Hutterer
b9f6554767 ratbagd: fix enum type for resolutions
Found by coverity

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-08-31 09:48:52 +02:00
Peter Hutterer
7eadd20879 hidpp10: fix a coverity warning about OOB access
Make sure that the index we pass into long_clear_bit is never higher than the
number of bits in the single long we use as array here.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-08-31 09:48:52 +02:00
Peter Hutterer
3844a60837 hidp20: fix dead code in macro parsing
If rc is positive, it's the number of items.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-08-31 09:48:52 +02:00
Peter Hutterer
6cdf8a901a ratbagd: fix use of potentially unused variable
Simply abort if the macro value is bad, that's a libratbag bug and should
never happen.

Found in #312

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-08-31 09:48:52 +02:00
Peter Hutterer
c868c43179 tools: fix use of unset variable
Found in #312

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-08-31 09:48:52 +02:00
Peter Hutterer
01ca2a6de7 ratbagd: drop the unused IsActive and IsDefault resolution signals
Obsolete, now that we're just updating the property.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-08-31 09:37:59 +02:00
Peter Hutterer
d64af72f74 ratbagd: fix profile IsActive property changes
We sent a signal out but not the "property has changed" signal we actually
needed.

Fixes #295

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-08-31 09:37:59 +02:00
Peter Hutterer
c2fe745813 data/gnome: add a quick and dirty SVG checker for the GNOME SVGs
Checks for the three layers we need and that any buttons in the files are
consecutive and have the right layers

Fixes #196

Co-authored-by: Jente Hidskes <hjdskes@gmail.com>
2017-08-31 08:40:58 +02:00
Peter Hutterer
ddefbf95a3 test: ignore python allocation leaks in our valgrind runs
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-08-31 08:40:58 +02:00
Peter Hutterer
a2b651985e data/gnome: fallback: add missing button6-path
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-08-31 08:40:58 +02:00
Jente Hidskes
788c261ce9 data/gnome: roccat kone XTD: add missing leaders for wheel tilt buttons 2017-08-31 08:40:58 +02:00
Peter Hutterer
35070cc17e data/gnome: roccat kone XTD: fix button numbering
Somehow I skipped over buttons 7 and 8

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-08-31 08:40:58 +02:00
Jente Hidskes
79be057e91 data/gnome: G502: add missing text-align style property 2017-08-31 08:40:58 +02:00
Peter Hutterer
aa8f506dd0 data/gnome: G502: fix SVG to be 400 pixels height
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-08-31 08:40:58 +02:00
Peter Hutterer
c6486b1960 tools: add missing vim config line to toolbox.py
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-08-31 14:08:23 +10:00
Peter Hutterer
2f8e3a1610 tools: fix typos in test case class names
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-08-31 14:08:20 +10:00
Peter Hutterer
432d32bedc ratbagd: set the active profile before sending signals
Found by @bentiss, see #295

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-08-31 13:08:41 +10:00
Peter Hutterer
8cb2d21ff5 Remove unnecessary NULL check before free()
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-08-31 13:03:07 +10:00
Peter Hutterer
1103c208a8 ratbagd: if the svg doesn't exist, supply the fallback one
We keep the hardcoded fallback.svg for the test device, otherwise we get an
error every time we start ratbagd.devel

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-08-31 10:48:38 +10:00
Peter Hutterer
7e59f0f974 data: add a fallback.svg file
This SVG is generic enough to cover 7-button mice with up to 3 LEDs that are
supported but don't have an SVG. The SVG style is intentionally NOT a generic
mouse to make it obvious that something isn't right here. If we use a generic
mouse, people may not put the effort into a proper SVG style because the
generic mouse is good enough.

The fallback is currently only used for test devices
2017-08-31 10:48:38 +10:00
Benjamin Tissoires
c647d6df99 profiles: add name get/set capability
Some devices can have a custom name, so let's export that capability.

In ratbagd, libratbag/ratbag_profile_set_name() returns an error, we
put it under silence, the client has to check for the capabilities
before asking ratbagd to change the profile name.

Fixes: #266

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-08-31 10:22:51 +10:00
Benjamin Tissoires
97a927bb7d profiles: add a per profile capabilities field
Doesn't do much now without the next commit

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-08-31 10:22:51 +10:00
Benjamin Tissoires
7c650aeeca tools: ratbagctl: add "name" command to return the device name
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-08-31 10:22:51 +10:00
Thomas Hindoe Paaboel Andersen
3fd7cd0137 improve error for missing device files 2017-08-31 08:17:15 +10:00
Thomas Hindoe Paaboel Andersen
7e97936f0e reset GError before reuse
If the error variable is not reset then we may end up freeing it
again in the next block. This can cause problems later for glib.

Fixes #311
2017-08-31 08:07:19 +10:00
Peter Hutterer
643a4a89f4 ratbagd: fix assertion error when quitting with more than 1 devices attached
RATBAGD_FOREACH_DEVICE does not allow unlinking the device during the loop.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-08-30 09:42:47 +10:00
Peter Hutterer
cfd93cf332 drop now obsolete ratbag_device_get_udev_property
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-08-28 17:50:20 +02:00