summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsignde <signde@openttd.org>2004-09-12 10:23:35 +0000
committersignde <signde@openttd.org>2004-09-12 10:23:35 +0000
commit956bf639eaa1f50c8e198898f756edecae658c31 (patch)
treecf27025651ae3bbce402ce30c974b9a6e8c0714d
parent34ecc0d7787523ad5d0f276fce5c562c71bcd6fb (diff)
downloadopenttd-956bf639eaa1f50c8e198898f756edecae658c31.tar.xz
(svn r210) -Fix: Console key closes window in front
-Fix: Console events were processed in wrong window -Fix: Console unresponsive when you activated another window
-rw-r--r--console.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/console.c b/console.c
index 1c43ae766..50bae0353 100644
--- a/console.c
+++ b/console.c
@@ -63,10 +63,12 @@ SetWindowDirty(_iconsole_win);
static void IConsoleWndProc(Window *w, WindowEvent *e)
{
+ // only do window events with the console
+ w = FindWindowById(WC_CONSOLE, 0);
+
switch(e->event) {
case WE_PAINT:
-
GfxFillRect(w->left,w->top,w->width,w->height-1,0);
{
int i=_iconsole_scroll;
@@ -252,7 +254,7 @@ void IConsoleSwitch()
_iconsole_mode=ICONSOLE_OPENED;
} else
if (_iconsole_mode==ICONSOLE_OPENED) {
- DeleteWindow(_iconsole_win);
+ DeleteWindowById(WC_CONSOLE,0);
_iconsole_win=NULL;
_iconsole_mode=ICONSOLE_CLOSED;
}