From 55387c17d2566050710e5e07beb61166392e830b Mon Sep 17 00:00:00 2001 From: Thomas White Date: Mon, 17 Oct 2011 22:35:49 +0100 Subject: Fix remaining holes in redraw logic --- src/mainwindow.c | 12 +----------- src/mainwindow.h | 1 - src/objects.c | 2 +- src/presentation.c | 9 ++++++++- src/slideshow.c | 2 +- 5 files changed, 11 insertions(+), 15 deletions(-) diff --git a/src/mainwindow.c b/src/mainwindow.c index 3a3ee1c..74bcca4 100644 --- a/src/mainwindow.c +++ b/src/mainwindow.c @@ -277,17 +277,7 @@ void notify_slide_changed(struct presentation *p) { p->editing_object = NULL; update_toolbar(p); - gdk_window_invalidate_rect(p->drawingarea->window, NULL, FALSE); - - if ( p->slideshow != NULL ) { - notify_slideshow_slide_changed(p); - } -} - - -void notify_slide_update(struct presentation *p) -{ - gdk_window_invalidate_rect(p->drawingarea->window, NULL, FALSE); + redraw_slide(p->cur_edit_slide); if ( p->slideshow != NULL ) { notify_slideshow_slide_changed(p); diff --git a/src/mainwindow.h b/src/mainwindow.h index ee27997..816b17c 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -30,7 +30,6 @@ extern int open_mainwindow(struct presentation *p); extern void notify_slide_changed(struct presentation *p); -extern void notify_slide_update(struct presentation *p); extern void redraw_overlay(struct presentation *p); diff --git a/src/objects.c b/src/objects.c index d7ad8a3..01d603d 100644 --- a/src/objects.c +++ b/src/objects.c @@ -160,7 +160,7 @@ void notify_style_update(struct presentation *p, struct style *sty) } p->completely_empty = 0; - if ( changed ) notify_slide_update(p); + if ( changed ) notify_slide_changed(p); /* Trigger redraw etc */ } diff --git a/src/presentation.c b/src/presentation.c index 1bc5689..9782b81 100644 --- a/src/presentation.c +++ b/src/presentation.c @@ -196,7 +196,14 @@ static void update_titlebar(struct presentation *p) int slide_number(struct presentation *p, struct slide *s) { - /* FIXME: Implement this */ + int i; + + for ( i=0; inum_slides; i++ ) { + if ( p->slides[i] == s ) return i; + } + + fprintf(stderr, "Sorry, this point is never reached.\n"); + fprintf(stderr, "Please report a bug.\n"); return 0; } diff --git a/src/slideshow.c b/src/slideshow.c index acee256..2b40fe5 100644 --- a/src/slideshow.c +++ b/src/slideshow.c @@ -87,7 +87,7 @@ static gboolean ss_expose_sig(GtkWidget *da, GdkEventExpose *event, void notify_slideshow_slide_changed(struct presentation *p) { - gdk_window_invalidate_rect(p->ss_drawingarea->window, NULL, FALSE); + redraw_slide(p->cur_proj_slide); } -- cgit v1.2.3