Added support for the Close button in the system window.

This commit is contained in:
David Capello 2009-11-22 03:53:43 +00:00
parent 3626589229
commit fd6f7dd156
2 changed files with 18 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2009-11-22 David Capello <davidcapello@gmail.com>
* src/jinete/jmanager.cpp (jmanager_generate_messages): Added
support for the Close button in the system window.
2009-11-21 David Capello <davidcapello@gmail.com>
* src/modules/skinneable_theme.h (jtheme): Added SkinneableTheme

View File

@ -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();