Reverted the previous approach and switched to the new, non-hacky approach of getting rid of the accelerator and instead handling enter full screen the same way exit full screen is handled.
This commit is contained in:
@@ -156,6 +156,8 @@ extern "C" void qt_blit(int x, int y, int w, int h, int monitor_index);
|
||||
|
||||
extern MainWindow *main_window;
|
||||
|
||||
static int fs_on_signal = 0, fs_off_signal = 0;
|
||||
|
||||
MainWindow::MainWindow(QWidget *parent)
|
||||
: QMainWindow(parent)
|
||||
, ui(new Ui::MainWindow)
|
||||
@@ -580,7 +582,6 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
}
|
||||
|
||||
#ifdef Q_OS_MACOS
|
||||
ui->actionFullscreen->setShortcutVisibleInContextMenu(true);
|
||||
ui->actionCtrl_Alt_Del->setShortcutVisibleInContextMenu(true);
|
||||
ui->actionTake_screenshot->setShortcutVisibleInContextMenu(true);
|
||||
#endif
|
||||
@@ -1241,13 +1242,14 @@ MainWindow::keyPressEvent(QKeyEvent *event)
|
||||
#endif
|
||||
}
|
||||
|
||||
if ((video_fullscreen > 0) && keyboard_isfsexit()) {
|
||||
ui->actionFullscreen->trigger();
|
||||
}
|
||||
if (!fs_off_signal && (video_fullscreen > 0) && keyboard_isfsexit())
|
||||
fs_off_signal = 1;
|
||||
|
||||
if (keyboard_ismsexit()) {
|
||||
if (!fs_on_signal && (video_fullscreen == 0) && keyboard_isfsenter())
|
||||
fs_on_signal = 1;
|
||||
|
||||
if (keyboard_ismsexit())
|
||||
plat_mouse_capture(0);
|
||||
}
|
||||
|
||||
if ((video_fullscreen > 0) && (keyboard_recv(0x1D) || keyboard_recv(0x11D))) {
|
||||
if (keyboard_recv(0x57))
|
||||
@@ -1279,6 +1281,17 @@ MainWindow::keyReleaseEvent(QKeyEvent *event)
|
||||
plat_pause(dopause ^ 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (fs_off_signal && (video_fullscreen > 0) && keyboard_isfsexit_down()) {
|
||||
ui->actionFullscreen->trigger();
|
||||
fs_off_signal = 0;
|
||||
}
|
||||
|
||||
if (fs_on_signal && (video_fullscreen == 0) && keyboard_isfsenter_down()) {
|
||||
ui->actionFullscreen->trigger();
|
||||
fs_on_signal = 0;
|
||||
}
|
||||
|
||||
if (!send_keyboard_input)
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user