From 679282695b28a929872998855856c6463b105426 Mon Sep 17 00:00:00 2001 From: eidheim Date: Thu, 22 Feb 2018 09:30:22 +0100 Subject: [PATCH] Fixed crash on MacOS by disabling drag-and-drop in directories view --- src/directories.cc | 10 ++++++++++ src/directories.h | 1 + 2 files changed, 11 insertions(+) diff --git a/src/directories.cc b/src/directories.cc index 12fb34e..b6e45b5 100644 --- a/src/directories.cc +++ b/src/directories.cc @@ -10,6 +10,16 @@ bool Directories::TreeStore::row_drop_possible_vfunc(const Gtk::TreeModel::Path return true; } +bool Directories::TreeStore::row_draggable_vfunc(const TreeModel::Path &path) const { + // Drag and drop does not work on MacOS anymore + // TODO june 2018, see if this issue has been fixed + #ifdef __APPLE__ + return false; + #else + return Gtk::TreeStore::row_draggable_vfunc(path); + #endif +} + bool Directories::TreeStore::drag_data_get_vfunc(const TreeModel::Path &path, Gtk::SelectionData &selection_data) const { // Workaround for MacOS crash when dragging a path for instance inside dir/subdir #ifdef __APPLE__ diff --git a/src/directories.h b/src/directories.h index 4a06e70..4303ec9 100644 --- a/src/directories.h +++ b/src/directories.h @@ -27,6 +27,7 @@ class Directories : public Gtk::ListViewText { TreeStore() {} bool row_drop_possible_vfunc(const Gtk::TreeModel::Path &path, const Gtk::SelectionData &selection_data) const override; + bool row_draggable_vfunc(const TreeModel::Path &path) const override; bool drag_data_get_vfunc(const TreeModel::Path &path, Gtk::SelectionData &selection_data) const override; bool drag_data_received_vfunc(const TreeModel::Path &path, const Gtk::SelectionData &selection_data) override; bool drag_data_delete_vfunc (const Gtk::TreeModel::Path &path) override;