diff options
| author | Carl Hetherington <cth@carlh.net> | 2019-05-03 01:32:46 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2019-05-03 12:35:17 +0100 |
| commit | 760f2801c37ffd772e41dd3991be3da51fdba242 (patch) | |
| tree | 9b72cf7e028869bdc0ba03dcbc9e623f5da8818c | |
| parent | f565319cc7b3a28e0a07c39542b9f38d5b72bb2d (diff) | |
Fix/workaround crash:
../src/common/dpycmn.cpp(119): assert "n <GetCount ()" failed in wxDisplay (): An invalid index was passed to wxDisplay
seen on Ubuntu 19.04; I can't reproduce it myself but the user reports that
this fixes it.
| -rw-r--r-- | src/wx/content_panel.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/wx/content_panel.cc b/src/wx/content_panel.cc index a164ee977..82caaf1ff 100644 --- a/src/wx/content_panel.cc +++ b/src/wx/content_panel.cc @@ -94,8 +94,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 +153,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); |
