summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-11-23 11:40:48 +0000
committerCarl Hetherington <cth@carlh.net>2016-11-23 11:40:48 +0000
commit18404f99863131437497329f5a3b0c5180b060ae (patch)
tree8245b892101606b842580ccd377303a59e6353b9 /src
parentcd32ade6c276b9163a8aa889a9d81ead6ddb59d6 (diff)
Attempt to fix crash on hitting enter in the crop control on Windows (#1009).
Diffstat (limited to 'src')
-rw-r--r--src/wx/content_menu.cc7
-rw-r--r--src/wx/content_menu.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/src/wx/content_menu.cc b/src/wx/content_menu.cc
index f332dbe91..6da219f0f 100644
--- a/src/wx/content_menu.cc
+++ b/src/wx/content_menu.cc
@@ -66,6 +66,7 @@ enum {
ContentMenu::ContentMenu (wxWindow* p)
: _menu (new wxMenu)
, _parent (p)
+ , _pop_up_open (false)
{
_repeat = _menu->Append (ID_repeat, _("Repeat..."));
_join = _menu->Append (ID_join, _("Join"));
@@ -154,7 +155,9 @@ ContentMenu::popup (weak_ptr<Film> film, ContentList c, TimelineContentViewList
_remove->Enable (!_content.empty ());
+ _pop_up_open = true;
_parent->PopupMenu (_menu, p);
+ _pop_up_open = false;
}
void
@@ -409,6 +412,10 @@ ContentMenu::properties ()
void
ContentMenu::cpl_selected (wxCommandEvent& ev)
{
+ if (!_pop_up_open) {
+ return;
+ }
+
DCPOMATIC_ASSERT (!_content.empty ());
shared_ptr<DCPContent> dcp = dynamic_pointer_cast<DCPContent> (_content.front ());
DCPOMATIC_ASSERT (dcp);
diff --git a/src/wx/content_menu.h b/src/wx/content_menu.h
index ecbb4a350..064733103 100644
--- a/src/wx/content_menu.h
+++ b/src/wx/content_menu.h
@@ -55,6 +55,7 @@ private:
/** Film that we are working with; set up by popup() */
boost::weak_ptr<Film> _film;
wxWindow* _parent;
+ bool _pop_up_open;
ContentList _content;
TimelineContentViewList _views;
wxMenuItem* _repeat;