From 668e837ca2c1c2374a8dba730cd11d73beaf1d46 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 6 Jan 2012 13:50:28 +0000 Subject: Fix a bug where "b" did not respond --- src/mainwindow.c | 6 +++++- src/slideshow.c | 22 +++++++++++++++------- src/slideshow.h | 1 + 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/mainwindow.c b/src/mainwindow.c index 0862e81..e8e3ec2 100644 --- a/src/mainwindow.c +++ b/src/mainwindow.c @@ -700,7 +700,11 @@ static gboolean im_commit_sig(GtkIMContext *im, gchar *str, struct presentation *p) { if ( p->editing_object == NULL ) { - printf("IM keypress: %s\n", str); + if ( str[0] == 'b' ) { + check_toggle_blank(p); + } else { + printf("IM keypress: %s\n", str); + } return FALSE; } if ( p->editing_object->type != OBJ_TEXT ) return FALSE; diff --git a/src/slideshow.c b/src/slideshow.c index 601c79e..0f1c5cd 100644 --- a/src/slideshow.c +++ b/src/slideshow.c @@ -175,20 +175,28 @@ void toggle_slideshow_link(struct presentation *p) } -static gboolean ss_key_press_sig(GtkWidget *da, GdkEventKey *event, - struct presentation *p) +void check_toggle_blank(struct presentation *p) { - switch ( event->keyval ) { - - case GDK_KEY_B : - case GDK_KEY_b : + if ( p->slideshow != NULL ) { if ( p->prefs->b_splits ) { toggle_slideshow_link(p); } else { p->ss_blank = 1-p->ss_blank; gdk_window_invalidate_rect(p->ss_drawingarea->window, - NULL, FALSE); + NULL, FALSE); } + } +} + + +static gboolean ss_key_press_sig(GtkWidget *da, GdkEventKey *event, + struct presentation *p) +{ + switch ( event->keyval ) { + + case GDK_KEY_B : + case GDK_KEY_b : + check_toggle_blank(p); break; case GDK_KEY_Page_Up : diff --git a/src/slideshow.h b/src/slideshow.h index 03418f7..fc0ab1b 100644 --- a/src/slideshow.h +++ b/src/slideshow.h @@ -34,6 +34,7 @@ extern void notify_slideshow_slide_changed(struct presentation *p, struct slide *np); extern void toggle_slideshow_link(struct presentation *p); +extern void check_toggle_blank(struct presentation *p); extern void end_slideshow(struct presentation *p); -- cgit v1.2.3