aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorCole Robinson <crobinso@redhat.com>2016-05-06 14:03:05 -0400
committerGerd Hoffmann <kraxel@redhat.com>2016-05-11 08:02:40 +0200
commit4fd811a6bd0b8f24f4761fc281454494c336d310 (patch)
tree3444ccb6f4a713e8322e18025ce1dc38816236a5 /ui
parent860a3b34854d8abe9af9f1eb584691de926ce897 (diff)
downloadqemu-4fd811a6bd0b8f24f4761fc281454494c336d310.zip
qemu-4fd811a6bd0b8f24f4761fc281454494c336d310.tar.gz
qemu-4fd811a6bd0b8f24f4761fc281454494c336d310.tar.bz2
ui: gtk: fix crash when terminal inner-border is NULL
VTE terminal inner-border can be NULL. The vte-0.36 (API 2.90) code checks for the condition too so I assume it's not just a bug Fixes a crash on Fedora 24 with gtk 3.20 Signed-off-by: Cole Robinson <crobinso@redhat.com> Message-id: 2b2e85d403e8760ea53afd735a170500d5c17716.1462557436.git.crobinso@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'ui')
-rw-r--r--ui/gtk.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/ui/gtk.c b/ui/gtk.c
index f372a6d..9876d89 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -340,10 +340,12 @@ static void gd_update_geometry_hints(VirtualConsole *vc)
geo.min_height = geo.height_inc * VC_TERM_Y_MIN;
mask |= GDK_HINT_MIN_SIZE;
gtk_widget_style_get(vc->vte.terminal, "inner-border", &ib, NULL);
- geo.base_width += ib->left + ib->right;
- geo.base_height += ib->top + ib->bottom;
- geo.min_width += ib->left + ib->right;
- geo.min_height += ib->top + ib->bottom;
+ if (ib) {
+ geo.base_width += ib->left + ib->right;
+ geo.base_height += ib->top + ib->bottom;
+ geo.min_width += ib->left + ib->right;
+ geo.min_height += ib->top + ib->bottom;
+ }
geo_widget = vc->vte.terminal;
#endif
}