diff --git a/ChangeLog b/ChangeLog index 7f92a7451..fb406bffe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-11-22 David Capello + + * src/jinete/jmanager.cpp (jmanager_generate_messages): Added + support for the Close button in the system window. + 2009-11-21 David Capello * src/modules/skinneable_theme.h (jtheme): Added SkinneableTheme diff --git a/src/jinete/jmanager.cpp b/src/jinete/jmanager.cpp index c2fab0fd0..59573bb91 100644 --- a/src/jinete/jmanager.cpp +++ b/src/jinete/jmanager.cpp @@ -290,10 +290,6 @@ bool jmanager_generate_messages(JWidget manager) if (jlist_empty(manager->children)) return false; - /* TODO check for STAGE */ -/* if (want_close_stage == STAGE_WANT_CLOSE) */ -/* return false; */ - /* new windows to show? */ if (!jlist_empty(new_windows)) { JWidget magnet; @@ -469,6 +465,19 @@ bool jmanager_generate_messages(JWidget manager) jmanager_enqueue_message(msg); } + /* generate ESC key when the user press close button in the system window */ + if (want_close_stage == STAGE_WANT_CLOSE) { + want_close_stage = STAGE_NORMAL; + + msg = jmessage_new_key_related(JM_KEYPRESSED, (KEY_ESC << 8) | 27); + broadcast_key_msg(manager, msg); + jmanager_enqueue_message(msg); + + msg = jmessage_new_key_related(JM_KEYRELEASED, (KEY_ESC << 8) | 27); + broadcast_key_msg(manager, msg); + jmanager_enqueue_message(msg); + } + /* generate JM_CHAR/JM_KEYPRESSED messages */ while (keypressed()) { int readkey_value = readkey();