Improved on the QT implementation of the new approach, per suggestion by Manaatti.

This commit is contained in:
OBattler
2023-04-13 23:00:01 +02:00
parent df24b4be0f
commit bbf42db3c7
2 changed files with 8 additions and 6 deletions

View File

@@ -156,8 +156,6 @@ 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)
@@ -1243,10 +1241,10 @@ MainWindow::keyPressEvent(QKeyEvent *event)
}
if (!fs_off_signal && (video_fullscreen > 0) && keyboard_isfsexit())
fs_off_signal = 1;
fs_off_signal = true;
if (!fs_on_signal && (video_fullscreen == 0) && keyboard_isfsenter())
fs_on_signal = 1;
fs_on_signal = true;
if (keyboard_ismsexit())
plat_mouse_capture(0);
@@ -1284,12 +1282,12 @@ MainWindow::keyReleaseEvent(QKeyEvent *event)
if (fs_off_signal && (video_fullscreen > 0) && keyboard_isfsexit_down()) {
ui->actionFullscreen->trigger();
fs_off_signal = 0;
fs_off_signal = false;
}
if (fs_on_signal && (video_fullscreen == 0) && keyboard_isfsenter_down()) {
ui->actionFullscreen->trigger();
fs_on_signal = 0;
fs_on_signal = false;
}
if (!send_keyboard_input)

View File

@@ -167,6 +167,10 @@ private:
bool resizableonce = false;
bool vnc_enabled = false;
/* Full screen ON and OFF signals */
static bool fs_on_signal = false;
static bool fs_off_signal = false;
friend class SpecifyDimensions;
friend class ProgSettings;
friend class RendererCommon;