From ec075165809c8830fe2672a7af1cb4e8a64820e9 Mon Sep 17 00:00:00 2001 From: whitequark Date: Sat, 14 Jan 2017 01:43:11 +0000 Subject: [PATCH] GTK: work around a gtkmm<3.22 bug. --- README.md | 5 ++--- src/platform/gtkmain.cpp | 11 +++++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ee43aca4..d421eb4c 100644 --- a/README.md +++ b/README.md @@ -26,9 +26,8 @@ Building on Linux ### Building for Linux You will need CMake, zlib, libpng, cairo, freetype. To build the GUI, you will need -fontconfig, gtkmm 3.0, pangomm 1.4, OpenGL and OpenGL GLU, and optionally, -the Space Navigator client library -. +fontconfig, gtkmm 3.0 (version 3.16 or later), pangomm 1.4, OpenGL and OpenGL GLU, and +optionally, the Space Navigator client library. On a Debian derivative (e.g. Ubuntu) these can be installed with: apt-get install cmake zlib1-dev libpng-dev libcairo2-dev libfreetype6-dev diff --git a/src/platform/gtkmain.cpp b/src/platform/gtkmain.cpp index faa2ac13..2ba3c8f5 100644 --- a/src/platform/gtkmain.cpp +++ b/src/platform/gtkmain.cpp @@ -341,6 +341,12 @@ public: } protected: + // Work around a bug fixed in GTKMM 3.22: + // https://mail.gnome.org/archives/gtkmm-list/2016-April/msg00020.html + Glib::RefPtr on_create_context() override { + return get_window()->create_gl_context(); + } + void on_resize(int width, int height) override { _w = width; _h = height; @@ -1119,6 +1125,11 @@ public: } protected: + // See GraphicsWidget::on_create_context. + Glib::RefPtr on_create_context() override { + return get_window()->create_gl_context(); + } + bool on_render(const Glib::RefPtr &context) override { SS.TW.Paint(); return true;