Fix issue #3173, patch from Floessie in issue #3446

This commit is contained in:
Hombre
2016-12-13 23:47:13 +01:00
parent a7d4f76364
commit 1901f3a440

View File

@@ -385,11 +385,12 @@ void RTWindow::on_realize ()
bool RTWindow::on_window_state_event(GdkEventWindowState* event) bool RTWindow::on_window_state_event(GdkEventWindowState* event)
{ {
const int new_window_state = event->new_window_state & ~GDK_WINDOW_STATE_FOCUSED;
if (!event->new_window_state) { if (!new_window_state) {
// Window mode // Window mode
options.windowMaximized = false; options.windowMaximized = false;
} else if (event->new_window_state & (GDK_WINDOW_STATE_MAXIMIZED | GDK_WINDOW_STATE_FULLSCREEN | GDK_WINDOW_STATE_ICONIFIED)) { } else if (new_window_state & (GDK_WINDOW_STATE_MAXIMIZED | GDK_WINDOW_STATE_FULLSCREEN | GDK_WINDOW_STATE_ICONIFIED)) {
// Fullscreen mode, save this mode even when window is iconified (minimized) to allow easier restore, not the best solution though... // Fullscreen mode, save this mode even when window is iconified (minimized) to allow easier restore, not the best solution though...
options.windowMaximized = true; options.windowMaximized = true;
} }