From e3ef524f94289afe6a77ed969978543ca881811c Mon Sep 17 00:00:00 2001 From: eidheim Date: Sat, 26 Aug 2017 09:25:33 +0200 Subject: [PATCH] Added workaround for MacOS crash that might happen when moving paths in the directory view --- src/directories.cc | 9 +++++++++ src/directories.h | 1 + 2 files changed, 10 insertions(+) diff --git a/src/directories.cc b/src/directories.cc index b5085ec..7c426fc 100644 --- a/src/directories.cc +++ b/src/directories.cc @@ -10,6 +10,15 @@ bool Directories::TreeStore::row_drop_possible_vfunc(const Gtk::TreeModel::Path return true; } +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__ + return true; +#else + return Gtk::TreeStore::drag_data_get_vfunc(path, selection_data); +#endif +} + bool Directories::TreeStore::drag_data_received_vfunc(const TreeModel::Path &path, const Gtk::SelectionData &selection_data) { auto &directories=Directories::get(); diff --git a/src/directories.h b/src/directories.h index 264736c..5831185 100644 --- a/src/directories.h +++ b/src/directories.h @@ -29,6 +29,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 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;