The previous code tried to imitate GtkLabel, but failed to account for
changes to its API. The new code uses gtk_label_get_layout_offsets()
which is exactly doing the same thing, but compatibly.
https://bugzilla.gnome.org/show_bug.cgi?id=626870
This patch does 2 things:
1) Defines a DrwTimer that we use instead of GTimer. This is just a thin
wrapper around g_get_current_time, and it means we can accurately track
typing/idle periods based on real-world wall-clock time, which GTimer is
apparently not intended to do.
2) The typing monitor has some complicated state handling where it transitions
between an IDLE state and a TYPING state. This transition is based on running a
callback once per second, and checking whether any keystrokes have been
recorded since the last time the callback was called. The actual idle *time* is
tracked separately, independently of these two states, but only when we are in
the IDLE *state* was the idle *time* checked to see if we should reset the
break timer. This leads to a race condition -- if we suspend while in the
TYPING state, then eventually we will wake up, notice that no key press has
happened in the last second, *reset the idle timer*, transition to the IDLE
state, and then check the amount of time on the idle timer. We will thus never
notice the amount of time that the computer was suspended.
I considered making the IDLE/TYPING transition code smarter, but it turns out
the desired behavior for the two states is entirely identical anyway, so rather
than adding more complexity to this pointless code, I just diked it out and
replaced them both by a single state called RUNNING.
Closes bug #430797.
When the typing break screen is displayed and break postponements are enabled,
there is a 500ms delay before the 'Postpone' button becomes sensitive.
Increase that delay to 5000ms (5s).
Rationale:
When I'm really focused on something I will click the 'Postpone' button, or
even use the keyboard short-cut Alt-P, so that I can carry on with what I was
doing. Then later I won't even remember having done it. This can happen
several times in a row. I'm sure it happens this way for other people too.
With a 5s delay before a break can be postponed it gives the user time to think
about whether they really need to carry on with what they were doing or if it
can wait after all.
Closes bug #597086.
2008-07-02 Jens Granseuer <jensgr@gmx.net>
Patch by: Andrey Gusev <ronne@list.ru>
* drw-break-window.c: (drw_break_window_init): make the typing break
window modal so it properly locks the screen when apps like firefox
are running in fullscreen mode (bug #441786)
svn path=/trunk/; revision=8772
2008-06-27 Jens Granseuer <jensgr@gmx.net>
Based on a patch by: Andrey Gusev <ronne@list.ru>
* drwright.c: (break_window_postpone_cb): when postponing a break
don't go right back to warn state, but award some bonus time according
to the already elapsed break time (bug #133295)
svn path=/trunk/; revision=8770
2008-06-15 Jens Granseuer <jensgr@gmx.net>
Patch by: Andrey Gusev <ronne@list.ru>
* drwright.c: (update_icon), (blink_timeout_cb),
(maybe_change_state), (update_tooltip), (break_window_postpone_cb):
when postponing a voluntary break, go back to the state before taking
the break instead of going to warn state as we do when a regular
break is postponed (bug #134595)
svn path=/trunk/; revision=8755
2007-06-05 Christian Persch <chpe@gnome.org>
* typing-break/main.c: (main): Use GOption to parse the arguments. Bug
#444399.
svn path=/trunk/; revision=7694
2007-06-05 Ross Burton <ross@openedhand.com>
* configure.in:
Bump glib requirement to 2.13, for the ~second-accurate timers.
2007-06-05 Ross Burton <ross@openedhand.com>
* drw-monitor.c:
* drw-break-window.c:
* drwright.c:
Use the second-accurate timers instead of the millisecond timers,
in an attempt to use less processor time (#443547).
svn path=/trunk/; revision=7692
2007-02-02 Christian Persch <chpe@svn.gnome.org>
* main.c: (main): Use specific string as app ID in
gnome_program_init, not PACKAGE. Bug #403708.
svn path=/trunk/; revision=7229
2007-01-09 Vincent Untz <vuntz@gnome.org>
* main.c: (main): set default window icon and application name
* Makefile.am: install icons
* drwright.c: (popup_about_cb): use gtk_about_dialog_show()
* typing-monitor.png:
* typing-monitor.svn: new
Fix bug #348641, icon by Andreas Nilsson <nisses.mail@home.se>, patch
by Luca Cavalli <luca.cavalli@gmail.com>
svn path=/trunk/; revision=7124
2005-11-27 Richard Hult <richard@imendio.com>
* main.c: (main): Don't display a dialog when the monitor is
already running, that's an old remain from when drwright was a
standalone app. Fixes bug #307425.
* drw-break-window.c:
* drwright.c: (popup_break_cb): Use stock icon from GTK+ instead
of libgnomeui and use i18n includes from glib. Fixes bug #171664.