Skip to content

Instantly share code, notes, and snippets.

@punesemu
Last active January 11, 2022 16:19
Show Gist options
  • Save punesemu/5e8ea5cf2439683004986f0df5736b9b to your computer and use it in GitHub Desktop.
Save punesemu/5e8ea5cf2439683004986f0df5736b9b to your computer and use it in GitHub Desktop.
diff --git a/src/gui/mainWindow.cpp b/src/gui/mainWindow.cpp
index e18e2b3..1d0840e 100644
--- a/src/gui/mainWindow.cpp
+++ b/src/gui/mainWindow.cpp
@@ -175,5 +175,5 @@
connect(shcjoy.timer, SIGNAL(timeout()), this, SLOT(s_shcjoy_read_timer()));
- connect(qApp, SIGNAL(receivedMessage(quint32, QByteArray)), this, SLOT(s_received_message(quint32, QByteArray)));
+ connect(qApp, SIGNAL(receivedMessage(quint32, QByteArray)), this, SLOT(s_received_message(quint32, QByteArray)));
connect(this, SIGNAL(et_gg_reset(void)), this, SLOT(s_et_gg_reset(void)));
@@ -1064,6 +1064,4 @@
void mainWindow::s_set_fullscreen(void) {
- BYTE delay = FALSE;
-
if (gui.in_update || setup_in_out_fullscreen) {
return;
@@ -1086,33 +1084,17 @@
visibility.menubar = menubar->isVisible();
visibility.toolbars = toolbar->isVisible();
+ hide();
#if defined (FULLSCREEN_RESFREQ)
if (cfg->fullscreen_in_window == FALSE) {
- delay = gfx_monitor_set_res(cfg->fullscreen_res_w, cfg->fullscreen_res_h, cfg->adaptive_rrate, FALSE);
+ gfx_monitor_set_res(cfg->fullscreen_res_w, cfg->fullscreen_res_h, cfg->adaptive_rrate, FALSE);
}
} else {
+ hide();
if (gfx.type_of_fscreen_in_use == FULLSCR) {
-#if defined(_WIN32)
- // su alcuni monitor se il s_prepare_fullscreen e' eseguito dopo il delay, non viene
- // ripristinata correttamente la finestra non visualizzando la cornice di windows.
gfx_monitor_restore_res();
-#else
- // su Linux e BSD e' importante il delay per i motivi spiegati sotto.
- delay = gfx_monitor_restore_res();
-#endif
}
#endif
}
- if (delay == TRUE) {
- // se avvio la modalita' fullscreen dopo un cambio di risoluzione, senza questo ritardo
- // e' possibile che le QT mi passino informazioni non corrette sulle dimensioni del
- // desktop e che le decorazioni della finestra non appaiano correttamente (problema
- // riscontrato sotto Linux e BSD).
- // Usare un delay di 1000 ms perche' sotto windows (versione OpenGL) non mi crea problemi
- // quando viene visualizzata la menu bar. Con un valore inferiore, quando effettuo lo switch
- // a risoluzioni basse, non mi visualizza i submenu.
- QTimer::singleShot(1000, this, SLOT(s_fullscreen(void)));
- } else {
- s_fullscreen();
- }
+ s_fullscreen();
}
void mainWindow::s_set_vs_window(void) {
@@ -1710,5 +1692,4 @@
}
#endif
- hide();
if (desktop_resolution == true) {
showMaximized();
@@ -1724,5 +1705,5 @@
toolbar->setVisible(false);
statusbar->setVisible(false);
- hide();
+ reset_min_max_size();
#if defined (_WIN32)
// when a window is using an OpenGL based surface and is appearing in full screen mode,
@@ -1754,5 +1735,4 @@
}
gfx.type_of_fscreen_in_use = NO_FULLSCR;
- hide();
#if defined (_WIN32)
setWindowFlags(window_flags);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment