From: Carl Hetherington Date: Thu, 1 Sep 2022 22:35:30 +0000 (+0200) Subject: Fix "escape" from dual screen mode, on Linux at least (#2183). X-Git-Tag: v2.16.23 X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=commitdiff_plain;h=34eb57979b5293ac3b864310f8fc8c77c26343e2 Fix "escape" from dual screen mode, on Linux at least (#2183). This is a bit of a strange solution but the only one that I could make work; the key seems to be setting focus on the child window of the frame. --- diff --git a/src/tools/dcpomatic_player.cc b/src/tools/dcpomatic_player.cc index 7603b9842..043e90b9e 100644 --- a/src/tools/dcpomatic_player.cc +++ b/src/tools/dcpomatic_player.cc @@ -804,6 +804,7 @@ private: _dual_screen->SetBackgroundColour (wxColour(0, 0, 0)); _dual_screen->ShowFullScreen (true); _viewer->panel()->Reparent (_dual_screen); + _viewer->panel()->SetFocus(); _dual_screen->Show (); if (wxDisplay::GetCount() > 1) { switch (Config::instance()->image_display()) { @@ -818,6 +819,7 @@ private: break; } } + _dual_screen->Bind(wxEVT_CHAR_HOOK, boost::bind(&DOMFrame::dual_screen_key_press, this, _1)); } else { if (_dual_screen) { _viewer->panel()->Reparent (_overall_panel); @@ -829,6 +831,17 @@ private: setup_main_sizer (_mode); } + void dual_screen_key_press(wxKeyEvent& ev) + { + if (ev.GetKeyCode() == WXK_F11) { + if (ev.ShiftDown()) { + view_dual_screen(); + } else if (!ev.HasAnyModifiers()) { + view_full_screen(); + } + } + } + void view_closed_captions () { _viewer->show_closed_captions ();