summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* settings-row: Dim status labelsAutomeris naranja2023-03-021-0/+3
| | | | | | | https://gitlab.gnome.org/Teams/Design/settings-mockups/-/blob/master/bluetooth/bluetooth-wires.png This change aims to follow the mockup above, which uses dimmed status labels.
* settings-widget: Simplify whether to show the "Send Files" buttonBastien Nocera2023-03-011-7/+2
| | | | Use g_strv_contains() instead of an open-coded loop.
* settings-widget: Work-around contrast problem for the mouse iconBastien Nocera2023-01-111-0/+3
| | | | | | | Add a drop-shadow to the device icon to work-around the fact that the mouse icon would be gray on gray in the default style. Closes: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2284
* pairing-dialog: Fix getting the invisible charBastien Nocera2022-12-091-0/+3
| | | | | | | | As mentioned in the previous commit, the invisible character will only be set to non-zero if the entry is set to show invisible characters. Make sure to set the entry to hide characters so the invisible character is set to a usable value.
* pairing-dialog: Fix pairing with keyboard with typing notificationBastien Nocera2022-12-091-0/+2
| | | | | | | | | | | | | The invisible character we fetch from an entry might be zero if it isn't set, for example when the entry isn't setup to hide text. This would result in the passkey that's displayed being truncated as the invisible character would be a nul terminator. Make sure we have a valid invisible character, so the passkey doesn't disappear after the first typed character when pairing a keyboard with typing notification. Closes: #125
* pairing-dialog: Use g_autoptr()Bastien Nocera2022-12-091-3/+1
|
* pairing-dialog: Use g_autofreeBastien Nocera2022-12-091-2/+1
|
* lib: Don't just get BlueZ battery info from upowerBastien Nocera2022-09-052-6/+28
| | | | | | | | | | | | Handle the battery information for a device even if it is available from a source other than bluetoothd in the upower output. This means getting battery information from the more authoritative kernel-supported protocol on Logitech devices, as well as being able to have battery information for Bluetooth classic devices like Apple input devices. See https://gitlab.freedesktop.org/upower/upower/-/merge_requests/166
* lib: Add PIN quirk for Nissan Connect carkitBastien Nocera2022-09-021-0/+3
|
* lib: Implement default-adapter-state property using bluezBastien Nocera2022-08-312-40/+30
| | | | | | | | | | | | Use new adapter property in bluez to implement the default-adapter-state. It should work better, as it doesn't rely only on internal BluetoothClient state in a single process, and can get information when bluetoothd is powering up the adapter. Note that this property still works in the absence of a new enough bluetoothd, without the transitional states. Closes: #121
* lib: Add test application for BluetoothClient propertiesBastien Nocera2022-08-251-0/+21
|
* lib: Fix enums being inaccessible from GJSBastien Nocera2022-08-231-1/+1
| | | | | | | | | | | | | | | | | | | Add enum type generation code to the gir sources. This fixes enum types showing up as 'undefined' in gjs. The change did not impact Python. --✀-- const {Gio, GLib, GnomeBluetooth, GObject} = imports.gi; client = new GnomeBluetooth.Client(); client.connect('notify', () => { print(client.default_adapter_state); }); ml = new GLib.MainLoop(null, false); ml.run() --✀--
* lib: Export a more precise adapter power stateBastien Nocera2022-08-233-1/+83
| | | | | | | | | Unfortunately, powering on/off Bluetooth adapters has become longer, and less reliable over time, so front-ends need more information to be able to figure out what it happening. As a first pass, export whether the adapter is in the process of being turned on, or turned off, based on our own request.
* lib: Add BluetoothBatteryType to exported C symbolsBastien Nocera2022-08-231-0/+1
|
* lib: Better API docs for _connect_service() APIBastien Nocera2022-08-091-0/+8
| | | | | Better explain what _connect_service() does, so it's not used for devices which can't be "connected" to.
* lib: Document internal variable ->discovery_startedBastien Nocera2022-06-291-0/+1
| | | | | Can't really explain the purpose of this variable by just naming it, so document it in the structure that defines it.
* client: Handle failure to start or filter DiscoveryBastien Nocera2022-06-291-28/+46
| | | | | | | | | | Reorganise functions called from _bluetooth_client_set_default_adapter_discovering() so that we only call StartDiscovery() if SetDiscoveryFilter() is successful, and we disable the "in-flight" ->discovery_started variable so the next default-adapter changes would try to enable discovery again if needed. Closes: #100
* client: Consider discovery to be stopped if there's no default adapterBastien Nocera2022-06-291-0/+1
| | | | | When somebody requests the "default-adapter-setup-mode" to be disabled but there's no default adapter, consider that we're not in setup mode.
* settings-widget: Fix duplicate device when bluetoothd restartsBastien Nocera2022-06-291-0/+8
| | | | | | | | | | | As recommended in the BluetoothClient documentation: " Note that #BluetoothClient::device-removed will not be called for each individual device as the model is cleared when the #BluetoothClient:default-adapter property changes. " Closes: #116
* settings-row: Fix display of devices with & in their namesBastien Nocera2022-05-101-1/+4
| | | | | | Escape the device name/alias before using it as a label. Closes: #115
* lib: Add support for connecting to BLE MID devicesBastien Nocera2022-03-101-0/+1
| | | | As supported by bluez in its MIDI plugin.
* lib: Add MIDI to the UUID to string helperBastien Nocera2022-03-101-0/+22
|
* lib: Merge device removal with adapter removalBastien Nocera2022-02-241-15/+66
| | | | | | | | | | | | | When an adapter is removed while bluetoothd is still running (eg. not crashing as we also want to handle), suppress the emission of device-removed so that front-ends don't think that every device is removed. We implement this by queue device-removed signals until the next mainloop iteration instead of sending it straight away. Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/1426 Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5058
* lib: Fix possible race between UPower and Bluez on initBastien Nocera2022-02-231-2/+20
| | | | | | | | | | | | | | | | | | | | | | | | | Fix possible race between UPower and Bluez when creating the BluetoothClient. Bluetooth-DEBUG: Successfully created UpClient Bluetooth-DEBUG: Got initial list of 2 UPower devices Bluetooth-DEBUG: Considering UPower device /org/freedesktop/UPower/devices/mouse_dev_11_22_33_44_55_66 Bluetooth-DEBUG: Could not find bluez device for upower device /org/bluez/hci0/dev_11_22_33_44_55_66 Bluetooth-DEBUG: Considering UPower device /org/freedesktop/UPower/devices/mouse_dev_11_22_33_44_55_67 Bluetooth-DEBUG: Could not find bluez device for upower device /org/bluez/hci0/dev_11_22_33_44_55_67 Bluetooth-DEBUG: Adding adapters from ObjectManager Bluetooth-DEBUG: Inserting adapter :1.2 /org/bluez/hci0 org.bluez.Adapter1 Bluetooth-DEBUG: Setting '/org/bluez/hci0' as the new default adapter Bluetooth-DEBUG: Emptying list store as default adapter changed Bluetooth-DEBUG: Coldplugging devices for new default adapter Bluetooth-DEBUG: Adding device '11:22:33:44:55:66' on adapter '/org/bluez/hci0' to list store Bluetooth-DEBUG: Adding device '11:22:33:44:55:67' on adapter '/org/bluez/hci0' to list store Bluetooth-DEBUG: New default adapter so invalidating all the default-adapter* properties The UpDevices are enumerated before we've even enumerated the Bluetooth adapters, so we don't have any BluetoothDevices to attach the UpDevices to. Wait until we've at least run through setting a default adapter before enumerating the UPower devices.
* lib: Don't enable/disable discovery again if already enabledJonas Dreßler2022-02-231-1/+5
| | | | | | We have a private property to keep track of this already, let's use it and bail out of _bluetooth_client_set_default_adapter_discovering() if we're already discovering.
* lib: Fix gnome-bluetooth-ui pkg-config file depsBastien Nocera2022-02-221-1/+1
| | | | | | | | | Add missing gtk4 and libadwaita deps to the gnome-bluetooth-ui pkg-config file. In reality, this didn't impact any software as the only consumer of the UI library is gnome-control-center which already depends on those 2 libraries. Closes: #105
* lib: Fix syntax error on clang and older gccJan Tojnar2022-02-221-3/+1
| | | | | | | | | | On gcc < 11 and any version of clang (tested up to 13), the build would fail with the following error: error: label at end of compound statement GCC 11+ seems to only complain with -Werror -Wpedantic, otherwise it tolerates even completely empty default: case.
* pairing-dialog: Fix dialog not closingBastien Nocera2022-02-211-0/+2
| | | | | | The pairing-dialog was not added to GtkWindowClass' global list of windows as we didn't call up to gtk_window_constructed(), so couldn't be closed by gtk_window_destroy().
* pairing-dialog: Fix GtkDialog subclassingJonas Dreßler2022-02-211-1/+1
| | | | | | Right now the pairing dialog doesn't open because we're not specifying the correct parent class when creating the GtkDialog subclass, so fix that.
* lib: Fix possible crash when UPower updatesJonas Dreßler2022-02-161-4/+4
| | | | | | | | | | Due to a reference leak, libupower-glib could still callback into our BluetoothClient even if it was already finalized as the signal handlers were not forcibly disconnected when the BluetoothClient was. See https://gitlab.freedesktop.org/upower/upower/-/merge_requests/112 Fixes: 983838f1
* settings-row: Fix showing the confirm dialog when removing deviceJonas Dreßler2022-02-151-47/+37
| | | | | | | | | With gtk4 the widget also has to be shown now, so do that. While at it also make the dialog GTK_DIALOG_DESTROY_WITH_PARENT so it gets destroyed when the parent window closes, and get rid of the GMainLoop that made show_confirm_dialog() behave like a synchronous function.
* settings-row: Actually start the GtkSpinnerJonas Dreßler2022-02-151-8/+11
| | | | | | | Apparently in gtk4 the spinner needs to be actually started to show it. While at it move the exclusive showing/hiding of the status widget and spinner into label_might_change() instead of the double BIDIRECTIONAL property bind.
* lib: Remove notification for wrong propertyBastien Nocera2022-02-081-1/+0
| | | | | When the alias changes, we don't need to say that the adapter changed power status.
* lib: Add battery reporting through BluetoothDeviceBastien Nocera2022-02-071-0/+185
| | | | | | | | | | | | Connect and monitor UPower devices for devices reporting their battery status. This makes sure that we can show battery status for devices that emit their battery status through bluez (via the BATT LE service, or the org.bluez.BatteryProviderManager1 API, as well as devices for which the kernel is the battery info provider. Closes: #102
* lib: Add battery properties to BluetoothDeviceBastien Nocera2022-02-072-0/+41
|
* lib: Add BluetoothBatteryType enumBastien Nocera2022-02-071-0/+14
|
* lib: Use g_auto for this errorBastien Nocera2022-02-071-2/+1
|
* settings-widget: Simplify via `header-suffix`Christopher Davis2022-02-071-45/+26
| | | | | Now that libadwaita has the header-suffix property, we can use AdwPreferencesGroup's built-in header.
* lib: Add getter for connectable propertyJonas Dreßler2022-01-291-0/+3
| | | | | | | The property was forgotten in commit 6f611a67, which made the connect button in the settings panel not work properly. Fixes: 6f611a67
* settings-widget: Use AdwPreferences{Page,Group}Christopher Davis2022-01-252-103/+61
| | | | | | | | | | Panels in g-c-c should be using these widgets wherever possible. These are the widgets meant to be used for boxed list panels, and libadwaita provides a single source of truth for the styling. The UI file will be further reduced once https://gitlab.gnome.org/GNOME/libadwaita/-/merge_requests/433 is merged.
* bluetooth-settings-row: Subclass AdwActionRowChristopher Davis2022-01-253-41/+19
| | | | | Significantly reduces the size of the UI file and gives us consistent margins and padding.
* lib: Add docs for has_connected_input_devices()Bastien Nocera2022-01-201-0/+10
|
* lib: Update docs for device-removed signalBastien Nocera2022-01-201-0/+4
|
* lib: Remove bluetooth_client_get_connectable() APIBastien Nocera2022-01-202-30/+0
|
* settings: Use new "connectable" propertyBastien Nocera2022-01-201-3/+3
|
* lib: Add connectable property to BluetoothDeviceBastien Nocera2022-01-201-0/+41
|
* lib: Add API to check whether input devices are connectedBastien Nocera2022-01-203-0/+32
| | | | | | | | This will figure out whether there are any connected input devices, so that gnome-shell (or gnome-control-center) can show a confirmation dialogue before really turning things off. Closes: #101
* lib: Add separate string for Bluetooth LE servicesBastien Nocera2022-01-203-2/+7
|
* lib: Add constants for some Bluetooth LE servicesBastien Nocera2022-01-201-0/+3
|
* lib: Update links to assigned numbers docsBastien Nocera2022-01-201-3/+3
|