Latest Posts

Topic: How to use UI::Dropdown

Nordfriese
Avatar
Topic Opener
Joined: 2017-01-17, 17:07
Posts: 1950
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2019-12-03, 12:08

In two of my development branches, I am having trouble with UI::Dropdown.

In scenario-editor, I am adapting some WUI functionality for use in the editor. To set settings for productionsites there, the workers tab in ProductionSiteWindow gets a Dropdown. When opening the window in the editor, this works fine, but opening a TrainingsiteWindow (which inherits from ProductionSiteWindow) results in ASan crashing with heap-use-after-free.

In expedition-cfg, the port´s expedition tab gets a dropdown which works well. When the expedition is ready while the window is still open, the tab´s closing causes a heap-use-after-free.

In both cases, the backtrace points to

ui_basic/dropdown.cc:143
(many lines of boost::signals2::...)
ui_basic/panel.cc:272

Apparently, the dropdown hooks into all toplevel windows to layout properly, and the lambda function doesn´t seem to notice that the dropdown was already deleted if only a tab and not the whole window closes. Is this a bug in dropdown code, or is there some easy way to work around this?


Top Quote
stonerl
Avatar
Joined: 2018-07-29, 23:03
Posts: 327
Ranking
Tribe Member
Posted at: 2019-12-07, 11:50

I do have a problem myself with the Dropdowns. Dropdowns don't release focus. So, every time a Dropdown is opened, focus stays on this Dropdown even when closed or the window that contained the dropdown is closed the focus isn't regained by the map. This is quite annoying because this breaks scrolling, and the only way to get it back is to open a window that requests focus itself.


Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 14:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2020-01-05, 16:31

Sounds like bugs to me. Can you please open issues for them?


Busy indexing nil values

Top Quote
Nordfriese
Avatar
Topic Opener
Joined: 2017-01-17, 17:07
Posts: 1950
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2020-01-08, 12:44

The one I reported is fixed already: https://github.com/widelands/widelands/pull/3601/files

I´d appreciate it if you could take a quick look at the diff since this is mainly your domain face-smile.png


Top Quote