summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordarkvater <darkvater@openttd.org>2005-01-23 13:42:26 +0000
committerdarkvater <darkvater@openttd.org>2005-01-23 13:42:26 +0000
commit5d2eaf5af0bbad6e4d5cdf8b2213367f66513d4f (patch)
treed0054a1e15ea436dd73e8b8355811a583463c683
parentb586a890f7926644746f908603277ca0dd23458d (diff)
downloadopenttd-5d2eaf5af0bbad6e4d5cdf8b2213367f66513d4f.tar.xz
(svn r1613) -Fix: WE_CLICK event is not called on default actions. If special action is needed, use the other events like WE_RESIZE or WE_DESTROY, etc.
-rw-r--r--window.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/window.c b/window.c
index 737f93ced..5b0db975b 100644
--- a/window.c
+++ b/window.c
@@ -54,17 +54,22 @@ void DispatchLeftClickEvent(Window *w, int x, int y) {
return;
}
- if (e.click.widget == 1) /* 'Title bar' */
- StartWindowDrag(w);
+ if (e.click.widget == 1) { /* 'Title bar' */
+ StartWindowDrag(w); // if not return then w = StartWindowDrag(w); to get correct pointer
+ return;
+ }
}
- if (w->desc_flags & WDF_RESIZABLE && wi->type == WWT_RESIZEBOX)
- w = StartWindowSizing(w);
+ if (w->desc_flags & WDF_RESIZABLE && wi->type == WWT_RESIZEBOX) {
+ StartWindowSizing(w); // if not return then w = StartWindowSizing(w); to get correct pointer
+ return;
+ }
if (w->desc_flags & WDF_STICKY_BUTTON && wi->type == WWT_STICKYBOX) {
TOGGLEBIT(w->click_state, e.click.widget);
w->flags4 ^= WF_STICKY;
InvalidateWidget(w, e.click.widget);
+ return;
}
}