widelands-dev team mailing list archive
-
widelands-dev team
-
Mailing list archive
-
Message #17957
[Merge] lp:~widelands-dev/widelands/workarea-fixes into lp:widelands
Benedikt Straub has proposed merging lp:~widelands-dev/widelands/workarea-fixes into lp:widelands.
Commit message:
Fix workarea layers getting stuck by always hiding them when the building window closes or warps
Requested reviews:
Widelands Developers (widelands-dev)
Related bugs:
Bug #1830345 in widelands: "overlapping workareas are very performance hungry"
https://bugs.launchpad.net/widelands/+bug/1830345
Bug #1830647 in widelands: "Indicate workarea border more clearly"
https://bugs.launchpad.net/widelands/+bug/1830647
Bug #1839690 in widelands: "Construction site work area overlay becomes stuck"
https://bugs.launchpad.net/widelands/+bug/1839690
For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/workarea-fixes/+merge/371171
--
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/workarea-fixes into lp:widelands.
=== modified file 'src/wui/buildingwindow.cc'
--- src/wui/buildingwindow.cc 2019-08-10 16:38:15 +0000
+++ src/wui/buildingwindow.cc 2019-08-11 16:01:24 +0000
@@ -58,7 +58,6 @@
building_position_(b.get_position()),
showing_workarea_(false),
avoid_fastclick_(avoid_fastclick),
- is_warping_(false),
expeditionbtn_(nullptr) {
buildingnotes_subscriber_ = Notifications::subscribe<Widelands::NoteBuilding>(
[this](const Widelands::NoteBuilding& note) { on_building_note(note); });
@@ -72,10 +71,8 @@
}
BuildingWindow::~BuildingWindow() {
- if (!is_warping_) {
- // Accessing the toggle_workarea_ button can cause segfaults, so we leave it alone
- hide_workarea(false);
- }
+ // Accessing the toggle_workarea_ button can cause segfaults, so we leave it alone
+ hide_workarea(false);
}
void BuildingWindow::on_building_note(const Widelands::NoteBuilding& note) {
@@ -90,7 +87,6 @@
// The building is no more. Next think() will call die().
case Widelands::NoteBuilding::Action::kStartWarp:
igbase()->add_wanted_building_window(building_position_, get_pos(), is_minimal());
- is_warping_ = true;
break;
default:
break;
=== modified file 'src/wui/buildingwindow.h'
--- src/wui/buildingwindow.h 2019-05-25 12:21:14 +0000
+++ src/wui/buildingwindow.h 2019-08-11 16:01:24 +0000
@@ -135,8 +135,6 @@
bool showing_workarea_;
bool avoid_fastclick_;
- // The building is being transformed from a contructionsite to a finished building etc.
- bool is_warping_;
UI::Button* expeditionbtn_;
std::unique_ptr<Notifications::Subscriber<Widelands::NoteExpeditionCanceled>>
Follow ups