Merge lp:~widelands-dev/widelands/bug-1841471-close-dropdowns-with-parent-windows into lp:widelands

Proposed by GunChleoc
Status: Work in progress
Proposed branch: lp:~widelands-dev/widelands/bug-1841471-close-dropdowns-with-parent-windows
Merge into: lp:widelands
Diff against target: 42 lines (+4/-6)
3 files modified
src/editor/ui_menus/player_menu.h (+0/-2)
src/ui_basic/dropdown.cc (+2/-3)
src/ui_basic/unique_window.cc (+2/-1)
To merge this branch: bzr merge lp:~widelands-dev/widelands/bug-1841471-close-dropdowns-with-parent-windows
Reviewer Review Type Date Requested Status
Widelands Developers Pending
Review via email: mp+371999@code.launchpad.net

Commit message

Fix deleting of dropdown lists in UniqueWindow and Player Menu.

To post a comment you must log in.
Revision history for this message
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 5358. State: errored. Details: https://travis-ci.org/widelands/widelands/builds/578358022.
Appveyor build 5128. State: success. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_bug_1841471_close_dropdowns_with_parent_windows-5128.

Revision history for this message
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 5358. State: passed. Details: https://travis-ci.org/widelands/widelands/builds/578358022.
Appveyor build 5128. State: success. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_bug_1841471_close_dropdowns_with_parent_windows-5128.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/editor/ui_menus/player_menu.h'
2--- src/editor/ui_menus/player_menu.h 2019-08-10 16:38:15 +0000
3+++ src/editor/ui_menus/player_menu.h 2019-09-08 20:32:09 +0000
4@@ -38,8 +38,6 @@
5 EditorPlayerMenu(EditorInteractive&,
6 EditorSetStartingPosTool& tool,
7 UI::UniqueWindow::Registry&);
8- ~EditorPlayerMenu() override {
9- }
10
11 private:
12 // Container with UI elements to set a player slot's properties
13
14=== modified file 'src/ui_basic/dropdown.cc'
15--- src/ui_basic/dropdown.cc 2019-07-28 11:33:50 +0000
16+++ src/ui_basic/dropdown.cc 2019-09-08 20:32:09 +0000
17@@ -147,9 +147,8 @@
18
19 BaseDropdown::~BaseDropdown() {
20 // The list needs to be able to drop outside of windows, so it won't close with the window.
21- // Deleting here leads to a conflict as to who gets to delete it, so we just leave it.
22- // It will be hidden as soon as the mouse moves away anyway.
23- // TODO(GunChleoc): Investigate whether we can find a better solution for this
24+ // So, we tell it to die.
25+ list_->die();
26 }
27
28 void BaseDropdown::set_height(int height) {
29
30=== modified file 'src/ui_basic/unique_window.cc'
31--- src/ui_basic/unique_window.cc 2019-06-01 14:16:25 +0000
32+++ src/ui_basic/unique_window.cc 2019-09-08 20:32:09 +0000
33@@ -63,7 +63,8 @@
34 window->restore();
35 opened();
36 } else {
37- window->die();
38+ // Delete rather than die() to make dropdown lists behave
39+ delete window;
40 }
41 } else {
42 open_window();

Subscribers

People subscribed via source and target branches

to status/vote changes: