[gtksourceview] source-map: be resilient against non-existent windows
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview] source-map: be resilient against non-existent windows
- Date: Fri, 22 May 2015 16:31:02 +0000 (UTC)
commit 0f0a3e94e7948d0abdd7ef08341809106e544b44
Author: Christian Hergert <christian hergert me>
Date: Fri May 22 09:30:31 2015 -0700
source-map: be resilient against non-existent windows
This could happen before realize, for example.
gtksourceview/gtksourcemap.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/gtksourceview/gtksourcemap.c b/gtksourceview/gtksourcemap.c
index dae2ec0..53c5b09 100644
--- a/gtksourceview/gtksourcemap.c
+++ b/gtksourceview/gtksourcemap.c
@@ -238,8 +238,11 @@ update_scrubber_position (GtkSourceMap *map)
* were when drawing the scrubber from a parent widget.
*/
window = gtk_text_view_get_window (GTK_TEXT_VIEW (map), GTK_TEXT_WINDOW_WIDGET);
- gdk_window_invalidate_rect (window, &priv->scrubber_area, FALSE);
- gdk_window_invalidate_rect (window, &scrubber_area, FALSE);
+ if (window != NULL)
+ {
+ gdk_window_invalidate_rect (window, &priv->scrubber_area, FALSE);
+ gdk_window_invalidate_rect (window, &scrubber_area, FALSE);
+ }
priv->scrubber_area = scrubber_area;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]