summaryrefslogtreecommitdiff
path: root/src/window_gui.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-01-07 16:11:27 +0000
committerrubidium <rubidium@openttd.org>2009-01-07 16:11:27 +0000
commit84dee1e7389aa359ce802f5fca3f167771c44005 (patch)
tree6e7a2129d3a3830aef49e3d4654b27dfd3f2d9c5 /src/window_gui.h
parentfa22bcd45645ca98932c635c61fc96680438e496 (diff)
downloadopenttd-84dee1e7389aa359ce802f5fca3f167771c44005.tar.xz
(svn r14899) -Feature: remove the window limit, but leave a configurable limit on the number of non-sticky non-vital windows.
-Fix [FS#2499]: crashes/misbehaviours when (almost) all windows are stickied.
Diffstat (limited to 'src/window_gui.h')
-rw-r--r--src/window_gui.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/window_gui.h b/src/window_gui.h
index 81d3f5062..ea2a5f076 100644
--- a/src/window_gui.h
+++ b/src/window_gui.h
@@ -226,6 +226,8 @@ public:
uint32 desc_flags; ///< Window/widgets default flags setting, @see WindowDefaultFlag
Window *parent; ///< Parent window
+ Window *z_front; ///< The window in front of us in z-order
+ Window *z_back; ///< The window behind us in z-order
void HandleButtonClick(byte widget);
@@ -537,12 +539,12 @@ void GuiShowTooltips(StringID str, uint paramcount = 0, const uint64 params[] =
int GetWidgetFromPos(const Window *w, int x, int y);
/* window.cpp */
-extern Window *_z_windows[];
-extern Window **_last_z_window;
+extern Window *_z_front_window;
+extern Window *_z_back_window;
/** Iterate over all windows */
-#define FOR_ALL_WINDOWS_FROM_BACK(w) for (Window **wz = _z_windows; wz != _last_z_window && (w = *wz) != NULL; wz++)
-#define FOR_ALL_WINDOWS_FROM_FRONT(w) for (Window **wz = _last_z_window; wz != _z_windows && (w = *--wz) != NULL;)
+#define FOR_ALL_WINDOWS_FROM_BACK(w) for (w = _z_back_window; w != NULL; w = w->z_front)
+#define FOR_ALL_WINDOWS_FROM_FRONT(w) for (w = _z_front_window; w != NULL; w = w->z_back)
/**
* Disable scrolling of the main viewport when an input-window is active.
@@ -568,7 +570,6 @@ enum SpecialMouseMode {
};
Window *GetCallbackWnd();
-Window **FindWindowZPosition(const Window *w);
void ScrollbarClickHandler(Window *w, const Widget *wi, int x, int y);