aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2012-01-06 13:50:28 +0000
committerThomas White <taw@bitwiz.org.uk>2012-01-06 13:50:28 +0000
commit668e837ca2c1c2374a8dba730cd11d73beaf1d46 (patch)
treee66d15a4d08288c02405743c31d722f63dedaf7e /src
parentf63c8dd67114d18eb2a6bf203b1a0c603517200d (diff)
Fix a bug where "b" did not respond
Diffstat (limited to 'src')
-rw-r--r--src/mainwindow.c6
-rw-r--r--src/slideshow.c22
-rw-r--r--src/slideshow.h1
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);