Stop Delete key deleting content in unexpected circumstances.
authorCarl Hetherington <cth@carlh.net>
Mon, 15 Feb 2016 23:16:53 +0000 (23:16 +0000)
committerCarl Hetherington <cth@carlh.net>
Mon, 15 Feb 2016 23:16:53 +0000 (23:16 +0000)
src/wx/content_panel.cc

index bae8883dec1a3fdd579eb049f111bea206fef8ad..a68998232f6b02bb582c03328f80f7d07badb4bb 100644 (file)
@@ -329,9 +329,9 @@ void
 ContentPanel::remove_clicked ()
 {
        /* This method is also called when Delete is pressed, so check that our notebook page
-          is visible.
+          is visible and that the content list is focussed.
        */
-       if (_parent->GetCurrentPage() != _panel) {
+       if (_parent->GetCurrentPage() != _panel || !_content->HasFocus()) {
                return;
        }