1
0
Fork 0

(svn r25288) -Codechange: No need to copy the WindowDesc flags if the WindowDesc is directly accessible.

release/1.4
frosch 2013-05-26 19:24:11 +00:00
parent 56e4a8c4d6
commit b6d76c4d4c
2 changed files with 3 additions and 5 deletions

View File

@ -419,7 +419,7 @@ static void DispatchLeftClickEvent(Window *w, int x, int y, int click_count)
bool focused_widget_changed = false; bool focused_widget_changed = false;
/* If clicked on a window that previously did dot have focus */ /* If clicked on a window that previously did dot have focus */
if (_focused_window != w && // We already have focus, right? 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 widget_type != WWT_CLOSEBOX) { // Don't change focused window if 'X' (close button) was clicked
focused_widget_changed = true; focused_widget_changed = true;
SetFocusedWindow(w); SetFocusedWindow(w);
@ -1171,7 +1171,6 @@ void Window::InitializeData(WindowNumber window_number)
this->owner = INVALID_OWNER; this->owner = INVALID_OWNER;
this->nested_focus = NULL; this->nested_focus = NULL;
this->window_number = window_number; this->window_number = window_number;
this->desc_flags = this->window_desc->flags;
this->OnInit(); this->OnInit();
/* Initialize nested widget tree. */ /* Initialize nested widget tree. */
@ -2212,7 +2211,7 @@ static bool MaybeBringWindowToFront(Window *w)
Window *u; Window *u;
FOR_ALL_WINDOWS_FROM_BACK_FROM(u, w->z_front) { FOR_ALL_WINDOWS_FROM_BACK_FROM(u, w->z_front) {
/* A modal child will prevent the activation of the parent window */ /* 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->SetWhiteBorder();
u->SetDirty(); u->SetDirty();
return false; return false;
@ -2975,7 +2974,7 @@ restart_search:
* as deleting this window could cascade in deleting (many) others * as deleting this window could cascade in deleting (many) others
* anywhere in the z-array */ * anywhere in the z-array */
FOR_ALL_WINDOWS_FROM_BACK(w) { FOR_ALL_WINDOWS_FROM_BACK(w) {
if (w->desc_flags & WDF_CONSTRUCTION) { if (w->window_desc->flags & WDF_CONSTRUCTION) {
delete w; delete w;
goto restart_search; goto restart_search;
} }

View File

@ -297,7 +297,6 @@ public:
Owner owner; ///< The owner of the content shown in this window. Company colour is acquired from this variable. Owner owner; ///< The owner of the content shown in this window. Company colour is acquired from this variable.
ViewportData *viewport; ///< Pointer to viewport data, if present. ViewportData *viewport; ///< Pointer to viewport data, if present.
uint32 desc_flags; ///< Window/widgets default flags setting. @see WindowDefaultFlag
const NWidgetCore *nested_focus; ///< Currently focused nested widget, or \c NULL if no nested widget has focus. const NWidgetCore *nested_focus; ///< Currently focused nested widget, or \c NULL if no nested widget has focus.
SmallMap<int, QueryString*> querystrings; ///< QueryString associated to WWT_EDITBOX widgets. SmallMap<int, QueryString*> querystrings; ///< QueryString associated to WWT_EDITBOX widgets.
NWidgetBase *nested_root; ///< Root of the nested tree. NWidgetBase *nested_root; ///< Root of the nested tree.