Merge lp:~widelands-dev/widelands/workarea-fixes into lp:widelands

Proposed by Benedikt Straub
Status: Merged
Merged at revision: 9178
Proposed branch: lp:~widelands-dev/widelands/workarea-fixes
Merge into: lp:widelands
Diff against target: 45 lines (+2/-8)
2 files modified
src/wui/buildingwindow.cc (+2/-6)
src/wui/buildingwindow.h (+0/-2)
To merge this branch: bzr merge lp:~widelands-dev/widelands/workarea-fixes
Reviewer Review Type Date Requested Status
GunChleoc Approve
Review via email: mp+371171@code.launchpad.net

Commit message

Fix workarea layers getting stuck by always hiding them when the building window closes or warps

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

Continuous integration builds have changed state:

Travis build 5312. State: passed. Details: https://travis-ci.org/widelands/widelands/builds/570516513.
Appveyor build 5085. State: success. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_workarea_fixes-5085.

Revision history for this message
GunChleoc (gunchleoc) wrote :

LGTM :)

@bunnybot merge

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/wui/buildingwindow.cc'
2--- src/wui/buildingwindow.cc 2019-08-10 16:38:15 +0000
3+++ src/wui/buildingwindow.cc 2019-08-11 16:01:24 +0000
4@@ -58,7 +58,6 @@
5 building_position_(b.get_position()),
6 showing_workarea_(false),
7 avoid_fastclick_(avoid_fastclick),
8- is_warping_(false),
9 expeditionbtn_(nullptr) {
10 buildingnotes_subscriber_ = Notifications::subscribe<Widelands::NoteBuilding>(
11 [this](const Widelands::NoteBuilding& note) { on_building_note(note); });
12@@ -72,10 +71,8 @@
13 }
14
15 BuildingWindow::~BuildingWindow() {
16- if (!is_warping_) {
17- // Accessing the toggle_workarea_ button can cause segfaults, so we leave it alone
18- hide_workarea(false);
19- }
20+ // Accessing the toggle_workarea_ button can cause segfaults, so we leave it alone
21+ hide_workarea(false);
22 }
23
24 void BuildingWindow::on_building_note(const Widelands::NoteBuilding& note) {
25@@ -90,7 +87,6 @@
26 // The building is no more. Next think() will call die().
27 case Widelands::NoteBuilding::Action::kStartWarp:
28 igbase()->add_wanted_building_window(building_position_, get_pos(), is_minimal());
29- is_warping_ = true;
30 break;
31 default:
32 break;
33
34=== modified file 'src/wui/buildingwindow.h'
35--- src/wui/buildingwindow.h 2019-05-25 12:21:14 +0000
36+++ src/wui/buildingwindow.h 2019-08-11 16:01:24 +0000
37@@ -135,8 +135,6 @@
38
39 bool showing_workarea_;
40 bool avoid_fastclick_;
41- // The building is being transformed from a contructionsite to a finished building etc.
42- bool is_warping_;
43
44 UI::Button* expeditionbtn_;
45 std::unique_ptr<Notifications::Subscriber<Widelands::NoteExpeditionCanceled>>

Subscribers

People subscribed via source and target branches

to status/vote changes: