summaryrefslogtreecommitdiff
path: root/riscos/dialog.c
diff options
context:
space:
mode:
authorRichard Wilson <rjw@netsurf-browser.org>2004-07-12 19:55:49 +0000
committerRichard Wilson <rjw@netsurf-browser.org>2004-07-12 19:55:49 +0000
commitfb07fba4f845c7b06a92ec7663cde633658241f0 (patch)
tree294c25f24612767d6c3f5feda41d6aa8f64f39cc /riscos/dialog.c
parenteb8f6921f5b529bbd05a82ed8e3cd846d19f1af4 (diff)
downloadnetsurf-fb07fba4f845c7b06a92ec7663cde633658241f0.tar.gz
netsurf-fb07fba4f845c7b06a92ec7663cde633658241f0.tar.bz2
[project @ 2004-07-12 19:55:49 by rjw]
Improved caret handling for persistant windows. Window submenu moved from Display to Utilities. svn path=/import/netsurf/; revision=1073
Diffstat (limited to 'riscos/dialog.c')
-rw-r--r--riscos/dialog.c33
1 files changed, 30 insertions, 3 deletions
diff --git a/riscos/dialog.c b/riscos/dialog.c
index 395bbcdc7..4823e7b5a 100644
--- a/riscos/dialog.c
+++ b/riscos/dialog.c
@@ -289,8 +289,8 @@ void ro_gui_dialog_close_persistant(wimp_w parent) {
*/
if (parent == NULL) return;
for (i = 0; i < MAX_PERSISTANT; i++) {
- if (persistant_dialog[i][1] == parent) {
- xwimp_close_window(persistant_dialog[i][0]);
+ if ((persistant_dialog[i][1] == parent) && (persistant_dialog[i][0] != NULL)) {
+ ro_gui_dialog_close(persistant_dialog[i][0]);
persistant_dialog[i][0] = NULL;
}
}
@@ -802,7 +802,33 @@ void ro_gui_dialog_click_warning(wimp_pointer *pointer)
void ro_gui_dialog_close(wimp_w close)
{
- os_error *error;
+ int i;
+ wimp_caret caret;
+ os_error *error = NULL;
+
+ /* Give the caret back to the parent window. This code relies on the fact that
+ only hotlist windows and browser windows open persistant dialogues, as the caret
+ gets placed to no icon.
+ */
+ if (!xwimp_get_caret_position(&caret)) {
+ if (caret.w == close) {
+
+ /* Check if we are a persistant window
+ */
+ for (i = 0; i < MAX_PERSISTANT; i++) {
+ if (persistant_dialog[i][0] == close) {
+ persistant_dialog[i][0] = NULL;
+ error = xwimp_set_caret_position(persistant_dialog[i][1],
+ wimp_ICON_WINDOW, -100, -100, 32, -1);
+ }
+ }
+ }
+ if (error) {
+ LOG(("xwimp_set_caret_position: 0x%x: %s",
+ error->errnum, error->errmess));
+ warn_user("WimpError", error->errmess);
+ }
+ }
error = xwimp_close_window(close);
if (error) {
@@ -827,6 +853,7 @@ void ro_gui_dialog_close(wimp_w close)
return;
}
}
+
}