Make "You can't hide an invisible window" message respect /SET WINDOW_QUIET

Also remove unnecessary NULL check, window->screen is already checked for NULL.
This commit is contained in:
Kevin Easton
2017-11-10 17:16:58 +11:00
parent c6f420b53d
commit a71ee883e1
2 changed files with 8 additions and 6 deletions

View File

@@ -1,5 +1,8 @@
[Changes 1.2.2] [Changes 1.2.2]
* Make "You can't hide an invisible window" message respect
/SET WINDOW_QUIET. (caf)
* Allow $mychannels() to query a window attached to a different server. (caf) * Allow $mychannels() to query a window attached to a different server. (caf)
* Fix crash when passing $mychannels() a non-existent window refnum. (caf) * Fix crash when passing $mychannels() a non-existent window refnum. (caf)

View File

@@ -1078,7 +1078,8 @@ void BX_hide_window(Window *window)
{ {
if (!window->screen) if (!window->screen)
{ {
say("You can't hide an invisible window."); if (!get_int_var(WINDOW_QUIET_VAR))
say("You can't hide an invisible window.");
return; return;
} }
if (window->screen->visible_windows == 1) if (window->screen->visible_windows == 1)
@@ -1087,11 +1088,9 @@ void BX_hide_window(Window *window)
say("You can't hide the last window."); say("You can't hide the last window.");
return; return;
} }
if (window->screen)
{ remove_window_from_screen(window);
remove_window_from_screen(window); add_to_invisible_list(window);
add_to_invisible_list(window);
}
} }
/* /*