Changeset - r17520:598039a5604b
[Not reviewed]
master
0 1 0
frosch - 13 years ago 2011-04-03 17:00:57
frosch@openttd.org
(svn r22294) -Fix (r20922)[FS#4571]: Reset Window::scrolling_scrollbar when raising scrollbar buttons.
1 file changed with 1 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/window.cpp
Show inline comments
 
@@ -1371,48 +1371,49 @@ void UnInitWindowSystem()
 
}
 

	
 
/**
 
 * Reset the windowing system, by means of shutting it down followed by re-initialization
 
 */
 
void ResetWindowSystem()
 
{
 
	UnInitWindowSystem();
 
	InitWindowSystem();
 
	_thd.Reset();
 
}
 

	
 
static void DecreaseWindowCounters()
 
{
 
	Window *w;
 
	FOR_ALL_WINDOWS_FROM_FRONT(w) {
 
		if (_scroller_click_timeout == 0) {
 
			/* Unclick scrollbar buttons if they are pressed. */
 
			for (uint i = 0; i < w->nested_array_size; i++) {
 
				NWidgetBase *nwid = w->nested_array[i];
 
				if (nwid != NULL && (nwid->type == NWID_HSCROLLBAR || nwid->type == NWID_VSCROLLBAR)) {
 
					NWidgetScrollbar *sb = static_cast<NWidgetScrollbar*>(nwid);
 
					if (sb->disp_flags & (ND_SCROLLBAR_UP | ND_SCROLLBAR_DOWN)) {
 
						sb->disp_flags &= ~(ND_SCROLLBAR_UP | ND_SCROLLBAR_DOWN);
 
						w->scrolling_scrollbar = -1;
 
						sb->SetDirty(w);
 
					}
 
				}
 
			}
 
		}
 
		w->OnMouseLoop();
 
	}
 

	
 
	FOR_ALL_WINDOWS_FROM_FRONT(w) {
 
		if ((w->flags4 & WF_TIMEOUT_MASK) && !(--w->flags4 & WF_TIMEOUT_MASK)) {
 
			w->OnTimeout();
 
			if (w->desc_flags & WDF_UNCLICK_BUTTONS) w->RaiseButtons(true);
 
		}
 
	}
 
}
 

	
 
static void HandlePlacePresize()
 
{
 
	if (_special_mouse_mode != WSM_PRESIZE) return;
 

	
 
	Window *w = _thd.GetCallbackWnd();
 
	if (w == NULL) return;
 

	
 
	Point pt = GetTileBelowCursor();
0 comments (0 inline, 0 general)