Description: Add a new preference to lock the screen when the system suspends.
Author: Marc Deslauriers <marc.deslauriers@canonical.com>
Forwarded: no, likely a Ubuntu-specific preference
Bug-Ubuntu: https://bugs.launchpad.net/bugs/938076

Index: b/panels/screen/cc-screen-panel.c
===================================================================
--- a/panels/screen/cc-screen-panel.c
+++ b/panels/screen/cc-screen-panel.c
@@ -540,6 +540,13 @@
 
   update_lock_screen_sensitivity (self);
 
+  /* bind the screen lock suspend checkbutton */
+  widget = WID ("screen_lock_suspend_checkbutton");
+  g_settings_bind (self->priv->lock_settings,
+                   "ubuntu-lock-on-suspend",
+                   widget, "active",
+                   G_SETTINGS_BIND_DEFAULT);
+
   widget = WID ("screen_vbox");
   gtk_widget_reparent (widget, (GtkWidget *) self);
   g_object_set (self, "valign", GTK_ALIGN_START, NULL);
Index: b/panels/screen/screen.ui
===================================================================
--- a/panels/screen/screen.ui
+++ b/panels/screen/screen.ui
@@ -299,6 +299,31 @@
                           </packing>
                         </child>
                         <child>
+                          <object class="GtkHBox" id="screen_suspend_hbox">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="spacing">6</property>
+                            <child>
+                              <object class="GtkCheckButton" id="screen_lock_suspend_checkbutton">
+                                <property name="label" translatable="yes">Require my password when waking from suspend</property>
+                                <property name="use_action_appearance">False</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="position">0</property>
+                              </packing>
+                            </child>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                            <property name="position">2</property>
+                          </packing>
+                        </child>
+                        <child>
                           <object class="GtkHBox" id="hbox2">
                             <property name="can_focus">False</property>
                             <property name="no_show_all">True</property>
@@ -340,7 +365,7 @@
                           <packing>
                             <property name="expand">True</property>
                             <property name="fill">True</property>
-                            <property name="position">2</property>
+                            <property name="position">3</property>
                           </packing>
                         </child>
                         <child>
@@ -357,7 +382,7 @@
                           <packing>
                             <property name="expand">True</property>
                             <property name="fill">True</property>
-                            <property name="position">3</property>
+                            <property name="position">4</property>
                           </packing>
                         </child>
                       </object>
