summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2012-03-31 16:22:06 +0200
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2012-03-31 16:22:06 +0200
commit047b59a2cc6c646d753168e8e26ea1c31c3e9919 (patch)
tree681fba8682eda79dd73a9d8c7905bc0251f6a383
parentd95a65dc1e113e10525eb12da0cc9e368065440d (diff)
downloadcv-047b59a2cc6c646d753168e8e26ea1c31c3e9919.tar.gz
cv-047b59a2cc6c646d753168e8e26ea1c31c3e9919.tar.bz2
cv-047b59a2cc6c646d753168e8e26ea1c31c3e9919.zip
roi: Remove key_press state from roi struct
-rw-r--r--roi.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/roi.c b/roi.c
index 2fd5ee1..41c80a8 100644
--- a/roi.c
+++ b/roi.c
@@ -9,11 +9,6 @@ struct roi {
GtkWidget *window;
GtkWidget *drawing_area;
- struct key_press {
- guint8 state;
- guint32 key;
- } key_press;
-
GdkPixbuf *input, *modified_input;
cairo_rectangle_t area;
@@ -180,11 +175,9 @@ key_event(GtkWidget *widget, GdkEventKey *event, gpointer userdata)
{
struct roi *roi = userdata;
- roi->key_press.state = (event->type == GDK_KEY_PRESS);
- roi->key_press.key = event->keyval;
-
- if (!roi->key_press.state) {
- switch (roi->key_press.key) {
+ switch (event->type) {
+ case GDK_KEY_RELEASE:
+ switch (event->keyval) {
case 'd':
g_object_unref(roi->modified_input);
roi->modified_input = NULL;
@@ -194,9 +187,10 @@ key_event(GtkWidget *widget, GdkEventKey *event, gpointer userdata)
gtk_main_quit();
break;
}
+ return FALSE;
+ default:
+ return TRUE;
}
-
- return FALSE;
}
static gboolean