18027
|
1 |
/*
|
18039
|
2 |
* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
|
18027
|
3 |
*
|
|
4 |
* Permission is hereby granted, free of charge, to any person obtaining a
|
18039
|
5 |
* copy of this software and associated documentation files (the "Software"),
|
|
6 |
* to deal in the Software without restriction, including without limitation
|
|
7 |
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
8 |
* and/or sell copies of the Software, and to permit persons to whom the
|
|
9 |
* Software is furnished to do so, subject to the following conditions:
|
18027
|
10 |
*
|
18039
|
11 |
* The above copyright notice and this permission notice (including the next
|
|
12 |
* paragraph) shall be included in all copies or substantial portions of the
|
|
13 |
* Software.
|
18027
|
14 |
*
|
18039
|
15 |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16 |
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17 |
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
18 |
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19 |
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
20 |
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
21 |
* DEALINGS IN THE SOFTWARE.
|
18027
|
22 |
*/
|
|
23 |
|
|
24 |
Sun bug 5077981/GNOME bug 147579:
|
|
25 |
There should be an option to extend/disable lockout timer
|
|
26 |
http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=5077981
|
|
27 |
http://bugzilla.gnome.org/show_bug.cgi?id=147579
|
|
28 |
|
|
29 |
Sun bug 6176524:
|
|
30 |
passwdTimeoutEnable for disabled user (xscreensaver-lock)
|
|
31 |
http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6176524
|
|
32 |
|
18039
|
33 |
diff --git xscreensaver-5.11/driver/XScreenSaver.ad.in xscreensaver-5.11/driver/XScreenSaver.ad.in
|
|
34 |
--- xscreensaver-5.11/driver/XScreenSaver.ad.in
|
|
35 |
+++ xscreensaver-5.11/driver/XScreenSaver.ad.in
|
18027
|
36 |
@@ -34,6 +34,7 @@
|
|
37 |
*cycle: 0:10:00
|
|
38 |
*lockTimeout: 0:00:00
|
|
39 |
*passwdTimeout: 0:02:00
|
|
40 |
+*passwdTimeoutEnabled: True
|
|
41 |
*dpmsEnabled: True
|
|
42 |
*dpmsStandby: 0:10:00
|
|
43 |
*dpmsSuspend: 0:10:00
|
18039
|
44 |
diff --git xscreensaver-5.11/driver/demo-Gtk.c xscreensaver-5.11/driver/demo-Gtk.c
|
|
45 |
--- xscreensaver-5.11/driver/demo-Gtk.c
|
|
46 |
+++ xscreensaver-5.11/driver/demo-Gtk.c
|
18077
|
47 |
@@ -1526,6 +1526,8 @@ flush_dialog_changes_and_save (state *s)
|
18027
|
48 |
|
|
49 |
MINUTES (&p2->timeout, "timeout_spinbutton");
|
|
50 |
MINUTES (&p2->cycle, "cycle_spinbutton");
|
18061
|
51 |
+ CHECKBOX (p2->pwd_p, "pwd_button"); /* bugid 5077981 */
|
18027
|
52 |
+ MINUTES (&p2->passwd_timeout, "pwd_spinbutton");
|
|
53 |
CHECKBOX (p2->lock_p, "lock_button");
|
|
54 |
MINUTES (&p2->lock_timeout, "lock_spinbutton");
|
|
55 |
|
18077
|
56 |
@@ -1617,6 +1619,8 @@ flush_dialog_changes_and_save (state *s)
|
18027
|
57 |
COPY(cycle, "cycle");
|
|
58 |
COPY(lock_p, "lock_p");
|
|
59 |
COPY(lock_timeout, "lock_timeout");
|
18061
|
60 |
+ COPY(pwd_p, "pwd_p"); /* bugid 5077981 */
|
18027
|
61 |
+ COPY(passwd_timeout, "passwd_timeout");
|
|
62 |
|
|
63 |
COPY(dpms_enabled_p, "dpms_enabled_p");
|
|
64 |
COPY(dpms_standby, "dpms_standby");
|
18077
|
65 |
@@ -2746,6 +2750,9 @@ populate_prefs_page (state *s)
|
18027
|
66 |
FMT_MINUTES ("timeout_spinbutton", p->timeout);
|
|
67 |
FMT_MINUTES ("cycle_spinbutton", p->cycle);
|
|
68 |
FMT_MINUTES ("lock_spinbutton", p->lock_timeout);
|
18061
|
69 |
+ /* bugid 5077981 */
|
18027
|
70 |
+ FMT_MINUTES ("pwd_spinbutton", p->passwd_timeout);
|
18061
|
71 |
+
|
18027
|
72 |
FMT_MINUTES ("dpms_standby_spinbutton", p->dpms_standby);
|
|
73 |
FMT_MINUTES ("dpms_suspend_spinbutton", p->dpms_suspend);
|
|
74 |
FMT_MINUTES ("dpms_off_spinbutton", p->dpms_off);
|
18077
|
75 |
@@ -2758,6 +2765,7 @@ populate_prefs_page (state *s)
|
18027
|
76 |
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (name_to_widget (s,(NAME))),\
|
|
77 |
(ACTIVEP))
|
|
78 |
|
18061
|
79 |
+ TOGGLE_ACTIVE ("pwd_button", p->pwd_p); /* bugid 5077981 */
|
18027
|
80 |
TOGGLE_ACTIVE ("lock_button", p->lock_p);
|
|
81 |
#if 0
|
18061
|
82 |
TOGGLE_ACTIVE ("verbose_button", p->verbose_p);
|
18077
|
83 |
@@ -2862,6 +2870,10 @@ populate_prefs_page (state *s)
|
18027
|
84 |
|
|
85 |
/* Blanking and Locking
|
|
86 |
*/
|
18061
|
87 |
+ /* bugid 5077081 */
|
18027
|
88 |
+ SENSITIZE ("pwd_spinbutton", p->pwd_p);
|
|
89 |
+ SENSITIZE ("pwd_mlabel", p->pwd_p);
|
|
90 |
+
|
|
91 |
SENSITIZE ("lock_button", can_lock_p);
|
|
92 |
SENSITIZE ("lock_spinbutton", can_lock_p && p->lock_p);
|
|
93 |
SENSITIZE ("lock_mlabel", can_lock_p && p->lock_p);
|
18077
|
94 |
@@ -3033,6 +3045,7 @@ fix_text_entry_sizes (state *s)
|
18027
|
95 |
# if 0 /* appears no longer necessary with Gtk 1.2.10 */
|
|
96 |
const char * const spinbuttons[] = {
|
|
97 |
"timeout_spinbutton", "cycle_spinbutton", "lock_spinbutton",
|
18061
|
98 |
+ "pwd_spinbutton", /* bugid 5077981 */
|
18039
|
99 |
"dpms_standby_spinbutton", "dpms_suspend_spinbutton",
|
18027
|
100 |
"dpms_off_spinbutton",
|
|
101 |
"-fade_spinbutton" };
|
18061
|
102 |
diff --git xscreensaver-5.11/driver/lock.c xscreensaver-5.11/driver/lock.c
|
|
103 |
--- xscreensaver-5.11/driver/lock.c
|
|
104 |
+++ xscreensaver-5.11/driver/lock.c
|
18077
|
105 |
@@ -1542,6 +1542,10 @@ update_passwd_window (saver_info *si, const char *printed_passwd, float ratio)
|
18061
|
106 |
event.xclient.data.l[1] = 0;
|
|
107 |
event.xclient.data.l[2] = 0;
|
|
108 |
|
|
109 |
+ /* CR 6176524 passwdTimeoutEnable for disabled user */
|
|
110 |
+ if (! si->prefs.pwd_p)
|
|
111 |
+ event.xclient.data.l[1] = 1;
|
|
112 |
+
|
|
113 |
XSync (si->dpy, False);
|
|
114 |
old_handler = XSetErrorHandler (ignore_all_errors_ehandler);
|
|
115 |
|
18077
|
116 |
@@ -2455,7 +2459,9 @@ passwd_event_loop (saver_info *si)
|
|
117 |
/* bugid 6176524 passwdTimeout and reset timer for each key press */
|
|
118 |
passwd_dialog_data *pw = si->pw_data;
|
18061
|
119 |
|
18077
|
120 |
- passwd_animate_timer ((XtPointer) si, 0);
|
|
121 |
+ /* CR 6176524 passwdTimeoutEnable for disabled user */
|
|
122 |
+ if (! si->prefs.pwd_p)
|
|
123 |
+ passwd_animate_timer ((XtPointer) si, 0);
|
|
124 |
|
|
125 |
si->pw_data->got_passwd = FALSE;
|
|
126 |
|
18039
|
127 |
diff --git xscreensaver-5.11/driver/prefs.c xscreensaver-5.11/driver/prefs.c
|
|
128 |
--- xscreensaver-5.11/driver/prefs.c
|
|
129 |
+++ xscreensaver-5.11/driver/prefs.c
|
18061
|
130 |
@@ -251,6 +251,7 @@ static const char * const prefs[] = {
|
18027
|
131 |
"lockVTs", /* not saved */
|
|
132 |
"lockTimeout",
|
|
133 |
"passwdTimeout",
|
18061
|
134 |
+ "passwdTimeoutEnabled", /* bugid 5077981 */
|
18027
|
135 |
"visualID",
|
|
136 |
"installColormap",
|
|
137 |
"verbose",
|
18061
|
138 |
@@ -782,6 +783,9 @@ write_init_file (Display *dpy,
|
18027
|
139 |
CHECK("lockVTs") continue; /* don't save, unused */
|
|
140 |
CHECK("lockTimeout") type = pref_time, t = p->lock_timeout;
|
|
141 |
CHECK("passwdTimeout") type = pref_time, t = p->passwd_timeout;
|
|
142 |
+
|
18061
|
143 |
+/* bugid 5077981 */
|
|
144 |
+ CHECK("passwdTimeoutEnabled") type = pref_bool, b = p->pwd_p;
|
18027
|
145 |
CHECK("visualID") type = pref_str, s = visual_name;
|
|
146 |
CHECK("installColormap") type = pref_bool, b = p->install_cmap_p;
|
|
147 |
CHECK("verbose") type = pref_bool, b = p->verbose_p;
|
18061
|
148 |
@@ -1064,6 +1068,8 @@ load_init_file (Display *dpy, saver_preferences *p)
|
18027
|
149 |
p->lock_timeout = 1000 * get_minutes_resource (dpy, "lockTimeout", "Time");
|
|
150 |
p->cycle = 1000 * get_minutes_resource (dpy, "cycle", "Time");
|
|
151 |
p->passwd_timeout = 1000 * get_seconds_resource (dpy, "passwdTimeout", "Time");
|
18061
|
152 |
+ /* bugid 5077981 */
|
|
153 |
+ p->pwd_p = get_boolean_resource (dpy, "passwdTimeoutEnabled", "Boolean");
|
18027
|
154 |
p->pointer_timeout = 1000 * get_seconds_resource (dpy, "pointerPollTime", "Time");
|
|
155 |
p->pointer_hysteresis = get_integer_resource (dpy, "pointerHysteresis","Integer");
|
|
156 |
p->notice_events_timeout = 1000*get_seconds_resource(dpy,
|
18039
|
157 |
diff --git xscreensaver-5.11/driver/types.h xscreensaver-5.11/driver/types.h
|
|
158 |
--- xscreensaver-5.11/driver/types.h
|
|
159 |
+++ xscreensaver-5.11/driver/types.h
|
18027
|
160 |
@@ -77,6 +77,8 @@ struct saver_preferences {
|
|
161 |
Bool xsync_p; /* whether XSynchronize has been called */
|
|
162 |
|
|
163 |
Bool lock_p; /* whether to lock as well as save */
|
|
164 |
+ Bool pwd_p; /* whether to disable/enable pwd timeout */
|
|
165 |
+ /* bugid 5077981 */
|
|
166 |
|
|
167 |
Bool fade_p; /* whether to fade to black, if possible */
|
|
168 |
Bool unfade_p; /* whether to fade from black, if possible */
|
18039
|
169 |
diff --git xscreensaver-5.11/driver/xscreensaver-demo.glade2 xscreensaver-5.11/driver/xscreensaver-demo.glade2
|
|
170 |
--- xscreensaver-5.11/driver/xscreensaver-demo.glade2
|
|
171 |
+++ xscreensaver-5.11/driver/xscreensaver-demo.glade2
|
18027
|
172 |
@@ -165,7 +165,7 @@
|
|
173 |
<child>
|
|
174 |
<widget class="GtkTable" id="blanking_table">
|
|
175 |
<property name="visible">True</property>
|
|
176 |
- <property name="n_rows">3</property>
|
|
177 |
+ <property name="n_rows">4</property>
|
|
178 |
<property name="n_columns">4</property>
|
|
179 |
<property name="homogeneous">False</property>
|
|
180 |
<property name="row_spacing">2</property>
|
|
181 |
@@ -339,6 +339,65 @@
|
|
182 |
</child>
|
|
183 |
|
|
184 |
<child>
|
|
185 |
+ <widget class="GtkSpinButton" id="pwd_spinbutton">
|
|
186 |
+ <property name="visible">True</property>
|
|
187 |
+ <property name="tooltip" translatable="yes">How long the unlock dialog waits for input before disappearing.</property>
|
|
188 |
+ <property name="can_focus">True</property>
|
|
189 |
+ <property name="climb_rate">15</property>
|
|
190 |
+ <property name="digits">0</property>
|
|
191 |
+ <property name="numeric">True</property>
|
|
192 |
+ <property name="update_policy">GTK_UPDATE_ALWAYS</property>
|
|
193 |
+ <property name="snap_to_ticks">True</property>
|
|
194 |
+ <property name="wrap">False</property>
|
|
195 |
+ <property name="adjustment">0 0 720 1 15 15</property>
|
|
196 |
+ <signal name="activate" handler="pref_changed_cb"/>
|
|
197 |
+ <signal name="focus_out_event" handler="pref_changed_event_cb"/>
|
|
198 |
+ <signal name="value_changed" handler="pref_changed_cb"/>
|
|
199 |
+ </widget>
|
|
200 |
+ <packing>
|
|
201 |
+ <property name="left_attach">2</property>
|
|
202 |
+ <property name="right_attach">3</property>
|
|
203 |
+ <property name="top_attach">3</property>
|
|
204 |
+ <property name="bottom_attach">4</property>
|
|
205 |
+ <property name="y_padding">10</property>
|
|
206 |
+ <property name="x_options">fill</property>
|
|
207 |
+ <property name="y_options"></property>
|
|
208 |
+ </packing>
|
|
209 |
+ </child>
|
|
210 |
+
|
|
211 |
+ <child>
|
|
212 |
+ <widget class="GtkEventBox" id="pwd_button_eventbox">
|
|
213 |
+ <property name="visible">True</property>
|
|
214 |
+ <property name="tooltip" translatable="yes">Whether the unlock dialog box should disappear after a timeout.</property>
|
|
215 |
+ <property name="visible_window">True</property>
|
|
216 |
+ <property name="above_child">False</property>
|
|
217 |
+
|
|
218 |
+ <child>
|
|
219 |
+ <widget class="GtkCheckButton" id="pwd_button">
|
|
220 |
+ <property name="visible">True</property>
|
|
221 |
+ <property name="can_focus">True</property>
|
|
222 |
+ <property name="label" translatable="yes">Timeout _Unlock After</property>
|
|
223 |
+ <property name="use_underline">True</property>
|
|
224 |
+ <property name="relief">GTK_RELIEF_NORMAL</property>
|
|
225 |
+ <property name="focus_on_click">True</property>
|
|
226 |
+ <property name="active">False</property>
|
|
227 |
+ <property name="inconsistent">False</property>
|
|
228 |
+ <property name="draw_indicator">True</property>
|
|
229 |
+ <signal name="toggled" handler="pref_changed_cb"/>
|
|
230 |
+ </widget>
|
|
231 |
+ </child>
|
|
232 |
+ </widget>
|
|
233 |
+ <packing>
|
|
234 |
+ <property name="left_attach">0</property>
|
|
235 |
+ <property name="right_attach">2</property>
|
|
236 |
+ <property name="top_attach">3</property>
|
|
237 |
+ <property name="bottom_attach">4</property>
|
|
238 |
+ <property name="x_options">fill</property>
|
|
239 |
+ <property name="y_options">fill</property>
|
|
240 |
+ </packing>
|
|
241 |
+ </child>
|
|
242 |
+
|
|
243 |
+ <child>
|
|
244 |
<widget class="GtkLabel" id="cycle_mlabel">
|
|
245 |
<property name="visible">True</property>
|
|
246 |
<property name="label" translatable="yes">minutes</property>
|
|
247 |
@@ -393,6 +452,29 @@
|
|
248 |
</child>
|
|
249 |
|
|
250 |
<child>
|
|
251 |
+ <widget class="GtkLabel" id="pwd_mlabel">
|
|
252 |
+ <property name="visible">True</property>
|
|
253 |
+ <property name="label" translatable="yes">minutes</property>
|
|
254 |
+ <property name="use_underline">False</property>
|
|
255 |
+ <property name="use_markup">False</property>
|
|
256 |
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
|
|
257 |
+ <property name="wrap">False</property>
|
|
258 |
+ <property name="selectable">False</property>
|
|
259 |
+ <property name="xalign">0</property>
|
|
260 |
+ <property name="yalign">0.5</property>
|
|
261 |
+ <property name="xpad">8</property>
|
|
262 |
+ <property name="ypad">0</property>
|
|
263 |
+ </widget>
|
|
264 |
+ <packing>
|
|
265 |
+ <property name="left_attach">3</property>
|
|
266 |
+ <property name="right_attach">4</property>
|
|
267 |
+ <property name="top_attach">3</property>
|
|
268 |
+ <property name="bottom_attach">4</property>
|
|
269 |
+ <property name="y_options"></property>
|
|
270 |
+ </packing>
|
|
271 |
+ </child>
|
|
272 |
+
|
|
273 |
+ <child>
|
|
274 |
<widget class="GtkLabel" id="timeout_label">
|
|
275 |
<property name="visible">True</property>
|
|
276 |
<property name="label" translatable="yes">_Blank After</property>
|
18039
|
277 |
|