/* demo-Gtk.c --- implements the interactive demo-mode and options dialogs.
- * xscreensaver, Copyright (c) 1993-2002 Jamie Zawinski <jwz@jwz.org>
+ * xscreensaver, Copyright (c) 1993-2003 Jamie Zawinski <jwz@jwz.org>
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (widget));
if (!gtk_tree_selection_get_selected (selection, &model, &iter))
- return;
-
- path = gtk_tree_model_get_path (model, &iter);
+ path = gtk_tree_path_new_first ();
+ else
+ path = gtk_tree_model_get_path (model, &iter);
-# if 0
- gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (widget),
- path, NULL, FALSE, 0.0, 0.0);
-# else
gtk_tree_view_set_cursor (GTK_TREE_VIEW (widget), path, NULL, FALSE);
-# endif
+
+ gtk_tree_path_free (path);
+
#else /* !HAVE_GTK2 */
GtkScrolledWindow *scroller = 0;
look as good in the plain-old default Latin1 "C" locale.)
*/
#ifdef HAVE_GTK2
- sprintf(copy, ("Copyright \xC2\xA9 1991-2002 %s"), s);
+ sprintf(copy, ("Copyright \xC2\xA9 1991-2003 %s"), s);
#else /* !HAVE_GTK2 */
- sprintf(copy, ("Copyright \251 1991-2002 %s"), s);
+ sprintf(copy, ("Copyright \251 1991-2003 %s"), s);
#endif /* !HAVE_GTK2 */
sprintf (msg, "%s\n\n%s", copy, desc);
{
saver_preferences *p = &s->prefs;
+ Bool can_lock_p = True;
+
+ /* Disable all the "lock" controls if locking support was not provided
+ at compile-time, or if running on MacOS. */
+# if defined(NO_LOCKING) || defined(__APPLE__)
+ can_lock_p = False;
+# endif
+
+
/* The file supports timeouts of less than a minute, but the GUI does
not, so throttle the values to be at least one minute (since "0" is
a bad rounding choice...)
/* Blanking and Locking
*/
- SENSITIZE ("lock_spinbutton", p->lock_p);
- SENSITIZE ("lock_mlabel", p->lock_p);
+ SENSITIZE ("lock_button", can_lock_p);
+ SENSITIZE ("lock_spinbutton", can_lock_p && p->lock_p);
+ SENSITIZE ("lock_mlabel", can_lock_p && p->lock_p);
/* DPMS
*/
sprintf (buf, "%s: running %s", blurb(), av[0]);
perror (buf);
}
- exit (1); /* exits fork */
+
+ /* Note that one must use _exit() instead of exit() in procs forked
+ off of Gtk programs -- Gtk installs an atexit handler that has a
+ copy of the X connection (which we've already closed, for safety.)
+ If one uses exit() instead of _exit(), then one sometimes gets a
+ spurious "Gdk-ERROR: Fatal IO error on X server" error message.
+ */
+ _exit (1); /* exits fork */
break;
}
default:
exec_command (p->shell, new_cmd, p->nice_inferior);
/* Don't bother printing an error message when we are unable to
- exec subprocesses; we handle that by polling the pid later. */
- exit (1); /* exits child fork */
+ exec subprocesses; we handle that by polling the pid later.
+
+ Note that one must use _exit() instead of exit() in procs forked
+ off of Gtk programs -- Gtk installs an atexit handler that has a
+ copy of the X connection (which we've already closed, for safety.)
+ If one uses exit() instead of _exit(), then one sometimes gets a
+ spurious "Gdk-ERROR: Fatal IO error on X server" error message.
+ */
+ _exit (1); /* exits child fork */
break;
default: