11632
|
1 |
--- data/gnome-power-manager.schemas.in.orig 2008-02-04 10:12:40.941327000 +0800
|
|
2 |
+++ data/gnome-power-manager.schemas.in 2008-02-04 10:24:07.361341000 +0800
|
|
3 |
@@ -929,6 +929,18 @@
|
|
4 |
</schema>
|
|
5 |
|
|
6 |
<schema>
|
|
7 |
+ <key>/schemas/apps/gnome-power-manager/ui/enable_screen_lock</key>
|
|
8 |
+ <applyto>/apps/gnome-power-manager/ui/enable_screen_lock</applyto>
|
|
9 |
+ <owner>gnome-power-manager</owner>
|
|
10 |
+ <type>bool</type>
|
|
11 |
+ <default>true</default>
|
|
12 |
+ <locale name="C">
|
|
13 |
+ <short>If screen lock should be used</short>
|
|
14 |
+ <long>If screen lock should be used when lid is closed, or system performs a suspend or hibernate action.</long>
|
|
15 |
+ </locale>
|
|
16 |
+ </schema>
|
|
17 |
+
|
|
18 |
+ <schema>
|
|
19 |
<key>/schemas/apps/gnome-power-manager/ui/show_actions_in_menu</key>
|
|
20 |
<applyto>/apps/gnome-power-manager/ui/show_actions_in_menu</applyto>
|
|
21 |
<owner>gnome-power-manager</owner>
|
12100
|
22 |
--- src/gpm-prefs-core.c.org 2008-02-05 13:56:31.775812000 +0800
|
|
23 |
+++ src/gpm-prefs-core.c 2008-02-05 13:52:48.084206000 +0800
|
|
24 |
@@ -890,6 +890,10 @@
|
|
25 |
gpm_prefs_setup_checkbox (prefs, "checkbutton_notification_sound",
|
|
26 |
GPM_CONF_UI_ENABLE_BEEPING);
|
|
27 |
|
|
28 |
+ /* set up the screen locking checkbox */
|
|
29 |
+ gpm_prefs_setup_checkbox (prefs, "checkbutton_screen_lock",
|
|
30 |
+ GPM_CONF_UI_ENABLE_SCREEN_LOCK);
|
|
31 |
+
|
|
32 |
if (prefs->priv->has_batteries == TRUE) {
|
|
33 |
/* there's no use case for displaying this option */
|
|
34 |
gtk_widget_hide_all (radiobutton_icon_never);
|
11632
|
35 |
--- src/gpm-control.c.orig 2007-07-27 07:28:18.000000000 +0800
|
|
36 |
+++ src/gpm-control.c 2008-02-13 13:06:29.259536000 +0800
|
|
37 |
@@ -377,6 +377,10 @@
|
|
38 |
{
|
|
39 |
gboolean do_lock;
|
|
40 |
gboolean use_ss_setting;
|
|
41 |
+#ifdef SOLARIS
|
|
42 |
+ gpm_conf_get_bool (control->priv->conf, GPM_CONF_UI_ENABLE_SCREEN_LOCK, &do_lock);
|
|
43 |
+ gpm_debug ("Using custom locking settings (%i)", do_lock);
|
|
44 |
+#else
|
|
45 |
/* This allows us to over-ride the custom lock settings set in gconf
|
|
46 |
with a system default set in gnome-screensaver.
|
|
47 |
See bug #331164 for all the juicy details. :-) */
|
|
48 |
@@ -388,6 +392,7 @@
|
|
49 |
gpm_conf_get_bool (control->priv->conf, policy, &do_lock);
|
|
50 |
gpm_debug ("Using custom locking settings (%i)", do_lock);
|
|
51 |
}
|
|
52 |
+#endif
|
|
53 |
return do_lock;
|
|
54 |
}
|
|
55 |
|
11658
|
56 |
--- src/gpm-conf.h.orig 2008-02-18 16:47:20.806807000 +0800
|
|
57 |
+++ src/gpm-conf.h 2008-02-18 16:48:11.849112000 +0800
|
|
58 |
@@ -148,6 +148,7 @@
|
|
59 |
#define GPM_CONF_UI_SHOW_ACTIONS_IN_MENU GPM_CONF_DIR "/ui/show_actions_in_menu"
|
|
60 |
#define GPM_CONF_UI_ENABLE_BEEPING GPM_CONF_DIR "/ui/enable_sound"
|
|
61 |
#define GPM_CONF_UI_SHOW_CONTEXT_MENU GPM_CONF_DIR "/ui/show_context_menu"
|
|
62 |
+#define GPM_CONF_UI_ENABLE_SCREEN_LOCK GPM_CONF_DIR "/ui/enable_screen_lock"
|
|
63 |
|
|
64 |
/* we use the gnome-session key now */
|
|
65 |
#define GPM_CONF_SESSION_REQUEST_SAVE "/apps/gnome-session/options/auto_save_session"
|
11924
|
66 |
--- src/gpm-screensaver.c.orig 2008-03-19 22:34:35.519979000 +0800
|
|
67 |
+++ src/gpm-screensaver.c 2008-03-27 12:34:08.147100000 +0800
|
|
68 |
@@ -29,6 +29,10 @@
|
|
69 |
#include "gpm-conf.h"
|
|
70 |
#include "gpm-screensaver.h"
|
|
71 |
#include "gpm-debug.h"
|
|
72 |
+#ifdef SOLARIS
|
|
73 |
+#include <gtk/gtk.h>
|
|
74 |
+#include <gdk/gdk.h>
|
|
75 |
+#endif
|
|
76 |
#include <libdbus-proxy.h>
|
|
77 |
|
|
78 |
static void gpm_screensaver_class_init (GpmScreensaverClass *klass);
|
|
79 |
@@ -239,6 +243,49 @@
|
|
80 |
guint sleepcount = 0;
|
|
81 |
DBusGProxy *proxy;
|
|
82 |
|
|
83 |
+#ifdef SOLARIS
|
|
84 |
+ GError *error = NULL;
|
|
85 |
+ char *command;
|
|
86 |
+ GdkScreen *screen;
|
|
87 |
+ GtkWidget *invisible;
|
|
88 |
+
|
|
89 |
+ /* As per ARC requriement, use xdg-screensaver on Solaris */
|
|
90 |
+ command = g_strdup ("/usr/bin/xdg-screensaver lock");
|
|
91 |
+ screen = gdk_screen_get_default ();
|
|
92 |
+
|
|
93 |
+ gpm_debug ("Doing xdg-screensaver lock");
|
|
94 |
+ if (! gdk_spawn_command_line_on_screen (screen, command, &error)) {
|
|
95 |
+ g_warning ("Cannot lock screen: %s", error->message);
|
|
96 |
+ g_error_free (error);
|
|
97 |
+ }
|
|
98 |
+ g_free (command);
|
|
99 |
+
|
|
100 |
+ /* Make sure screen locking takes effect until both point
|
|
101 |
+ * and keyboard are grabbed successfully.
|
|
102 |
+ */
|
|
103 |
+ invisible = gtk_invisible_new_for_screen (screen);
|
|
104 |
+ gtk_widget_show (invisible);
|
|
105 |
+ while (sleepcount++ < 50) {
|
|
106 |
+ gpm_debug ("Try to determine if screen lock is active!");
|
|
107 |
+ if (gdk_pointer_grab (invisible->window,
|
|
108 |
+ TRUE,
|
|
109 |
+ 0,
|
|
110 |
+ NULL,
|
|
111 |
+ NULL,
|
|
112 |
+ GDK_CURRENT_TIME)
|
|
113 |
+ == GDK_GRAB_SUCCESS) {
|
|
114 |
+ if (gdk_keyboard_grab (invisible->window, FALSE, GDK_CURRENT_TIME)
|
|
115 |
+ == GDK_GRAB_SUCCESS)
|
|
116 |
+ break;
|
|
117 |
+ else
|
|
118 |
+ gdk_pointer_ungrab (GDK_CURRENT_TIME);
|
|
119 |
+ }
|
|
120 |
+
|
|
121 |
+ g_usleep (1000 * 100);
|
|
122 |
+ }
|
|
123 |
+ gtk_widget_destroy (invisible);
|
|
124 |
+ gpm_debug ("Screen locking is sucessful!, sleepcount = %d", sleepcount);
|
|
125 |
+#else
|
|
126 |
g_return_val_if_fail (GPM_IS_SCREENSAVER (screensaver), FALSE);
|
|
127 |
|
|
128 |
proxy = dbus_proxy_get_proxy (screensaver->priv->gproxy);
|
|
129 |
@@ -265,6 +312,7 @@
|
|
130 |
break;
|
|
131 |
}
|
|
132 |
}
|
|
133 |
+#endif
|
|
134 |
|
|
135 |
return TRUE;
|
|
136 |
}
|
12565
|
137 |
--- data/gpm-prefs.glade.orig 2008-06-02 23:14:08.822762000 +0800
|
|
138 |
+++ data/gpm-prefs.glade 2008-06-02 23:24:55.877203000 +0800
|
|
139 |
@@ -1041,6 +1041,20 @@
|
|
140 |
<property name="position">3</property>
|
|
141 |
</packing>
|
|
142 |
</child>
|
|
143 |
+ <child>
|
|
144 |
+ <widget class="GtkCheckButton" id="checkbutton_screen_lock">
|
|
145 |
+ <property name="can_focus">True</property>
|
|
146 |
+ <property name="label" translatable="yes">_Lock screen when computer is restored from blank screen, suspend or hibernate</property>
|
|
147 |
+ <property name="use_underline">True</property>
|
|
148 |
+ <property name="response_id">0</property>
|
|
149 |
+ <property name="draw_indicator">True</property>
|
|
150 |
+ </widget>
|
|
151 |
+ <packing>
|
|
152 |
+ <property name="expand">False</property>
|
|
153 |
+ <property name="fill">False</property>
|
|
154 |
+ <property name="position">4</property>
|
|
155 |
+ </packing>
|
|
156 |
+ </child>
|
|
157 |
</widget>
|
|
158 |
</child>
|
|
159 |
</widget>
|