components/desktop/xscreensaver/patches/08-passwdTimeout-pref.patch
changeset 5400 1199f8e91f50
equal deleted inserted replaced
5399:88010dbde9bb 5400:1199f8e91f50
       
     1 Bug 15220000 SUNBT5077981 There should be an option to extend/disable lockout
       
     2                           timer
       
     3 aka http://bugzilla.gnome.org/show_bug.cgi?id=147579
       
     4  
       
     5 Bug 15231258 SUNBT6176524 passwdTimeoutEnable for disabled user
       
     6 
       
     7 Upstream status unknown.
       
     8 
       
     9 ---
       
    10  driver/XScreenSaver.ad.in       |    1 +
       
    11  driver/demo-Gtk.c               |   13 +++++
       
    12  driver/lock.c                   |    8 +++
       
    13  driver/prefs.c                  |    6 ++
       
    14  driver/types.h                  |    2 +
       
    15  driver/xscreensaver-demo.glade2 |   98 ++++++++++++++++++++++++++++++++++++++-
       
    16  6 files changed, 127 insertions(+), 1 deletions(-)
       
    17 
       
    18 diff --git a/driver/XScreenSaver.ad.in b/driver/XScreenSaver.ad.in
       
    19 --- a/driver/XScreenSaver.ad.in
       
    20 +++ b/driver/XScreenSaver.ad.in
       
    21 @@ -34,6 +34,7 @@
       
    22  *cycle:			0:10:00
       
    23  *lockTimeout:		0:00:00
       
    24  *passwdTimeout:		0:02:00
       
    25 +*passwdTimeoutEnabled:	True
       
    26  *dpmsEnabled:		True
       
    27  *dpmsQuickoffEnabled:	False
       
    28  *dpmsStandby:		0:10:00
       
    29 diff --git a/driver/demo-Gtk.c b/driver/demo-Gtk.c
       
    30 --- a/driver/demo-Gtk.c
       
    31 +++ b/driver/demo-Gtk.c
       
    32 @@ -1558,6 +1558,8 @@ flush_dialog_changes_and_save (state *s)
       
    33  
       
    34    MINUTES  (&p2->timeout,         "timeout_spinbutton");
       
    35    MINUTES  (&p2->cycle,           "cycle_spinbutton");
       
    36 +  CHECKBOX (p2->unlock_timeout_p, "pwd_button");	/* bugid 5077981 */
       
    37 +  MINUTES  (&p2->passwd_timeout,  "pwd_spinbutton");
       
    38    CHECKBOX (p2->lock_p,           "lock_button");
       
    39    MINUTES  (&p2->lock_timeout,    "lock_spinbutton");
       
    40  
       
    41 @@ -1660,6 +1662,8 @@ flush_dialog_changes_and_save (state *s)
       
    42    COPY(cycle,          "cycle");
       
    43    COPY(lock_p,         "lock_p");
       
    44    COPY(lock_timeout,   "lock_timeout");
       
    45 +  COPY(unlock_timeout_p,"unlock_timeout_p");		/* bugid 5077981 */
       
    46 +  COPY(passwd_timeout, "passwd_timeout");
       
    47  
       
    48    COPY(dpms_enabled_p,  "dpms_enabled_p");
       
    49    COPY(dpms_quickoff_p, "dpms_quickoff_enabled_p");
       
    50 @@ -2791,6 +2795,9 @@ populate_prefs_page (state *s)
       
    51    FMT_MINUTES ("timeout_spinbutton",      p->timeout);
       
    52    FMT_MINUTES ("cycle_spinbutton",        p->cycle);
       
    53    FMT_MINUTES ("lock_spinbutton",         p->lock_timeout);
       
    54 +  /* bugid 5077981 */
       
    55 +  FMT_MINUTES ("pwd_spinbutton",          p->passwd_timeout);
       
    56 +
       
    57    FMT_MINUTES ("dpms_standby_spinbutton", p->dpms_standby);
       
    58    FMT_MINUTES ("dpms_suspend_spinbutton", p->dpms_suspend);
       
    59    FMT_MINUTES ("dpms_off_spinbutton",     p->dpms_off);
       
    60 @@ -2803,6 +2810,7 @@ populate_prefs_page (state *s)
       
    61    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (name_to_widget (s,(NAME))),\
       
    62                                  (ACTIVEP))
       
    63  
       
    64 +  TOGGLE_ACTIVE ("pwd_button",	      p->unlock_timeout_p); /* bugid 5077981 */
       
    65    TOGGLE_ACTIVE ("lock_button",       p->lock_p);
       
    66  #if 0
       
    67    TOGGLE_ACTIVE ("verbose_button",    p->verbose_p);
       
    68 @@ -2908,6 +2916,10 @@ populate_prefs_page (state *s)
       
    69  
       
    70      /* Blanking and Locking
       
    71       */
       
    72 +    /* bugid 5077081 */
       
    73 +    SENSITIZE ("pwd_spinbutton", p->unlock_timeout_p);
       
    74 +    SENSITIZE ("pwd_mlabel",     p->unlock_timeout_p);
       
    75 +
       
    76      SENSITIZE ("lock_button",     can_lock_p);
       
    77      SENSITIZE ("lock_spinbutton", can_lock_p && p->lock_p);
       
    78      SENSITIZE ("lock_mlabel",     can_lock_p && p->lock_p);
       
    79 @@ -3082,6 +3094,7 @@ fix_text_entry_sizes (state *s)
       
    80  # if 0   /* appears no longer necessary with Gtk 1.2.10 */
       
    81    const char * const spinbuttons[] = {
       
    82      "timeout_spinbutton", "cycle_spinbutton", "lock_spinbutton",
       
    83 +    "pwd_spinbutton", /* bugid 5077981 */
       
    84      "dpms_standby_spinbutton", "dpms_suspend_spinbutton",
       
    85      "dpms_off_spinbutton",
       
    86      "-fade_spinbutton" };
       
    87 diff --git a/driver/lock.c b/driver/lock.c
       
    88 --- a/driver/lock.c
       
    89 +++ b/driver/lock.c
       
    90 @@ -1646,6 +1646,10 @@ update_passwd_window (saver_info *si, const char *printed_passwd, float ratio)
       
    91        event.xclient.data.l[1] = 0;
       
    92        event.xclient.data.l[2] = 0;
       
    93  
       
    94 +      /* CR 5077981: option to disable unlock timer */
       
    95 +      if (! si->prefs.unlock_timeout_p)
       
    96 +        event.xclient.data.l[1] = 1;
       
    97 +
       
    98        if (!safe_XSendEvent (si->dpy, si->passwd_dialog, False, 0L, &event))
       
    99          fprintf (stderr, "%s: error sending ratio to lock dialog\n", blurb ());
       
   100      }
       
   101 @@ -2349,6 +2353,10 @@ passwd_animate_timer (XtPointer closure, XtIntervalId *id)
       
   102  
       
   103    if (!pw) return;
       
   104  
       
   105 +  /* CR 5077981: option to disable unlock timer */
       
   106 +  if (! si->prefs.unlock_timeout_p)
       
   107 +    return;
       
   108 +
       
   109  #ifdef HAVE_XSCREENSAVER_LOCK
       
   110    /* We want to make sure dialog is up before we update countdown timer */
       
   111    if (!si->passwd_dialog)
       
   112 diff --git a/driver/prefs.c b/driver/prefs.c
       
   113 --- a/driver/prefs.c
       
   114 +++ b/driver/prefs.c
       
   115 @@ -251,6 +251,7 @@ static const char * const prefs[] = {
       
   116    "lockVTs",			/* not saved */
       
   117    "lockTimeout",
       
   118    "passwdTimeout",
       
   119 +  "passwdTimeoutEnabled",	/* bugid 5077981 */
       
   120    "visualID",
       
   121    "installColormap",
       
   122    "verbose",
       
   123 @@ -784,6 +785,9 @@ write_init_file (Display *dpy,
       
   124        CHECK("lockVTs")		continue;  /* don't save, unused */
       
   125        CHECK("lockTimeout")	type = pref_time, t = p->lock_timeout;
       
   126        CHECK("passwdTimeout")	type = pref_time, t = p->passwd_timeout;
       
   127 +
       
   128 +/* bugid 5077981 */
       
   129 +      CHECK("passwdTimeoutEnabled") type = pref_bool, b = p->unlock_timeout_p;
       
   130        CHECK("visualID")		type = pref_str,  s =    visual_name;
       
   131        CHECK("installColormap")	type = pref_bool, b = p->install_cmap_p;
       
   132        CHECK("verbose")		type = pref_bool, b = p->verbose_p;
       
   133 @@ -1068,6 +1072,8 @@ load_init_file (Display *dpy, saver_preferences *p)
       
   134    p->lock_timeout    = 1000 * get_minutes_resource (dpy, "lockTimeout", "Time");
       
   135    p->cycle           = 1000 * get_minutes_resource (dpy, "cycle", "Time");
       
   136    p->passwd_timeout  = 1000 * get_seconds_resource (dpy, "passwdTimeout", "Time");
       
   137 +  /* bugid 5077981 */
       
   138 +  p->unlock_timeout_p = get_boolean_resource (dpy, "passwdTimeoutEnabled", "Boolean");
       
   139    p->pointer_timeout = 1000 * get_seconds_resource (dpy, "pointerPollTime", "Time");
       
   140    p->pointer_hysteresis = get_integer_resource (dpy, "pointerHysteresis","Integer");
       
   141    p->notice_events_timeout = 1000*get_seconds_resource(dpy,
       
   142 diff --git a/driver/types.h b/driver/types.h
       
   143 --- a/driver/types.h
       
   144 +++ b/driver/types.h
       
   145 @@ -77,6 +77,8 @@ struct saver_preferences {
       
   146    Bool xsync_p;			/* whether XSynchronize has been called */
       
   147  
       
   148    Bool lock_p;			/* whether to lock as well as save */
       
   149 +  Bool unlock_timeout_p;	/* whether to timeout unlock dialog */
       
   150 +                                /* bugid 5077981 */
       
   151  
       
   152    Bool fade_p;			/* whether to fade to black, if possible */
       
   153    Bool unfade_p;		/* whether to fade from black, if possible */
       
   154 diff --git a/driver/xscreensaver-demo.glade2 b/driver/xscreensaver-demo.glade2
       
   155 --- a/driver/xscreensaver-demo.glade2
       
   156 +++ b/driver/xscreensaver-demo.glade2
       
   157 @@ -165,7 +165,7 @@
       
   158  		  <child>
       
   159  		    <widget class="GtkTable" id="blanking_table">
       
   160  		      <property name="visible">True</property>
       
   161 -		      <property name="n_rows">3</property>
       
   162 +		      <property name="n_rows">4</property>
       
   163  		      <property name="n_columns">4</property>
       
   164  		      <property name="homogeneous">False</property>
       
   165  		      <property name="row_spacing">2</property>
       
   166 @@ -466,6 +466,102 @@
       
   167  			  <property name="y_options"></property>
       
   168  			</packing>
       
   169  		      </child>
       
   170 +
       
   171 +		      <child>
       
   172 +			<widget class="GtkSpinButton" id="pwd_spinbutton">
       
   173 +			  <property name="visible">True</property>
       
   174 +			  <property name="tooltip" translatable="yes">How long the unlock dialog waits for input before disappearing.</property>
       
   175 +			  <property name="can_focus">True</property>
       
   176 +			  <property name="climb_rate">15</property>
       
   177 +			  <property name="digits">0</property>
       
   178 +			  <property name="numeric">True</property>
       
   179 +			  <property name="update_policy">GTK_UPDATE_ALWAYS</property>
       
   180 +			  <property name="snap_to_ticks">True</property>
       
   181 +			  <property name="wrap">False</property>
       
   182 +			  <property name="adjustment">0 0 720 1 15 15</property>
       
   183 +			  <accessibility>
       
   184 +			    <atkrelation target="pwd_button" type="controlled-by"/>
       
   185 +			    <atkrelation target="pwd_button" type="labelled-by"/>
       
   186 +			    <atkrelation target="pwd_mlabel" type="labelled-by"/>
       
   187 +			  </accessibility>
       
   188 +			  <signal name="activate" handler="pref_changed_cb"/>
       
   189 +			  <signal name="focus_out_event" handler="pref_changed_event_cb"/>
       
   190 +			  <signal name="value_changed" handler="pref_changed_cb"/>
       
   191 +			</widget>
       
   192 +			<packing>
       
   193 +			  <property name="left_attach">2</property>
       
   194 +			  <property name="right_attach">3</property>
       
   195 +			  <property name="top_attach">3</property>
       
   196 +			  <property name="bottom_attach">4</property>
       
   197 +			  <property name="y_padding">10</property>
       
   198 +			  <property name="x_options">fill</property>
       
   199 +			  <property name="y_options"></property>
       
   200 +			</packing>
       
   201 +		      </child>
       
   202 +
       
   203 +		      <child>
       
   204 +			<widget class="GtkEventBox" id="pwd_button_eventbox">
       
   205 +			  <property name="visible">True</property>
       
   206 +			  <property name="tooltip" translatable="yes">Whether the unlock dialog box should disappear after a timeout.</property>
       
   207 +			  <property name="visible_window">True</property>
       
   208 +			  <property name="above_child">False</property>
       
   209 +
       
   210 +			  <child>
       
   211 +			    <widget class="GtkCheckButton" id="pwd_button">
       
   212 +			      <property name="visible">True</property>
       
   213 +			      <property name="can_focus">True</property>
       
   214 +			      <property name="label" translatable="yes">Timeout _Unlock After</property>
       
   215 +			      <property name="use_underline">True</property>
       
   216 +			      <property name="relief">GTK_RELIEF_NORMAL</property>
       
   217 +			      <property name="focus_on_click">True</property>
       
   218 +			      <property name="active">False</property>
       
   219 +			      <property name="inconsistent">False</property>
       
   220 +			      <property name="draw_indicator">True</property>
       
   221 +			      <accessibility>
       
   222 +				<atkrelation target="pwd_spinbutton" type="controller-for"/>
       
   223 +				<atkrelation target="pwd_spinbutton" type="label-for"/>
       
   224 +				<atkrelation target="pwd_spinbutton" type="flows-to"/>
       
   225 +			      </accessibility>
       
   226 +			      <signal name="toggled" handler="pref_changed_cb"/>
       
   227 +			    </widget>
       
   228 +			  </child>
       
   229 +			</widget>
       
   230 +			<packing>
       
   231 +			  <property name="left_attach">0</property>
       
   232 +			  <property name="right_attach">2</property>
       
   233 +			  <property name="top_attach">3</property>
       
   234 +			  <property name="bottom_attach">4</property>
       
   235 +			  <property name="x_options">fill</property>
       
   236 +			  <property name="y_options">fill</property>
       
   237 +			</packing>
       
   238 +		      </child>
       
   239 +
       
   240 +		      <child>
       
   241 +			<widget class="GtkLabel" id="pwd_mlabel">
       
   242 +			  <property name="visible">True</property>
       
   243 +			  <property name="label" translatable="yes">minutes</property>
       
   244 +			  <property name="use_underline">False</property>
       
   245 +			  <property name="use_markup">False</property>
       
   246 +			  <property name="justify">GTK_JUSTIFY_LEFT</property>
       
   247 +			  <property name="wrap">False</property>
       
   248 +			  <property name="selectable">False</property>
       
   249 +			  <property name="xalign">0</property>
       
   250 +			  <property name="yalign">0.5</property>
       
   251 +			  <property name="xpad">8</property>
       
   252 +			  <property name="ypad">0</property>
       
   253 +			  <accessibility>
       
   254 +			    <atkrelation target="pwd_spinbutton" type="label-for"/>
       
   255 +			    <atkrelation target="pwd_spinbutton" type="flows-from"/>
       
   256 +			  </accessibility>
       
   257 +			</widget>
       
   258 +			<packing>
       
   259 +			  <property name="left_attach">3</property>
       
   260 +			  <property name="right_attach">4</property>
       
   261 +			  <property name="top_attach">3</property>
       
   262 +			  <property name="bottom_attach">4</property>
       
   263 +			  <property name="y_options"></property>
       
   264 +			</packing>
       
   265 +		      </child>
       
   266  		    </widget>
       
   267  		    <packing>
       
   268  		      <property name="left_attach">0</property>