2003-06-26 11:40:10 +00:00
|
|
|
bin_PROGRAMS = gnome-typing-monitor
|
|
|
|
|
|
|
|
gnome_typing_monitor_SOURCES = \
|
|
|
|
main.c \
|
|
|
|
drwright.c \
|
|
|
|
drwright.h \
|
|
|
|
drw-break-window.c \
|
|
|
|
drw-break-window.h \
|
|
|
|
drw-monitor.c \
|
|
|
|
drw-monitor.h \
|
2003-08-24 16:29:20 +00:00
|
|
|
drw-utils.c \
|
|
|
|
drw-utils.h \
|
|
|
|
drw-selection.c \
|
[typing-break] Reset timer after suspend
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.
2009-11-11 19:37:04 +01:00
|
|
|
drw-selection.h \
|
|
|
|
drw-timer.c \
|
|
|
|
drw-timer.h
|
2003-06-26 11:40:10 +00:00
|
|
|
|
2007-01-31 21:09:43 +00:00
|
|
|
gnome_typing_monitor_CPPFLAGS = \
|
|
|
|
-DGNOMELOCALEDIR="\"$(datadir)/locale\"" \
|
2007-02-02 18:12:40 +00:00
|
|
|
-DIMAGEDIR=\"$(pkgdatadir)/pixmaps\" \
|
2007-01-31 21:09:43 +00:00
|
|
|
$(AM_CPPFLAGS)
|
|
|
|
gnome_typing_monitor_CFLAGS = \
|
2007-06-05 15:44:40 +00:00
|
|
|
@TYPING_CFLAGS@ \
|
2007-01-31 21:09:43 +00:00
|
|
|
$(AM_CFLAGS)
|
|
|
|
|
2007-06-05 15:44:40 +00:00
|
|
|
gnome_typing_monitor_LDADD = @TYPING_LIBS@ @SCREENSAVER_LIBS@
|
2003-06-26 11:40:10 +00:00
|
|
|
|
2009-01-31 16:29:35 +00:00
|
|
|
if HAVE_LIBCANBERRA_GTK
|
|
|
|
gnome_typing_monitor_CFLAGS += -DHAVE_CANBERRA_GTK @LIBCANBERRA_GTK_CFLAGS@
|
|
|
|
gnome_typing_monitor_LDADD += @LIBCANBERRA_GTK_LIBS@
|
|
|
|
endif
|
|
|
|
|
2007-02-02 18:12:40 +00:00
|
|
|
imagedir = $(pkgdatadir)/pixmaps
|
2008-03-24 18:11:37 +00:00
|
|
|
dist_image_DATA = bar.png bar-red.png bar-green.png bar-disabled.png ocean-stripes.png
|
2003-06-26 11:40:10 +00:00
|
|
|
|
2007-01-09 19:13:39 +00:00
|
|
|
# Themeable application icon
|
|
|
|
icondir = $(datadir)/icons/hicolor/48x48/apps
|
2007-06-05 15:44:40 +00:00
|
|
|
dist_icon_DATA = typing-monitor.png
|
2007-01-09 19:13:39 +00:00
|
|
|
svgicondir = $(datadir)/icons/hicolor/scalable/apps
|
2007-06-05 15:44:40 +00:00
|
|
|
dist_svgicon_DATA = typing-monitor.svg
|
2007-01-09 19:13:39 +00:00
|
|
|
gtk_update_icon_cache = gtk-update-icon-cache -f -t $(datadir)/icons/hicolor
|
2007-06-26 23:29:58 +00:00
|
|
|
install-data-hook: update-icon-cache
|
|
|
|
uninstall-hook: update-icon-cache
|
|
|
|
update-icon-cache:
|
2007-01-09 19:13:39 +00:00
|
|
|
@-if test -z "$(DESTDIR)"; then \
|
|
|
|
echo "Updating Gtk icon cache."; \
|
|
|
|
$(gtk_update_icon_cache); \
|
|
|
|
else \
|
2007-06-26 23:29:58 +00:00
|
|
|
echo "*** Icon cache not updated. After (un)install, run this:"; \
|
2007-01-09 19:13:39 +00:00
|
|
|
echo "*** $(gtk_update_icon_cache)"; \
|
|
|
|
fi
|
2009-07-16 00:38:51 +01:00
|
|
|
|
|
|
|
-include $(top_srcdir)/git.mk
|