In case the udev property is not present, we might want to query
the driver for the SVG name.
This is useful for driver-test as there is no udev device attached to
it, and for hidpp20 as we have auto-detection. We should then be able
to implement this in hidpp20 also so that the name gets automatically
created.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
If the profile is not active, we do not know which resolution is currently
used. Instead of having ratbagd complaining, just set the default as
active.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
This shuts up a scan-build warning about a memleak that looked like a false
positive but I couldn't get rid of.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
rc may be a negative errno or a positive hidpp error code. If the latter we
used to continue with a NULL macro pointer, eventually crashing.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Just logging and error and continuing is not enough, we'll eventually
dereference garbage values.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
The G403 comes in a (optional) wireless version too; the dongle
that come with it has the product id c539, which is already
handled and also works (by the G900) entry.
Signed-off-by: Christian Kellner <christian@kellner.me>
Two new DBus interfaces:
org.freedesktop.ratbagd1.Manager.Themes -> string array
org.freedesktop.ratbagd1.Device.GetSvg('theme') -> string
The Themes property is a static list of available themes. These are currently
hardcoded in ratbagd, but the theme 'default' is guaranteed to exist.
The GetSvg() method takes a theme name and returns the full file path to the
themed SVG.
Longer-term this will deprecate the Svg and SvgPath properties in the Device
but for now we leave them there.
https://github.com/libratbag/libratbag/issues/204
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
When developing with ratbagd, we need to test against master, not
the system-wide installed daemon.
Allow to name space ratbagd with the creation of a new (not installed)
rabtagd.devel daemon, that is tagged with the git sha of the ratbagd
folder.
Handle this namespace in ratbagctl by looking at an environment variable
RATBAGCTL_DEVEL.
Then provide a python script that launches both rabtagd.devel and
ratbagctl with the correct environment variable set so that they can
talk to each other.
Note that we blindly overwrite the dbus .conf file as nobody else than
developers should have one.
Note: the tagging of ratbagd.devel (like the meson bit) won't run unless
a rebuild is triggered. So we don't necessarily always get the right git
tag. However, touching ratbagctl.in triggers a rebuild, so we should be
OK-ish.
Fixes#206
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
File "./build/ratbagctl", line 713, in main
cmd.func(r, cmd)
UnboundLocalError: local variable 'r' referenced before assignment
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* ratbagd: drop the ActiveResolutionChanged signal generation
Leave the signal in the DBus API for now so we can hook it up later, but
stop the signal being generated. Changing the dpi does not change the active
resolution.
https://github.com/libratbag/libratbag/issues/205
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* ratbagd: fix signal dbus interface name
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
ratbagd unconditionally called set_resolution_xy while libratbag expects
the caller to check on the capabilities. Instead of letting this burden
to the dbus user, have ratbagd handle this for us.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
The previous approach had no effect, it wasn't doing things correctly.
Add a proper valgrind setup, run with:
mesontest --setup=valgrind
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
[fixed rebase conflict]
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
It doesn't cost much to actually install the files, so we can check
where they are installed.
Also add mesonconf before building so we can see in the logs
the various configure environment.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Fedora uses /usr/lib64 as libdir but systemd uses /usr/lib for its files. We
used libdir to install the unit files, which then end up in
/usr/lib64/systemd/systemd where it will be ignored. There's no good way to
avoid this beyond detecting this mismatch and hacking around it.
To keep custom prefixes intact, this patch detects a /usr prefix and checks
with systemd's pkconfig, if the libdir and the systemd unitdir mismatch, then
we adjust the path.
https://github.com/libratbag/libratbag/issues/188
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Circle CI uses docker, so nothing prevents us from running several
tests in parallel for different distributions. Ideally, we should also
be able to test the install and be sure we can talk to ratbagd
with the dbus activation on those various distributions.
This version runs both Fedora rawhide and Ubuntu 17.04 at the same
time.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
We install everything, so rather than having commands that aren't needed,
simply describe what we're doing and hope for the best.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
No-one reads anything longer than 140 char anymore, so let's move the DBus
Interface description out. The average visitor to this site won't care.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Semaphore only provides Ubuntu 14.04 which is too old for us. We now have
CircleCI integration which can run docker images, so let's leave that and drop
Semaphore.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Semaphore CI is still using Ubuntu 14.04, and the shipped systemd version
is just too old.
OTOH, Circle CI 2.0 (still beta as of today) allows to use any docker
image as a base for running the tests. Meaning that we can have a fedora
rawhide image as a base and we do not have to handle the update of systemd
meson and others.
Ship a basic circle.yml for Circle CI to run our tests and add the badge
in the README.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
This merges ratbagd into libratbag, keeping the histories of both projects intact (hence the rather large merge). The meson.build files are merged and a few things are shuffled around to look like one normal project directory. The build artifacts are still the same, i.e. we still build libratbag and ratbagd.