summaryrefslogtreecommitdiff
path: root/src/window.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2013-05-26 19:24:11 +0000
committerfrosch <frosch@openttd.org>2013-05-26 19:24:11 +0000
commitb6d76c4d4cc3c8b00993aa6d035e79ffa133985e (patch)
tree0a214b2492583e7081441a1e80fca5d5e3cdf7b3 /src/window.cpp
parent56e4a8c4d63b19cb037ac1ba64c5a4d7fde4350b (diff)
downloadopenttd-b6d76c4d4cc3c8b00993aa6d035e79ffa133985e.tar.xz
(svn r25288) -Codechange: No need to copy the WindowDesc flags if the WindowDesc is directly accessible.
Diffstat (limited to 'src/window.cpp')
-rw-r--r--src/window.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/window.cpp b/src/window.cpp
index 718d6b03a..8b429ef9f 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -419,7 +419,7 @@ static void DispatchLeftClickEvent(Window *w, int x, int y, int click_count)
bool focused_widget_changed = false;
/* If clicked on a window that previously did dot have focus */
if (_focused_window != w && // We already have focus, right?
- (w->desc_flags & WDF_NO_FOCUS) == 0 && // Don't lose focus to toolbars
+ (w->window_desc->flags & WDF_NO_FOCUS) == 0 && // Don't lose focus to toolbars
widget_type != WWT_CLOSEBOX) { // Don't change focused window if 'X' (close button) was clicked
focused_widget_changed = true;
SetFocusedWindow(w);
@@ -1171,7 +1171,6 @@ void Window::InitializeData(WindowNumber window_number)
this->owner = INVALID_OWNER;
this->nested_focus = NULL;
this->window_number = window_number;
- this->desc_flags = this->window_desc->flags;
this->OnInit();
/* Initialize nested widget tree. */
@@ -2212,7 +2211,7 @@ static bool MaybeBringWindowToFront(Window *w)
Window *u;
FOR_ALL_WINDOWS_FROM_BACK_FROM(u, w->z_front) {
/* A modal child will prevent the activation of the parent window */
- if (u->parent == w && (u->desc_flags & WDF_MODAL)) {
+ if (u->parent == w && (u->window_desc->flags & WDF_MODAL)) {
u->SetWhiteBorder();
u->SetDirty();
return false;
@@ -2975,7 +2974,7 @@ restart_search:
* as deleting this window could cascade in deleting (many) others
* anywhere in the z-array */
FOR_ALL_WINDOWS_FROM_BACK(w) {
- if (w->desc_flags & WDF_CONSTRUCTION) {
+ if (w->window_desc->flags & WDF_CONSTRUCTION) {
delete w;
goto restart_search;
}