Type fix for OS X.
[dcpomatic.git] / src / wx / content_panel.cc
index a164ee977bf25686bce9170d594ab475e459926a..41a18f4b4a6bfaa3fec493d0fa3fdbb526884750 100644 (file)
@@ -61,6 +61,7 @@ using boost::shared_ptr;
 using boost::weak_ptr;
 using boost::dynamic_pointer_cast;
 using boost::optional;
+using namespace dcpomatic;
 
 class LimitedSplitter : public wxSplitterWindow
 {
@@ -94,8 +95,11 @@ ContentPanel::ContentPanel (wxNotebook* n, shared_ptr<Film> film, weak_ptr<FilmV
        }
 
        _splitter = new LimitedSplitter (n);
-       wxDisplay display (wxDisplay::GetFromWindow(_splitter));
-       wxRect screen = display.GetClientArea();
+       optional<wxRect> screen;
+       int const sn = wxDisplay::GetFromWindow(_splitter);
+       if (sn >= 0) {
+               screen = wxDisplay(sn).GetClientArea();
+       }
        wxPanel* top = new wxPanel (_splitter);
 
        _menu = new ContentMenu (_splitter);
@@ -150,7 +154,9 @@ ContentPanel::ContentPanel (wxNotebook* n, shared_ptr<Film> film, weak_ptr<FilmV
        /* This is a hack to try and make the content notebook a sensible size; large on big displays but small
           enough on small displays to leave space for the content area.
        */
-       _splitter->SplitHorizontally (top, _notebook, screen.height > 800 ? -600 : -150);
+       if (screen) {
+               _splitter->SplitHorizontally (top, _notebook, screen->height > 800 ? -600 : -150);
+       }
 
        _timing_panel = new TimingPanel (this, _film_viewer);
        _notebook->AddPage (_timing_panel, _("Timing"), false);
@@ -552,7 +558,7 @@ ContentPanel::timeline_clicked ()
                _timeline_dialog = 0;
        }
 
-       _timeline_dialog = new TimelineDialog (this, _film);
+       _timeline_dialog = new TimelineDialog (this, _film, _film_viewer);
        _timeline_dialog->set_selection (selected());
        _timeline_dialog->Show ();
 }