diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-07-27 12:09:36 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-07-27 12:09:36 +0000 |
commit | e96b82e8da0cac34290d98e9172db2dce90b5ed0 (patch) | |
tree | 4c5343e995c2b912f947e3583a4236aa0b1a7f4a /crawl-ref/source/tilesdl.cc | |
parent | 5dd828e3caee784fb21743c52322a2202c99dc58 (diff) | |
download | crawl-ref-e96b82e8da0cac34290d98e9172db2dce90b5ed0.tar.gz crawl-ref-e96b82e8da0cac34290d98e9172db2dce90b5ed0.zip |
* Apply patch by kotk to fix the Alt-Tab bug (BR 2805959).
* Apply patch by trentbuck to allow packaging with tar (BR 2827595).
* Fix 2827342: Consider weapons "too large to wield" as useless.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10424 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/tilesdl.cc')
-rw-r--r-- | crawl-ref/source/tilesdl.cc | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/crawl-ref/source/tilesdl.cc b/crawl-ref/source/tilesdl.cc index 0db1d9fdf0..3383a13c9a 100644 --- a/crawl-ref/source/tilesdl.cc +++ b/crawl-ref/source/tilesdl.cc @@ -823,17 +823,18 @@ int TilesFramework::getch_ck() switch (event.type) { + case SDL_ACTIVEEVENT: + // When game gains focus back then set mod state clean + // to get rid of stupid Windows/SDL bug with Alt-Tab. + if (event.active.gain != 0) + { + SDL_SetModState(KMOD_NONE); + set_need_redraw(); + } + break; case SDL_KEYDOWN: m_key_mod |= _get_modifiers(event.key.keysym); key = _translate_keysym(event.key.keysym); - if (m_key_mod == MOD_ALT - && key_to_command(key, KMC_DEFAULT) == CMD_NO_CMD) - { - // If the Alt key is pressed and the command is invalid, - // try clearing the Alt key in case it got stuck in - // the stupid Windows/SDL bug with Alt-Tab. - m_key_mod &= ~MOD_ALT; - } m_region_tile->place_cursor(CURSOR_MOUSE, Region::NO_CURSOR); // If you hit a key, disable tooltips until the mouse |