Browse Source

Cleanup of GTK_VERSION_GT_MICRO replacement macro

merge-requests/413/head
eidheim 3 years ago
parent
commit
ba9203959a
  1. 2
      src/selection_dialog.cpp
  2. 6
      src/selection_dialog.hpp
  3. 2
      src/tooltips.cpp
  4. 6
      src/utility.hpp

2
src/selection_dialog.cpp

@ -139,7 +139,7 @@ SelectionDialogBase::SelectionDialogBase(Source::BaseView *view_, const boost::o
}
SelectionDialogBase::~SelectionDialogBase() {
#if defined(__APPLE__) && GTK_VERSION_GT_MICRO2(3, 24, 34)
#if defined(__APPLE__) && GTK_VERSION_GT_MICRO_CORRECTED(3, 24, 34)
// Workaround for https://gitlab.gnome.org/GNOME/gtk/-/issues/5593 by keeping window alive slightly longer
window.close();
Glib::signal_timeout().connect([window = std::make_shared<Gtk::Window>(std::move(window))] { return false; }, 5000);

6
src/selection_dialog.hpp

@ -5,6 +5,12 @@
#include <gtkmm.h>
#include <unordered_map>
// GTK_VERSION_GT_MICRO has a typo (in gtkmm/base.h)
#define GTK_VERSION_GT_MICRO_CORRECTED(major, minor, micro) \
((GTK_MAJOR_VERSION > major) || \
(GTK_MAJOR_VERSION == major) && (GTK_MINOR_VERSION > minor) || \
(GTK_MAJOR_VERSION == major) && (GTK_MINOR_VERSION == minor) && (GTK_MICRO_VERSION > micro))
class SelectionDialogBase {
class ListViewText : public Gtk::TreeView {
class ColumnRecord : public Gtk::TreeModel::ColumnRecord {

2
src/tooltips.cpp

@ -19,7 +19,7 @@ Tooltip::Tooltip(std::function<void(Tooltip &)> set_buffer_)
: view(nullptr), set_buffer(std::move(set_buffer_)) {}
Tooltip::~Tooltip() {
#if defined(__APPLE__) && GTK_VERSION_GT_MICRO2(3, 24, 34)
#if defined(__APPLE__) && GTK_VERSION_GT_MICRO_CORRECTED(3, 24, 34)
// Workaround for https://gitlab.gnome.org/GNOME/gtk/-/issues/5593 by keeping window alive slightly longer
if(window) {
window->close();

6
src/utility.hpp

@ -3,12 +3,6 @@
#include <set>
#include <string>
// GTK_VERSION_GT_MICRO has a typo (in gtkmm/base.h)
#define GTK_VERSION_GT_MICRO2(major, minor, micro) \
((GTK_MAJOR_VERSION > major) || \
(GTK_MAJOR_VERSION == major) && (GTK_MINOR_VERSION > minor) || \
(GTK_MAJOR_VERSION == major) && (GTK_MINOR_VERSION == minor) && (GTK_MICRO_VERSION > micro))
class ScopeGuard {
public:
std::function<void()> on_exit;

Loading…
Cancel
Save