summaryrefslogtreecommitdiff
path: root/gui/input.c
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-08-24 19:50:44 -0300
committerWerner Almesberger <werner@almesberger.net>2016-08-24 19:50:44 -0300
commit51e5f3fd52b7b338a153857b1d7dd01d632097bb (patch)
treecc0b7e2d2066d6b17fb97076a0850c43b3f903b5 /gui/input.c
parent891cec01ba4dace8feba7636c0f9aa293324cf09 (diff)
downloadeeshow-51e5f3fd52b7b338a153857b1d7dd01d632097bb.tar.gz
eeshow-51e5f3fd52b7b338a153857b1d7dd01d632097bb.tar.bz2
eeshow-51e5f3fd52b7b338a153857b1d7dd01d632097bb.zip
GUI performance timer, toggle with "T"
Shows milliseconds between last event and completion of screen update.
Diffstat (limited to 'gui/input.c')
-rw-r--r--gui/input.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gui/input.c b/gui/input.c
index f005527..49e310c 100644
--- a/gui/input.c
+++ b/gui/input.c
@@ -19,6 +19,7 @@
#include "misc/util.h"
#include "misc/diag.h"
+#include "gui/timer.h"
#include "gui/input.h"
@@ -183,6 +184,8 @@ static gboolean motion_notify_event(GtkWidget *widget, GdkEventMotion *event,
progress(3, "motion %s", state());
+ timer_start();
+
switch (sp->state) {
case input_idle:
hover_consider(event->x, event->y);
@@ -224,6 +227,8 @@ static gboolean button_press_event(GtkWidget *widget, GdkEventButton *event,
progress(3, "press %s", state());
+ timer_start();
+
buttons |= 1 << event->button;
switch (sp->state) {
@@ -261,6 +266,8 @@ static gboolean button_release_event(GtkWidget *widget, GdkEventButton *event,
progress(3, "release %s", state());
+ timer_start();
+
buttons &= ~(1 << event->button);
if (buttons)
return TRUE;
@@ -307,6 +314,8 @@ static gboolean button_release_event(GtkWidget *widget, GdkEventButton *event,
static gboolean scroll_event(GtkWidget *widget, GdkEventScroll *event,
gpointer data)
{
+ timer_start();
+
if (!sp || !sp->ops->scroll)
return TRUE;
switch (event->direction) {
@@ -329,6 +338,8 @@ static gboolean scroll_event(GtkWidget *widget, GdkEventScroll *event,
static gboolean key_press_event(GtkWidget *widget, GdkEventKey *event,
gpointer data)
{
+ timer_start();
+
if (sp && sp->ops->key)
sp->ops->key(sp->user, curr_x, curr_y, event->keyval);
return TRUE;