summaryrefslogtreecommitdiff
path: root/riscos/window.c
diff options
context:
space:
mode:
authorRichard Wilson <rjw@netsurf-browser.org>2005-03-21 00:50:13 +0000
committerRichard Wilson <rjw@netsurf-browser.org>2005-03-21 00:50:13 +0000
commit9a76676600fef4ddf0474840efad22032137ff41 (patch)
treeff95ab22e8a2520fcdae288ce80081ee3b5308c2 /riscos/window.c
parent8c0cc33e3bf613a53c04958d569984ec049ce472 (diff)
downloadnetsurf-9a76676600fef4ddf0474840efad22032137ff41.tar.gz
netsurf-9a76676600fef4ddf0474840efad22032137ff41.tar.bz2
[project @ 2005-03-21 00:50:13 by rjw]
Add shift+toggle feature for short contents. *** HACK *** svn path=/import/netsurf/; revision=1566
Diffstat (limited to 'riscos/window.c')
-rw-r--r--riscos/window.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/riscos/window.c b/riscos/window.c
index 0c8e66e71..f17db239c 100644
--- a/riscos/window.c
+++ b/riscos/window.c
@@ -969,10 +969,12 @@ void ro_gui_window_open(struct gui_window *g, wimp_open *open)
bool toggle_hack = false;
int screen_height, screen_width;
os_error *error;
+ int key_down = 0;
+ int inset = 0;
content = g->bw->current_content;
- /* check for toggle to full size - NOW FEATURING "TEMPORARY HACK" */
+ /* check for toggle to full size so we can force to full height for short contents */
state.w = g->window;
error = xwimp_get_window_state(&state);
if (error) {
@@ -981,16 +983,21 @@ void ro_gui_window_open(struct gui_window *g, wimp_open *open)
warn_user("WimpError", error->errmess);
return;
}
- if ((state.flags & wimp_WINDOW_TOGGLED) &&
- (state.flags & wimp_WINDOW_BOUNDED_ONCE) &&
- !(state.flags & wimp_WINDOW_FULL_SIZE)) {
- /* Check if we need to perform our hack
- */
+ if ((state.flags & wimp_WINDOW_TOGGLED) && // bit 19
+ (state.flags & wimp_WINDOW_BOUNDED_ONCE) && // bit 21
+ !(state.flags & wimp_WINDOW_FULL_SIZE)) { // not bit 18
ro_gui_screen_size(&screen_width, &screen_height);
- if ((content->height * 2 * g->option.scale) < screen_height) {
- open->visible.y0 = 0;
- open->visible.y1 = 0x1000;
- height = 0x1000;
+ /* i can see no way of easily discovering if we were the result of a shift-
+ * toggle as wimp_WINDOW_PARTIAL_SIZE does not seem to be what we need. As
+ * such we do the really horrible thing of testing for Shift directly and
+ * decreasing the value accordingly. Yuck. */
+ xosbyte1(osbyte_SCAN_KEYBOARD, 0 ^ 0x80, 0, &key_down);
+ if (key_down != 0)
+ inset = 160 + ro_get_hscroll_height(0);
+ if ((content->height * 2 * g->option.scale) < screen_height - inset) {
+ open->visible.y0 = inset;
+ open->visible.y1 = screen_height;
+ height = screen_height - inset;
toggle_hack = true;
}
}