Author: rjw
Date: Mon Mar 26 13:28:19 2007
New Revision: 3225
URL:
http://svn.semichrome.net?rev=3225&view=rev
Log:
Call close functions when automatically closing child windows and when automatically
handlign Cancel buttons.
Modified:
trunk/netsurf/riscos/dialog.c
trunk/netsurf/riscos/wimp_event.c
Modified: trunk/netsurf/riscos/dialog.c
URL:
http://svn.semichrome.net/trunk/netsurf/riscos/dialog.c?rev=3225&r1=3...
==============================================================================
--- trunk/netsurf/riscos/dialog.c (original)
+++ trunk/netsurf/riscos/dialog.c Mon Mar 26 13:28:19 2007
@@ -365,9 +365,7 @@
}
/* Close any child windows */
- for (i = 0; i < MAX_PERSISTENT; i++)
- if (persistent_dialog[i].parent == close)
- ro_gui_dialog_close(persistent_dialog[i].dialog);
+ ro_gui_dialog_close_persistent(close);
/* Give the caret back to the parent window. This code relies on
the fact that only tree windows and browser windows open
@@ -642,6 +640,8 @@
if (persistent_dialog[i].parent == parent &&
persistent_dialog[i].dialog != NULL) {
ro_gui_dialog_close(persistent_dialog[i].dialog);
+ ro_gui_wimp_event_close_window(persistent_dialog[i].dialog);
+ persistent_dialog[i].parent = NULL;
persistent_dialog[i].dialog = NULL;
}
}
Modified: trunk/netsurf/riscos/wimp_event.c
URL:
http://svn.semichrome.net/trunk/netsurf/riscos/wimp_event.c?rev=3225&...
==============================================================================
--- trunk/netsurf/riscos/wimp_event.c (original)
+++ trunk/netsurf/riscos/wimp_event.c Mon Mar 26 13:28:19 2007
@@ -227,6 +227,7 @@
struct event_window *window;
struct icon_event *event;
+ LOG(("Removing all events for window 0x%x", (unsigned int)w));
window = ro_gui_wimp_event_remove_window(w);
if (!window)
return;
@@ -544,6 +545,7 @@
case EVENT_CANCEL:
if (pointer->buttons & wimp_CLICK_SELECT) {
ro_gui_dialog_close(pointer->w);
+ ro_gui_wimp_event_close_window(pointer->w);
ro_gui_menu_closed(true);
} else {
ro_gui_wimp_event_restore(pointer->w);
@@ -622,6 +624,7 @@
if (state & wimp_CLICK_SELECT) {
ro_gui_dialog_close(window->w);
+ ro_gui_wimp_event_close_window(window->w);
ro_gui_menu_closed(true);
} else {
ro_gui_wimp_event_memorise(window->w);
@@ -812,6 +815,7 @@
wimp_WINDOW_CLOSE_ICON))
return false;
ro_gui_dialog_close(key->w);
+ ro_gui_wimp_event_close_window(key->w);
ro_gui_menu_closed(true);
return true;
/* Return performs the OK action */
@@ -851,6 +855,7 @@
bool ro_gui_wimp_event_close_window(wimp_w w) {
struct event_window *window;
+ LOG(("Close event received for window 0x%x", (unsigned int)w));
window = ro_gui_wimp_event_find_window(w);
if ((window) && (window->close_window)) {
window->close_window(w);
@@ -1122,10 +1127,12 @@
struct event_window *window;
int h;
+ assert((int)w != 0);
window = ro_gui_wimp_event_find_window(w);
if (window)
return window;
+ LOG(("Creating structure for window 0x%x", (unsigned int)w));
window = calloc(1, sizeof(struct event_window));
if (!window)
return NULL;