File diff r12076:cdb45179e7bc → r12077:baf868e4baf0
src/window.cpp
Show inline comments
 
@@ -323,21 +323,21 @@ static void DispatchLeftClickEvent(Windo
 
			if (widget_type == WWT_CAPTION) { // 'Title bar'
 
				StartWindowDrag(w);
 
				return;
 
			}
 
		}
 

	
 
		if (w->desc_flags & WDF_RESIZABLE && widget_type == WWT_RESIZEBOX) {
 
		if ((w->desc_flags & WDF_RESIZABLE) && widget_type == WWT_RESIZEBOX) {
 
			/* When the resize widget is on the left size of the window
 
			 * we assume that that button is used to resize to the left. */
 
			StartWindowSizing(w, wi->left < (w->width / 2));
 
			w->InvalidateWidget(widget_index);
 
			return;
 
		}
 

	
 
		if (w->desc_flags & WDF_STICKY_BUTTON && widget_type == WWT_STICKYBOX) {
 
		if ((w->desc_flags & WDF_STICKY_BUTTON) && widget_type == WWT_STICKYBOX) {
 
			w->flags4 ^= WF_STICKY;
 
			w->InvalidateWidget(widget_index);
 
			return;
 
		}
 
	}
 

	
 
@@ -1237,13 +1237,13 @@ static void DecreaseWindowCounters()
 
			w->SetDirty();
 
		}
 
		w->OnMouseLoop();
 
	}
 

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

	
 
@@ -1548,13 +1548,13 @@ static bool HandleWindowDragging()
 

	
 
			/* Window already on size */
 
			if (x == 0 && y == 0) return false;
 

	
 
			/* Now find the new cursor pos.. this is NOT _cursor, because we move in steps. */
 
			_drag_delta.y += y;
 
			if (w->flags4 & WF_SIZING_LEFT && x != 0) {
 
			if ((w->flags4 & WF_SIZING_LEFT) && x != 0) {
 
				_drag_delta.x -= x; // x > 0 -> window gets longer -> left-edge moves to left -> subtract x to get new position.
 
				w->SetDirty();
 
				w->left -= x;  // If dragging left edge, move left window edge in opposite direction by the same amount.
 
				/* ResizeWindow() below ensures marking new position as dirty. */
 
			} else {
 
				_drag_delta.x += x;