Skip to content

Commit 2a30e1d

Browse files
committed
bug: console was not resized on changing gfx mode
1 parent 5e672f0 commit 2a30e1d

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/sdl_display.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include "my_wid_leftbar.hpp"
1414
#include "my_wid_rightbar.hpp"
1515
#include "my_wid_thing_info.hpp"
16+
#include "my_wid_topcon.hpp"
1617
#include "my_wid_tp_info.hpp"
1718

1819
void sdl_display(void)
@@ -72,11 +73,15 @@ void sdl_display_reset(void)
7273
{
7374
CON("SDL: Video resetting");
7475

76+
auto old_topcon = wid_topcon_serialize();
77+
auto old_console = wid_console_serialize();
78+
7579
wid_console_fini();
7680
wid_rightbar_fini();
7781
wid_leftbar_fini();
7882
wid_actionbar_fini();
7983
wid_botcon_fini();
84+
wid_topcon_fini();
8085
wid_asciimap_fini();
8186
wid_thing_info_fini("gfx toggle"); // To remove bag or other info
8287
wid_tp_info_fini("gfx toggle"); // To remove bag or other info
@@ -97,10 +102,13 @@ void sdl_display_reset(void)
97102
wid_hide(wid_console_window);
98103
sdl_flush_display();
99104

100-
wid_botcon_fini();
105+
wid_asciimap_init();
101106
wid_botcon_init();
107+
wid_topcon_init();
108+
wid_visible(wid_topcon_window);
102109
wid_visible(wid_botcon_window);
103-
wid_asciimap_init();
110+
wid_topcon_deserialize(old_topcon);
111+
wid_console_deserialize(old_console);
104112

105113
//
106114
// DO NOT CALL THIS HERE. We could be inside a widget mouse up handler.

0 commit comments

Comments
 (0)