summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-09-02 00:35:30 +0200
committerCarl Hetherington <cth@carlh.net>2022-09-02 00:36:30 +0200
commit34eb57979b5293ac3b864310f8fc8c77c26343e2 (patch)
tree25353c72da24f34ea3c051d00a595a8d332cec49 /src
parent69326e73b29be371dacbdacd741a0a88a5ef1a5b (diff)
Fix "escape" from dual screen mode, on Linux at least (#2183).v2.16.23
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.
Diffstat (limited to 'src')
-rw-r--r--src/tools/dcpomatic_player.cc13
1 files changed, 13 insertions, 0 deletions
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 ();