After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 703410 - power: Add support for rfkill switches in g-s-d's power plugin
power: Add support for rfkill switches in g-s-d's power plugin
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: plugins
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-settings-daemon-maint
gnome-settings-daemon-maint
Depends on:
Blocks:
 
 
Reported: 2013-07-01 18:11 UTC by Jasper St. Pierre (not reading bugmail)
Modified: 2013-07-05 07:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
power: Add support for rfkill switches in g-s-d's power plugin (20.97 KB, patch)
2013-07-01 18:11 UTC, Jasper St. Pierre (not reading bugmail)
reviewed Details | Review
rfkill: Add RFKill support plugin on Linux systems (36.50 KB, patch)
2013-07-04 14:05 UTC, Bastien Nocera
needs-work Details | Review
rfkill: Add RFKill support plugin on Linux systems (38.74 KB, patch)
2013-07-04 14:49 UTC, Bastien Nocera
committed Details | Review

Description Jasper St. Pierre (not reading bugmail) 2013-07-01 18:11:40 UTC
This will be used by gnome-shell and gnome-control-center, instead
of copy/paste rfkill code.
Comment 1 Jasper St. Pierre (not reading bugmail) 2013-07-01 18:11:42 UTC
Created attachment 248176 [details] [review]
power: Add support for rfkill switches in g-s-d's power plugin
Comment 2 Bastien Nocera 2013-07-03 18:48:46 UTC
Review of attachment 248176 [details] [review]:

As mentioned on IRC, I'd prefer if it were a separate plugin. The power plugin is already quite full of stuff that shouldn't be there...
I would also add a separate Bluetooth killswitch there, for gnome-bluetooth's applet.so (loaded by gnome-shell) and gnome-control-center to use.

::: plugins/power/rfkill-glib.c
@@ +61,3 @@
+	g_return_val_if_fail (rfkill->priv->fd > 0, -1);
+
+	return write (rfkill->priv->fd, event, sizeof(struct rfkill_event));

Having an async version of this would be nice.
Comment 3 Bastien Nocera 2013-07-04 14:05:31 UTC
Created attachment 248388 [details] [review]
rfkill: Add RFKill support plugin on Linux systems

Based on a patch by Jasper St. Pierre <jstpierre@mecheye.net>
Comment 4 Bastien Nocera 2013-07-04 14:11:17 UTC
Review of attachment 248388 [details] [review]:

::: plugins/rfkill/gsd-rfkill-manager.c
@@ +51,3 @@
+"  <interface name='org.gnome.SettingsDaemon.Rfkill'>"
+"    <annotation name='org.freedesktop.DBus.GLib.CSymbol' value='gsd_rfkill_manager'/>"
+"      <property name='AirplaneMode' type='b' access='readwrite'/>"

We need to have a Bluetooth killswitch here as well.

::: plugins/rfkill/rfkill-glib.c
@@ +61,3 @@
+	g_return_val_if_fail (rfkill->priv->fd > 0, -1);
+
+	return write (rfkill->priv->fd, event, sizeof(struct rfkill_event));

We'd need this to be async. GUnixOutputStream and g_output_stream_write_async() might be enough for this.
Comment 5 Bastien Nocera 2013-07-04 14:49:30 UTC
Created attachment 248392 [details] [review]
rfkill: Add RFKill support plugin on Linux systems

Based on a patch by Jasper St. Pierre <jstpierre@mecheye.net>
Comment 6 Bastien Nocera 2013-07-05 07:21:11 UTC
Attachment 248392 [details] pushed as 444af32 - rfkill: Add RFKill support plugin on Linux systems