Commit graph

6 commits

Author SHA1 Message Date
Peter Hutterer
f4546a18e8 m-reserve-device: replace the hash table key on new insert
We're using the WpReserveDevice's name as key in the hash table, so we
must update the key as well when we replace an item in the hashtable -
the old device (and its name) will be released.

The side-effect of this is that the *third* device with an identical
name will no longer replace the previous device. This results in the
following sequence:

- dev1 added: name Audio0
  - dev1 requests name owner Audio0
- dev2 added: name Audio0
  - replace dev1 in the hashtable
     - dev1 emits "release" signal
     - dev1 unowns the Audio0 name
  - dev2 requests name owner Audio0
- dev3 added: name Audio0
  - adds to the hashtable because the existing key is now undefined
  - dev3 requests name owner Audio0
     - error, you cannot request ownership for the same name twice

Fixes #93
2021-11-18 12:00:09 +00:00
Julian Bouzas
a5a0af5dff m-device-reservation: try to reconnect on idle if DBus connection is closed
This change also keeps the plugin always activated, regardless of whether the
DBus connection is closed or not, which is useful when the dbus service is
restarted.
2021-09-24 08:53:41 -04:00
Raghavendra
d692f06f0d docs: api: Replace hotdoc specific commands with Doxygen specific commands 2021-05-25 14:19:53 +03:00
George Kiagiadakis
0d072874a1 lib: introduce WpComponentLoader and remove WpModule
The component loader is a more generic and extensible mechanism
of loading components; modules are one type of component...
The idea is to make scripts and config files also be components,
loaded by plugins that inherit WpComponentLoader
2021-02-03 17:16:51 +02:00
George Kiagiadakis
f61e292959 plugin: inherit from WpObject
* use the activate/deactivate system from WpObject,
  which allows async activation and error reporting
* drop 'module' property, use 'core' from WpObject
2021-02-03 17:16:51 +02:00
George Kiagiadakis
ef908439c4 modules: implement a new reserve-device module
This one offers API to interract on a lower level with
the D-Bus reservation API and uses GDBus high level bindings only.

Also, this one implements the full Acquire procedure, calling
RequestRelease() on the peer and requesting the name again with
REPLACE_EXISTING
2021-01-26 16:28:22 +02:00