summaryrefslogtreecommitdiff
path: root/src/interface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/interface.cpp')
-rw-r--r--src/interface.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/interface.cpp b/src/interface.cpp
index b12301b..ab201d5 100644
--- a/src/interface.cpp
+++ b/src/interface.cpp
@@ -618,12 +618,17 @@ create_main_window (ProcData *procdata)
app = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(app), _("System Monitor"));
+ /* use rgba colormap, if available */
GdkScreen* screen = gtk_widget_get_screen(app);
+#if GTK_CHECK_VERSION(3,0,0)
+ GdkVisual* visual = gdk_screen_get_rgba_visual(screen);
+ if (visual)
+ gtk_widget_set_visual(app, visual);
+#else
GdkColormap* colormap = gdk_screen_get_rgba_colormap(screen);
-
- /* use rgba colormap, if available */
if (colormap)
gtk_widget_set_default_colormap(colormap);
+#endif
main_box = gtk_vbox_new (FALSE, 0);
gtk_container_add(GTK_CONTAINER(app), main_box);