1379N/AFrom 37f1a55c40ce9aaf136f1512068b04f6a5c36d48 Mon Sep 17 00:00:00 2001
1379N/AFrom: Alan Coopersmith <alan.coopersmith@oracle.com>
1379N/ADate: Sat, 2 Jan 2016 22:02:23 -0800
1379N/ASubject: [PATCH] passwdTimeout pref
1379N/ABug 15231258 SUNBT6176524 passwdTimeoutEnable for disabled user
1379N/A 6 files changed, 127 insertions(+), 1 deletion(-)
1379N/Aindex 3e1ff8a..0a0ccf8 100644
1379N/A+*passwdTimeoutEnabled: True
1379N/A *dpmsQuickoffEnabled: False
1379N/Aindex d4cc4a5..3d86087 100644
1379N/A@@ -1566,6 +1566,8 @@ flush_dialog_changes_and_save (state *s)
1379N/A MINUTES (&p2->timeout, "timeout_spinbutton");
1379N/A MINUTES (&p2->cycle, "cycle_spinbutton");
1379N/A+ CHECKBOX (p2->unlock_timeout_p, "pwd_button"); /* bugid 5077981 */
1379N/A+ MINUTES (&p2->passwd_timeout, "pwd_spinbutton");
1379N/A CHECKBOX (p2->lock_p, "lock_button");
1379N/A MINUTES (&p2->lock_timeout, "lock_spinbutton");
1379N/A@@ -1670,6 +1672,8 @@ flush_dialog_changes_and_save (state *s)
1379N/A COPY(lock_timeout, "lock_timeout");
1379N/A+ COPY(unlock_timeout_p,"unlock_timeout_p"); /* bugid 5077981 */
1379N/A+ COPY(passwd_timeout, "passwd_timeout");
1379N/A COPY(dpms_enabled_p, "dpms_enabled_p");
1379N/A COPY(dpms_quickoff_p, "dpms_quickoff_enabled_p");
1379N/A@@ -2802,6 +2806,9 @@ populate_prefs_page (state *s)
1379N/A FMT_MINUTES ("timeout_spinbutton", p->timeout);
1379N/A FMT_MINUTES ("cycle_spinbutton", p->cycle);
1379N/A FMT_MINUTES ("lock_spinbutton", p->lock_timeout);
1379N/A+ FMT_MINUTES ("pwd_spinbutton", p->passwd_timeout);
1379N/A FMT_MINUTES ("dpms_standby_spinbutton", p->dpms_standby);
1379N/A FMT_MINUTES ("dpms_suspend_spinbutton", p->dpms_suspend);
1379N/A FMT_MINUTES ("dpms_off_spinbutton", p->dpms_off);
1379N/A@@ -2814,6 +2821,7 @@ populate_prefs_page (state *s)
1379N/A gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (name_to_widget (s,(NAME))),\
1379N/A+ TOGGLE_ACTIVE ("pwd_button", p->unlock_timeout_p); /* bugid 5077981 */
1379N/A TOGGLE_ACTIVE ("lock_button", p->lock_p);
1379N/A TOGGLE_ACTIVE ("verbose_button", p->verbose_p);
1379N/A@@ -2919,6 +2927,10 @@ populate_prefs_page (state *s)
1379N/A+ SENSITIZE ("pwd_spinbutton", p->unlock_timeout_p);
1379N/A+ SENSITIZE ("pwd_mlabel", p->unlock_timeout_p);
1379N/A SENSITIZE ("lock_button", can_lock_p);
1379N/A SENSITIZE ("lock_spinbutton", can_lock_p && p->lock_p);
1379N/A SENSITIZE ("lock_mlabel", can_lock_p && p->lock_p);
1379N/A@@ -3093,6 +3105,7 @@ fix_text_entry_sizes (state *s)
1379N/A # if 0 /* appears no longer necessary with Gtk 1.2.10 */
1379N/A const char * const spinbuttons[] = {
1379N/A "timeout_spinbutton", "cycle_spinbutton", "lock_spinbutton",
1379N/A+ "pwd_spinbutton", /* bugid 5077981 */
1379N/A "dpms_standby_spinbutton", "dpms_suspend_spinbutton",
1379N/Aindex becf85b..08f0f98 100644
1379N/A@@ -1651,6 +1651,10 @@ update_passwd_window (saver_info *si, const char *printed_passwd, float ratio)
1379N/A+ /* CR 5077981: option to disable unlock timer */
1379N/A if (!safe_XSendEvent (si->dpy, si->passwd_dialog, False, 0L, &event))
1379N/A fprintf (stderr, "%s: error sending ratio to lock dialog\n", blurb ());
1379N/A@@ -2358,6 +2362,10 @@ passwd_animate_timer (XtPointer closure, XtIntervalId *id)
1379N/A+ /* CR 5077981: option to disable unlock timer */
1379N/A #ifdef HAVE_XSCREENSAVER_LOCK
1379N/A /* We want to make sure dialog is up before we update countdown timer */
1379N/Aindex 55bac7b..52538a8 100644
1379N/A@@ -252,6 +252,7 @@ static const char * const prefs[] = {
1379N/A+ "passwdTimeoutEnabled", /* bugid 5077981 */
1379N/A@@ -786,6 +787,9 @@ write_init_file (Display *dpy,
1379N/A CHECK("lockVTs") continue; /* don't save, unused */
1379N/A CHECK("lockTimeout") type = pref_time, t = p->lock_timeout;
1379N/A CHECK("passwdTimeout") type = pref_time, t = p->passwd_timeout;
1379N/A+ CHECK("passwdTimeoutEnabled") type = pref_bool, b = p->unlock_timeout_p;
1379N/A CHECK("visualID") type = pref_str, s = visual_name;
1379N/A CHECK("installColormap") type = pref_bool, b = p->install_cmap_p;
1379N/A CHECK("verbose") type = pref_bool, b = p->verbose_p;
1379N/A@@ -1071,6 +1075,8 @@ load_init_file (Display *dpy, saver_preferences *p)
1379N/A p->lock_timeout = 1000 * get_minutes_resource (dpy, "lockTimeout", "Time");
1379N/A p->cycle = 1000 * get_minutes_resource (dpy, "cycle", "Time");
1379N/A p->passwd_timeout = 1000 * get_seconds_resource (dpy, "passwdTimeout", "Time");
1379N/A+ p->unlock_timeout_p = get_boolean_resource (dpy, "passwdTimeoutEnabled", "Boolean");
1379N/A p->pointer_timeout = 1000 * get_seconds_resource (dpy, "pointerPollTime", "Time");
1379N/A p->pointer_hysteresis = get_integer_resource (dpy, "pointerHysteresis","Integer");
1379N/A p->notice_events_timeout = 1000*get_seconds_resource(dpy,
1379N/A@@ -97,6 +97,8 @@ struct saver_preferences {
1379N/A Bool xsync_p; /* whether XSynchronize has been called */
1379N/A Bool lock_p; /* whether to lock as well as save */
1379N/A+ Bool unlock_timeout_p; /* whether to timeout unlock dialog */
1379N/A Bool fade_p; /* whether to fade to black, if possible */
1379N/A Bool unfade_p; /* whether to fade from black, if possible */
1379N/A <widget class="GtkTable" id="blanking_table">
1379N/A <property name="visible">True</property>
1379N/A- <property name="n_rows">3</property>
1379N/A+ <property name="n_rows">4</property>
1379N/A <property name="n_columns">4</property>
1379N/A <property name="homogeneous">False</property>
1379N/A <property name="row_spacing">2</property>
1379N/A <property name="y_options"></property>
1379N/A+ <widget class="GtkSpinButton" id="pwd_spinbutton">
1379N/A+ <property name="visible">True</property>
1379N/A+ <property name="tooltip" translatable="yes">How long the unlock dialog waits for input before disappearing.</property>
1379N/A+ <property name="can_focus">True</property>
1379N/A+ <property name="climb_rate">15</property>
1379N/A+ <property name="digits">0</property>
1379N/A+ <property name="numeric">True</property>
1379N/A+ <property name="update_policy">GTK_UPDATE_ALWAYS</property>
1379N/A+ <property name="snap_to_ticks">True</property>
1379N/A+ <property name="wrap">False</property>
1379N/A+ <property name="adjustment">0 0 720 1 15 15</property>
1379N/A+ <atkrelation target="pwd_button" type="controlled-by"/>
1379N/A+ <atkrelation target="pwd_button" type="labelled-by"/>
1379N/A+ <atkrelation target="pwd_mlabel" type="labelled-by"/>
1379N/A+ <signal name="activate" handler="pref_changed_cb"/>
1379N/A+ <signal name="focus_out_event" handler="pref_changed_event_cb"/>
1379N/A+ <signal name="value_changed" handler="pref_changed_cb"/>
1379N/A+ <property name="left_attach">2</property>
1379N/A+ <property name="right_attach">3</property>
1379N/A+ <property name="top_attach">3</property>
1379N/A+ <property name="bottom_attach">4</property>
1379N/A+ <property name="y_padding">10</property>
1379N/A+ <property name="x_options">fill</property>
1379N/A+ <property name="y_options"></property>
1379N/A+ <widget class="GtkEventBox" id="pwd_button_eventbox">
1379N/A+ <property name="visible">True</property>
1379N/A+ <property name="tooltip" translatable="yes">Whether the unlock dialog box should disappear after a timeout.</property>
1379N/A+ <property name="visible_window">True</property>
1379N/A+ <property name="above_child">False</property>
1379N/A+ <widget class="GtkCheckButton" id="pwd_button">
1379N/A+ <property name="visible">True</property>
1379N/A+ <property name="can_focus">True</property>
1379N/A+ <property name="label" translatable="yes">Timeout _Unlock After</property>
1379N/A+ <property name="use_underline">True</property>
1379N/A+ <property name="relief">GTK_RELIEF_NORMAL</property>
1379N/A+ <property name="focus_on_click">True</property>
1379N/A+ <property name="active">False</property>
1379N/A+ <property name="inconsistent">False</property>
1379N/A+ <property name="draw_indicator">True</property>
1379N/A+ <atkrelation target="pwd_spinbutton" type="controller-for"/>
1379N/A+ <atkrelation target="pwd_spinbutton" type="label-for"/>
1379N/A+ <atkrelation target="pwd_spinbutton" type="flows-to"/>
1379N/A+ <signal name="toggled" handler="pref_changed_cb"/>
1379N/A+ <property name="left_attach">0</property>
1379N/A+ <property name="right_attach">2</property>
1379N/A+ <property name="top_attach">3</property>
1379N/A+ <property name="bottom_attach">4</property>
1379N/A+ <property name="x_options">fill</property>
1379N/A+ <property name="y_options">fill</property>
1379N/A+ <widget class="GtkLabel" id="pwd_mlabel">
1379N/A+ <property name="visible">True</property>
1379N/A+ <property name="label" translatable="yes">minutes</property>
1379N/A+ <property name="use_underline">False</property>
1379N/A+ <property name="use_markup">False</property>
1379N/A+ <property name="justify">GTK_JUSTIFY_LEFT</property>
1379N/A+ <property name="wrap">False</property>
1379N/A+ <property name="selectable">False</property>
1379N/A+ <property name="xalign">0</property>
1379N/A+ <property name="yalign">0.5</property>
1379N/A+ <property name="xpad">8</property>
1379N/A+ <property name="ypad">0</property>
1379N/A+ <atkrelation target="pwd_spinbutton" type="label-for"/>
1379N/A+ <atkrelation target="pwd_spinbutton" type="flows-from"/>
1379N/A+ <property name="left_attach">3</property>
1379N/A+ <property name="right_attach">4</property>
1379N/A+ <property name="top_attach">3</property>
1379N/A+ <property name="bottom_attach">4</property>
1379N/A+ <property name="y_options"></property>
1379N/A <property name="left_attach">0</property>