@@ -674,6 +674,13 @@ MainWindow::MainWindow(QWidget *parent)
674
674
/* Remove default Shift+F10 handler, which unfocuses keyboard input even with no context menu. */
675
675
connect (new QShortcut (QKeySequence (Qt::SHIFT + Qt::Key_F10), this ), &QShortcut::activated, this , [](){});
676
676
677
+ auto windowedShortcut = new QShortcut (QKeySequence (Qt::CTRL + Qt::ALT + Qt::Key_PageDown), this );
678
+ windowedShortcut->setContext (Qt::ShortcutContext::ApplicationShortcut);
679
+ connect (windowedShortcut, &QShortcut::activated, this , [this ] () {
680
+ if (video_fullscreen)
681
+ ui->actionFullscreen ->trigger ();
682
+ });
683
+
677
684
connect (this , &MainWindow::initRendererMonitor, this , &MainWindow::initRendererMonitorSlot);
678
685
connect (this , &MainWindow::initRendererMonitorForNonQtThread, this , &MainWindow::initRendererMonitorSlot, Qt::BlockingQueuedConnection);
679
686
connect (this , &MainWindow::destroyRendererMonitor, this , &MainWindow::destroyRendererMonitorSlot);
@@ -696,6 +703,22 @@ MainWindow::MainWindow(QWidget *parent)
696
703
});
697
704
#endif
698
705
706
+ QTimer::singleShot (0 , this , [this ]() {
707
+ for (auto curObj : this ->menuBar ()->children ()) {
708
+ if (qobject_cast<QMenu *>(curObj)) {
709
+ auto menu = qobject_cast<QMenu *>(curObj);
710
+ for (auto curObj2 : menu->children ()) {
711
+ if (qobject_cast<QAction *>(curObj2)) {
712
+ auto action = qobject_cast<QAction *>(curObj2);
713
+ if (!action->shortcut ().isEmpty ()) {
714
+ this ->insertAction (nullptr , action);
715
+ }
716
+ }
717
+ }
718
+ }
719
+ }
720
+ });
721
+
699
722
actGroup = new QActionGroup (this );
700
723
actGroup->addAction (ui->actionCursor_Puck );
701
724
actGroup->addAction (ui->actionPen );
@@ -833,6 +856,11 @@ MainWindow::initRendererMonitorSlot(int monitor_index)
833
856
});
834
857
secondaryRenderer->setWindowFlags (Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint);
835
858
secondaryRenderer->setWindowTitle (QObject::tr (" 86Box Monitor #" ) + QString::number (monitor_index + 1 ));
859
+ secondaryRenderer->setContextMenuPolicy (Qt::PreventContextMenu);
860
+
861
+ for (int i = 0 ; i < this ->actions ().size (); i++) {
862
+ secondaryRenderer->addAction (this ->actions ()[i]);
863
+ }
836
864
837
865
if (vid_resize == 2 )
838
866
secondaryRenderer->setFixedSize (fixed_size_x, fixed_size_y);
@@ -1360,18 +1388,9 @@ MainWindow::keyPressEvent(QKeyEvent *event)
1360
1388
#endif
1361
1389
}
1362
1390
1363
- checkFullscreenHotkey ();
1364
-
1365
1391
if (keyboard_ismsexit ())
1366
1392
plat_mouse_capture (0 );
1367
1393
1368
- if ((video_fullscreen > 0 ) && (keyboard_recv_ui (0x1D ) || keyboard_recv_ui (0x11D ))) {
1369
- if (keyboard_recv_ui (0x57 ))
1370
- ui->actionTake_screenshot ->trigger ();
1371
- else if (keyboard_recv_ui (0x58 ))
1372
- pc_send_cad ();
1373
- }
1374
-
1375
1394
event->accept ();
1376
1395
}
1377
1396
@@ -1403,28 +1422,6 @@ MainWindow::keyReleaseEvent(QKeyEvent *event)
1403
1422
processKeyboardInput (false , event->nativeScanCode ());
1404
1423
#endif
1405
1424
}
1406
-
1407
- checkFullscreenHotkey ();
1408
- }
1409
-
1410
- void
1411
- MainWindow::checkFullscreenHotkey ()
1412
- {
1413
- if (!fs_off_signal && video_fullscreen && keyboard_isfsexit ()) {
1414
- /* Signal "exit fullscreen mode". */
1415
- fs_off_signal = true ;
1416
- } else if (fs_off_signal && video_fullscreen && keyboard_isfsexit_up ()) {
1417
- ui->actionFullscreen ->trigger ();
1418
- fs_off_signal = false ;
1419
- }
1420
-
1421
- if (!fs_on_signal && !video_fullscreen && keyboard_isfsenter ()) {
1422
- /* Signal "enter fullscreen mode". */
1423
- fs_on_signal = true ;
1424
- } else if (fs_on_signal && !video_fullscreen && keyboard_isfsenter_up ()) {
1425
- ui->actionFullscreen ->trigger ();
1426
- fs_on_signal = false ;
1427
- }
1428
1425
}
1429
1426
1430
1427
QSize
0 commit comments