From a2632fc3cb1096b1add5238d6b4fb090a7427273 Mon Sep 17 00:00:00 2001 From: Max Krummenacher Date: Wed, 25 Jan 2017 14:48:42 +0100 Subject: [PATCH] lxterminal.c: fix garbled titlebar With the T20/T30 X driver the titlebar and window boarder is not drawn at all but filled with random pixels or painted with a random copy of some other screen area. Fix this by falling back to a working gdk function if the more complex one fails due to an unsupported feature. Signed-off-by: Max Krummenacher --- src/lxterminal.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lxterminal.c b/src/lxterminal.c index c218aa7..3d56ba2 100644 --- a/src/lxterminal.c +++ b/src/lxterminal.c @@ -1477,12 +1477,15 @@ LXTerminal * lxterminal_initialize(LXTermWindow * lxtermwin, CommandArguments * /* Try to get an RGBA visual (colormap) and assign it to the new window. */ #if GTK_CHECK_VERSION (2, 90, 8) GdkVisual *visual = gdk_screen_get_rgba_visual(gtk_widget_get_screen(GTK_WIDGET(terminal->window))); + if (visual != NULL) { + visual = gdk_screen_get_system_visual(gtk_widget_get_screen(GTK_WIDGET(terminal->window))); + } if (visual != NULL) { gtk_widget_set_visual(terminal->window, visual); } #else - GdkColormap *colormap = gdk_screen_get_rgba_colormap(gtk_widget_get_screen(GTK_WIDGET(terminal->window))); + GdkColormap *colormap = gdk_colormap_get_system(); if (colormap != NULL) { gtk_widget_set_colormap(terminal->window, colormap); -- 2.5.5