Merge branch 'master' into jgrpp

# Conflicts:
#	os/macosx/notarize.sh
#	src/3rdparty/CMakeLists.txt
#	src/3rdparty/squirrel/squirrel/sqcompiler.cpp
#	src/3rdparty/squirrel/squirrel/sqdebug.cpp
#	src/3rdparty/squirrel/squirrel/sqvm.cpp
#	src/console_cmds.cpp
#	src/core/span_type.hpp
#	src/crashlog.cpp
#	src/currency.h
#	src/date_gui.cpp
#	src/driver.cpp
#	src/fios.cpp
#	src/genworld_gui.cpp
#	src/hotkeys.cpp
#	src/misc_gui.cpp
#	src/music/os2_m.cpp
#	src/network/core/os_abstraction.h
#	src/network/network_server.cpp
#	src/newgrf.cpp
#	src/newgrf_config.h
#	src/newgrf_text.cpp
#	src/openttd.cpp
#	src/os/macosx/font_osx.cpp
#	src/os/macosx/misc_osx.cpp
#	src/os/os2/CMakeLists.txt
#	src/os/os2/os2.cpp
#	src/os/unix/CMakeLists.txt
#	src/os/windows/font_win32.cpp
#	src/os/windows/win32_main.cpp
#	src/saveload/saveload.cpp
#	src/script/api/script_text.cpp
#	src/settings.cpp
#	src/settings_gui.cpp
#	src/stdafx.h
#	src/strings.cpp
#	src/timetable_gui.cpp
#	src/town_gui.cpp
#	src/train_cmd.cpp
#	src/video/dedicated_v.cpp
#	src/video/video_driver.cpp
#	src/video/win32_v.cpp
#	src/viewport.cpp
#	src/waypoint_gui.cpp
#	src/widgets/dropdown_type.h
#	src/window.cpp
#	src/window_gui.h
This commit is contained in:
Jonathan G Rennison
2023-09-12 20:06:47 +01:00
242 changed files with 4733 additions and 6402 deletions

View File

@@ -834,7 +834,7 @@ static void DispatchRightClickEvent(Window *w, int x, int y)
}
/* Right-click close is enabled and there is a closebox */
if (_settings_client.gui.right_mouse_wnd_close && w->nested_root->GetWidgetOfType(WWT_CLOSEBOX)) {
if (_settings_client.gui.right_mouse_wnd_close && (w->window_desc->flags & WDF_NO_CLOSE) == 0) {
delete w;
} else if (_settings_client.gui.hover_delay_ms == 0 && !w->OnTooltip(pt, wid->index, TCC_RIGHT_CLICK) && wid->tool_tip != 0) {
GuiShowTooltips(w, wid->tool_tip, 0, nullptr, TCC_RIGHT_CLICK);
@@ -3541,12 +3541,8 @@ void CallWindowGameTickEvent()
void DeleteNonVitalWindows()
{
/* Note: the container remains stable, even when deleting windows. */
for (const Window *w : Window::IterateUnordered()) {
if (w->window_class != WC_MAIN_WINDOW &&
w->window_class != WC_SELECT_GAME &&
w->window_class != WC_MAIN_TOOLBAR &&
w->window_class != WC_STATUS_BAR &&
w->window_class != WC_TOOLTIPS &&
for (Window *w : Window::IterateUnordered()) {
if ((w->window_desc->flags & WDF_NO_CLOSE) == 0 &&
(w->flags & WF_STICKY) == 0) { // do not delete windows which are 'pinned'
delete w;
@@ -3563,12 +3559,9 @@ void DeleteNonVitalWindows()
*/
void DeleteAllNonVitalWindows()
{
/* Delete every window except for stickied ones, then sticky ones as well */
DeleteNonVitalWindows();
/* Note: the container remains stable, even when deleting windows. */
for (const Window *w : Window::IterateUnordered()) {
if (w->flags & WF_STICKY) {
/* Note: the container remains stable, even when closing windows. */
for (Window *w : Window::IterateUnordered()) {
if ((w->window_desc->flags & WDF_NO_CLOSE) == 0) {
delete w;
}
}