summarylogtreecommitdiffstats
path: root/board-fix-segfault.patch
blob: 6c30d4ae16f9ce449f5c375ed02719f1460d8ee8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
--- src/Board.cc.orig	2018-02-07 16:46:27.000000000 +0100
+++ src/Board.cc	2021-02-02 11:28:52.653930660 +0100
@@ -301,8 +301,13 @@
 {
-	//if(ui_pixmap)
-	//	return true;
+	if (!get_mapped())
+		return false;
+	if (ui_pixmap) {
+		int w,h;
+		ui_pixmap->get_size(w,h);
+		if (get_width() == w || get_height() == h)
+			return false;
+	}
 	ui_pixmap = Gdk::Pixmap::create(this->get_window(),get_width(),get_height());
-
 	redraw();
-
+	return false;
 }
@@ -317,4 +322,8 @@
 }
+
 void Board::redraw()
 {
+	if (!ui_pixmap)
+		return;
+
 	draw_bg();