netsurf: branch master updated. release/3.6-186-gc19ea4d

NetSurf Browser Project (Commit Mailer) no-reply at netsurf-browser.org
Sun Jan 8 14:09:10 GMT 2017


Gitweb links:

...log http://git.netsurf-browser.org/netsurf.git/shortlog/c19ea4deaa61f8418db2c92f1843456be0389b7e
...commit http://git.netsurf-browser.org/netsurf.git/commit/c19ea4deaa61f8418db2c92f1843456be0389b7e
...tree http://git.netsurf-browser.org/netsurf.git/tree/c19ea4deaa61f8418db2c92f1843456be0389b7e

The branch, master has been updated
       via  c19ea4deaa61f8418db2c92f1843456be0389b7e (commit)
       via  05e4463230d8ae9880ac3aef38ca12f09d30d960 (commit)
      from  074afb43f424d671ce6d00b140df851a26f3ddd7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=c19ea4deaa61f8418db2c92f1843456be0389b7e
commit c19ea4deaa61f8418db2c92f1843456be0389b7e
Author: Chris Young <chris at unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris at unsatisfactorysoftware.co.uk>

    Support SimpleRefresh corewindows
    These queue redraws unlike the main browser window, which seems to work a bit better than redrawing immediately.

diff --git a/frontends/amiga/cookies.c b/frontends/amiga/cookies.c
index f428881..74c89cb 100644
--- a/frontends/amiga/cookies.c
+++ b/frontends/amiga/cookies.c
@@ -288,6 +288,11 @@ static nserror
 ami_cookies_create_window(struct ami_cookie_window *cookie_win)
 {
 	struct ami_corewindow *ami_cw = (struct ami_corewindow *)&cookie_win->core;
+	ULONG refresh_mode = WA_SmartRefresh;
+
+	if(nsoption_bool(window_simple_refresh) == true) {
+		refresh_mode = WA_SimpleRefresh;
+	}
 
 	ami_cw->objects[GID_CW_WIN] = WindowObj,
   	    WA_ScreenTitle, ami_gui_get_screen_title(),
@@ -304,11 +309,13 @@ ami_cookies_create_window(struct ami_cookie_window *cookie_win)
 		WA_Height, nsoption_int(cookies_window_ysize),
 		WA_PubScreen, scrn,
 		WA_ReportMouse, TRUE,
-       	WA_IDCMP, IDCMP_MOUSEMOVE | IDCMP_MOUSEBUTTONS | IDCMP_NEWSIZE |
+		refresh_mode, TRUE,
+		WA_IDCMP, IDCMP_MOUSEMOVE | IDCMP_MOUSEBUTTONS | IDCMP_NEWSIZE |
 				IDCMP_RAWKEY | IDCMP_GADGETUP | IDCMP_IDCMPUPDATE |
-				IDCMP_EXTENDEDMOUSE | IDCMP_SIZEVERIFY,
+				IDCMP_EXTENDEDMOUSE | IDCMP_SIZEVERIFY | IDCMP_REFRESHWINDOW,
 		WINDOW_IDCMPHook, &ami_cw->idcmp_hook,
-		WINDOW_IDCMPHookBits, IDCMP_IDCMPUPDATE | IDCMP_EXTENDEDMOUSE,
+		WINDOW_IDCMPHookBits, IDCMP_IDCMPUPDATE | IDCMP_EXTENDEDMOUSE |
+				IDCMP_SIZEVERIFY | IDCMP_REFRESHWINDOW,
 		WINDOW_SharedPort, sport,
 		WINDOW_HorizProp, 1,
 		WINDOW_VertProp, 1,
diff --git a/frontends/amiga/corewindow.c b/frontends/amiga/corewindow.c
index 2417d7b..d2bfbf9 100644
--- a/frontends/amiga/corewindow.c
+++ b/frontends/amiga/corewindow.c
@@ -66,8 +66,6 @@
 #include "amiga/schedule.h"
 #include "amiga/utf8.h"
 
-static void ami_cw_get_window_dimensions(struct core_window *cw, int *width, int *height);
-
 static void
 ami_cw_scroller_top(struct ami_corewindow *ami_cw, ULONG *restrict x, ULONG *restrict y)
 {
@@ -86,6 +84,22 @@ ami_cw_scroller_top(struct ami_corewindow *ami_cw, ULONG *restrict x, ULONG *res
 	*y = ys;
 }
 
+static void
+ami_cw_window_size(struct ami_corewindow *ami_cw, int *width, int *height)
+{
+	struct IBox *bbox;
+
+	if(ami_gui_get_space_box((Object *)ami_cw->objects[GID_CW_DRAW], &bbox) != NSERROR_OK) {
+		amiga_warn_user("NoMemory", "");
+		return;
+	}
+
+	*width = bbox->Width;
+	*height = bbox->Height;
+
+	ami_gui_free_space_box(bbox);
+}
+
 
 /**
  * Convert co-ordinates relative to space.gadget
@@ -366,6 +380,41 @@ ami_cw_redraw(struct ami_corewindow *ami_cw, const struct rect *restrict r)
 	ami_schedule(1, ami_cw_redraw_cb, ami_cw);
 }
 
+static void ami_cw_simplerefresh(struct ami_corewindow *ami_cw)
+{
+	struct rect r;
+	struct RegionRectangle *regrect;
+
+	BeginRefresh(ami_cw->win);
+
+	r.x0 = ami_cw->win->RPort->Layer->DamageList->bounds.MinX;
+	r.x1 = ami_cw->win->RPort->Layer->DamageList->bounds.MaxX;
+	r.y0 = ami_cw->win->RPort->Layer->DamageList->bounds.MinY;
+	r.y1 = ami_cw->win->RPort->Layer->DamageList->bounds.MaxY;
+
+	ami_cw_coord_amiga_to_ns(ami_cw, &r.x0, &r.y0);
+	ami_cw_coord_amiga_to_ns(ami_cw, &r.y0, &r.y1);
+
+	regrect = ami_cw->win->RPort->Layer->DamageList->RegionRectangle;
+
+	ami_cw_redraw(ami_cw, &r); /* queue redraw */
+
+	while(regrect) {
+		r.x0 = regrect->bounds.MinX;
+		r.x1 = regrect->bounds.MaxX;
+		r.y0 = regrect->bounds.MinY;
+		r.y1 = regrect->bounds.MaxY;
+		ami_cw_coord_amiga_to_ns(ami_cw, &r.x0, &r.y0);
+		ami_cw_coord_amiga_to_ns(ami_cw, &r.y0, &r.y1);
+
+		regrect = regrect->Next;
+
+		ami_cw_redraw(ami_cw, &r); /* queue redraw */
+	}
+
+	EndRefresh(ami_cw->win, TRUE);
+}
+
 static void
 ami_cw_toggle_scrollbar(struct ami_corewindow *ami_cw, bool vert, bool visible)
 {
@@ -464,6 +513,17 @@ HOOKF(void, ami_cw_idcmp_hook, Object *, object, struct IntuiMessage *)
 			}
 		break;
 #endif
+
+		case IDCMP_SIZEVERIFY:
+		break;
+
+		case IDCMP_REFRESHWINDOW:
+			ami_cw_simplerefresh(ami_cw);
+		break;
+
+		default:
+			LOG("IDCMP hook unhandled event: %ld", msg->Class);
+		break;
 	}
 } 
 
@@ -548,7 +608,7 @@ static void
 ami_cw_newsize(struct ami_corewindow *ami_cw)
 {
 	int win_w, win_h;
-	ami_cw_get_window_dimensions(ami_cw, &win_w, &win_h);
+	ami_cw_window_size(ami_cw, &win_w, &win_h);
 
 	if(ami_cw->objects[GID_CW_HSCROLL] != NULL) {
 		RefreshSetGadgetAttrs((struct Gadget *)ami_cw->objects[GID_CW_HSCROLL], ami_cw->win, NULL,
@@ -750,17 +810,8 @@ static void
 ami_cw_get_window_dimensions(struct core_window *cw, int *width, int *height)
 {
 	struct ami_corewindow *ami_cw = (struct ami_corewindow *)cw;
-	struct IBox *bbox;
 
-	if(ami_gui_get_space_box((Object *)ami_cw->objects[GID_CW_DRAW], &bbox) != NSERROR_OK) {
-		amiga_warn_user("NoMemory", "");
-		return;
-	}
-
-	*width = bbox->Width;
-	*height = bbox->Height;
-
-	ami_gui_free_space_box(bbox);
+	ami_cw_window_size(ami_cw, width, height);
 }
 
 
@@ -770,7 +821,7 @@ ami_cw_update_size(struct core_window *cw, int width, int height)
 	struct ami_corewindow *ami_cw = (struct ami_corewindow *)cw;
 	int win_w, win_h;
 
-	ami_cw_get_window_dimensions((struct core_window *)ami_cw, &win_w, &win_h);
+	ami_cw_window_size(ami_cw, &win_w, &win_h);
 
 	if(width == -1) {
 		ami_cw_toggle_scrollbar(ami_cw, false, false);
@@ -805,7 +856,7 @@ ami_cw_scroll_visible(struct core_window *cw, const struct rect *r)
 	ULONG win_x0, win_y0;
 	int win_x1, win_y1;
 
-	ami_cw_get_window_dimensions((struct core_window *)ami_cw, &win_w, &win_h);
+	ami_cw_window_size(ami_cw, &win_w, &win_h);
 
 	ami_cw_scroller_top(ami_cw, &win_x0, &win_y0);
 
diff --git a/frontends/amiga/gui.c b/frontends/amiga/gui.c
index e27d105..823bbcf 100644
--- a/frontends/amiga/gui.c
+++ b/frontends/amiga/gui.c
@@ -3784,7 +3784,7 @@ HOOKF(void, ami_scroller_hook, Object *, object, struct IntuiMessage *)
 		break;
 
 		default:
-			LOG("IDCMP hook unhandled event: %ld\n", msg->Class);
+			LOG("IDCMP hook unhandled event: %ld", msg->Class);
 		break;
 	}
 //	ReplyMsg((struct Message *)msg);
diff --git a/frontends/amiga/history.c b/frontends/amiga/history.c
index f326f91..b2a3cc0 100644
--- a/frontends/amiga/history.c
+++ b/frontends/amiga/history.c
@@ -360,6 +360,11 @@ static nserror
 ami_history_global_create_window(struct ami_history_global_window *history_win)
 {
 	struct ami_corewindow *ami_cw = (struct ami_corewindow *)&history_win->core;
+	ULONG refresh_mode = WA_SmartRefresh;
+
+	if(nsoption_bool(window_simple_refresh) == true) {
+		refresh_mode = WA_SimpleRefresh;
+	}
 
 	ami_cw->objects[GID_CW_WIN] = WindowObj,
   	    WA_ScreenTitle, ami_gui_get_screen_title(),
@@ -376,11 +381,13 @@ ami_history_global_create_window(struct ami_history_global_window *history_win)
 		WA_Height, nsoption_int(history_window_ysize),
 		WA_PubScreen, scrn,
 		WA_ReportMouse, TRUE,
-       	WA_IDCMP, IDCMP_MOUSEMOVE | IDCMP_MOUSEBUTTONS | IDCMP_NEWSIZE |
+		refresh_mode, TRUE,
+		WA_IDCMP, IDCMP_MOUSEMOVE | IDCMP_MOUSEBUTTONS | IDCMP_NEWSIZE |
 				IDCMP_RAWKEY | IDCMP_GADGETUP | IDCMP_IDCMPUPDATE |
-				IDCMP_EXTENDEDMOUSE | IDCMP_SIZEVERIFY,
+				IDCMP_EXTENDEDMOUSE | IDCMP_SIZEVERIFY | IDCMP_REFRESHWINDOW,
 		WINDOW_IDCMPHook, &ami_cw->idcmp_hook,
-		WINDOW_IDCMPHookBits, IDCMP_IDCMPUPDATE | IDCMP_EXTENDEDMOUSE,
+		WINDOW_IDCMPHookBits, IDCMP_IDCMPUPDATE | IDCMP_EXTENDEDMOUSE |
+				IDCMP_SIZEVERIFY | IDCMP_REFRESHWINDOW,
 		WINDOW_SharedPort, sport,
 		WINDOW_HorizProp, 1,
 		WINDOW_VertProp, 1,
diff --git a/frontends/amiga/hotlist.c b/frontends/amiga/hotlist.c
index a0fd303..8aa181b 100644
--- a/frontends/amiga/hotlist.c
+++ b/frontends/amiga/hotlist.c
@@ -464,6 +464,11 @@ static nserror
 ami_hotlist_create_window(struct ami_hotlist_window *hotlist_win)
 {
 	struct ami_corewindow *ami_cw = (struct ami_corewindow *)&hotlist_win->core;
+	ULONG refresh_mode = WA_SmartRefresh;
+
+	if(nsoption_bool(window_simple_refresh) == true) {
+		refresh_mode = WA_SimpleRefresh;
+	}
 
 	ami_cw->objects[GID_CW_WIN] = WindowObj,
   	    WA_ScreenTitle, ami_gui_get_screen_title(),
@@ -480,11 +485,13 @@ ami_hotlist_create_window(struct ami_hotlist_window *hotlist_win)
 		WA_Height, nsoption_int(hotlist_window_ysize),
 		WA_PubScreen, scrn,
 		WA_ReportMouse, TRUE,
-       	WA_IDCMP, IDCMP_MOUSEMOVE | IDCMP_MOUSEBUTTONS | IDCMP_NEWSIZE |
+		refresh_mode, TRUE,
+		WA_IDCMP, IDCMP_MOUSEMOVE | IDCMP_MOUSEBUTTONS | IDCMP_NEWSIZE |
 				IDCMP_RAWKEY | IDCMP_GADGETUP | IDCMP_IDCMPUPDATE |
-				IDCMP_EXTENDEDMOUSE | IDCMP_SIZEVERIFY,
+				IDCMP_EXTENDEDMOUSE | IDCMP_SIZEVERIFY | IDCMP_REFRESHWINDOW,
 		WINDOW_IDCMPHook, &ami_cw->idcmp_hook,
-		WINDOW_IDCMPHookBits, IDCMP_IDCMPUPDATE | IDCMP_EXTENDEDMOUSE,
+		WINDOW_IDCMPHookBits, IDCMP_IDCMPUPDATE | IDCMP_EXTENDEDMOUSE |
+				IDCMP_SIZEVERIFY | IDCMP_REFRESHWINDOW,
 		WINDOW_SharedPort, sport,
 		WINDOW_HorizProp, 1,
 		WINDOW_VertProp, 1,
diff --git a/frontends/amiga/sslcert.c b/frontends/amiga/sslcert.c
index 2cb3d8e..5929f7e 100644
--- a/frontends/amiga/sslcert.c
+++ b/frontends/amiga/sslcert.c
@@ -41,6 +41,7 @@
 #include "netsurf/plotters.h"
 #include "desktop/sslcert_viewer.h"
 #include "utils/messages.h"
+#include "utils/nsoption.h"
 
 #include "amiga/corewindow.h"
 #include "amiga/libs.h"
@@ -214,6 +215,11 @@ static nserror
 ami_crtvrfy_create_window(struct ami_crtvrfy_window *crtvrfy_win)
 {
 	struct ami_corewindow *ami_cw = (struct ami_corewindow *)&crtvrfy_win->core;
+	ULONG refresh_mode = WA_SmartRefresh;
+
+	if(nsoption_bool(window_simple_refresh) == true) {
+		refresh_mode = WA_SimpleRefresh;
+	}
 
 	ami_cw->objects[GID_CW_WIN] = WindowObj,
   	    WA_ScreenTitle, ami_gui_get_screen_title(),
@@ -227,11 +233,13 @@ ami_crtvrfy_create_window(struct ami_crtvrfy_window *crtvrfy_win)
 		WA_Height, scrn->Height / 2,
 		WA_PubScreen, scrn,
 		WA_ReportMouse, TRUE,
-       	WA_IDCMP, IDCMP_MOUSEMOVE | IDCMP_MOUSEBUTTONS | IDCMP_NEWSIZE |
+		refresh_mode, TRUE,
+		WA_IDCMP, IDCMP_MOUSEMOVE | IDCMP_MOUSEBUTTONS | IDCMP_NEWSIZE |
 				IDCMP_RAWKEY | IDCMP_GADGETUP | IDCMP_IDCMPUPDATE |
-				IDCMP_EXTENDEDMOUSE | IDCMP_SIZEVERIFY,
+				IDCMP_EXTENDEDMOUSE | IDCMP_SIZEVERIFY | IDCMP_REFRESHWINDOW,
 		WINDOW_IDCMPHook, &ami_cw->idcmp_hook,
-		WINDOW_IDCMPHookBits, IDCMP_IDCMPUPDATE | IDCMP_EXTENDEDMOUSE,
+		WINDOW_IDCMPHookBits, IDCMP_IDCMPUPDATE | IDCMP_EXTENDEDMOUSE |
+				IDCMP_SIZEVERIFY | IDCMP_REFRESHWINDOW,
 		WINDOW_SharedPort, sport,
 		WINDOW_UserData, crtvrfy_win,
 		/* WINDOW_NewMenu, twin->menu,   -> No menu for SSL Cert */


commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=05e4463230d8ae9880ac3aef38ca12f09d30d960
commit 05e4463230d8ae9880ac3aef38ca12f09d30d960
Author: Chris Young <chris at unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris at unsatisfactorysoftware.co.uk>

    Update corewindow scrollbars when user resizes window

diff --git a/frontends/amiga/corewindow.c b/frontends/amiga/corewindow.c
index 548ecac..2417d7b 100644
--- a/frontends/amiga/corewindow.c
+++ b/frontends/amiga/corewindow.c
@@ -66,6 +66,8 @@
 #include "amiga/schedule.h"
 #include "amiga/utf8.h"
 
+static void ami_cw_get_window_dimensions(struct core_window *cw, int *width, int *height);
+
 static void
 ami_cw_scroller_top(struct ami_corewindow *ami_cw, ULONG *restrict x, ULONG *restrict y)
 {
@@ -539,6 +541,31 @@ ami_cw_drag_end(struct ami_corewindow *ami_cw, int x, int y)
 }
 
 /**
+ * User has resized window
+ */
+
+static void
+ami_cw_newsize(struct ami_corewindow *ami_cw)
+{
+	int win_w, win_h;
+	ami_cw_get_window_dimensions(ami_cw, &win_w, &win_h);
+
+	if(ami_cw->objects[GID_CW_HSCROLL] != NULL) {
+		RefreshSetGadgetAttrs((struct Gadget *)ami_cw->objects[GID_CW_HSCROLL], ami_cw->win, NULL,
+			SCROLLER_Visible, win_w,
+		TAG_DONE);
+	}	
+
+	if(ami_cw->objects[GID_CW_VSCROLL] != NULL) {
+		RefreshSetGadgetAttrs((struct Gadget *)ami_cw->objects[GID_CW_VSCROLL], ami_cw->win, NULL,
+			SCROLLER_Visible, win_h,
+		TAG_DONE);
+	}
+
+	ami_cw_redraw(ami_cw, NULL);
+}
+
+/**
  * Main event loop for our core window
  *
  * \return TRUE if window destroyed
@@ -681,7 +708,7 @@ ami_cw_event(void *w)
 			break;
 
 			case WMHI_NEWSIZE:
-				ami_cw_redraw(ami_cw, NULL);
+				ami_cw_newsize(ami_cw);
 			break;
 
 			case WMHI_CLOSEWINDOW:


-----------------------------------------------------------------------

Summary of changes:
 frontends/amiga/cookies.c    |   13 ++++--
 frontends/amiga/corewindow.c |  104 ++++++++++++++++++++++++++++++++++++------
 frontends/amiga/gui.c        |    2 +-
 frontends/amiga/history.c    |   13 ++++--
 frontends/amiga/hotlist.c    |   13 ++++--
 frontends/amiga/sslcert.c    |   14 ++++--
 6 files changed, 133 insertions(+), 26 deletions(-)

diff --git a/frontends/amiga/cookies.c b/frontends/amiga/cookies.c
index f428881..74c89cb 100644
--- a/frontends/amiga/cookies.c
+++ b/frontends/amiga/cookies.c
@@ -288,6 +288,11 @@ static nserror
 ami_cookies_create_window(struct ami_cookie_window *cookie_win)
 {
 	struct ami_corewindow *ami_cw = (struct ami_corewindow *)&cookie_win->core;
+	ULONG refresh_mode = WA_SmartRefresh;
+
+	if(nsoption_bool(window_simple_refresh) == true) {
+		refresh_mode = WA_SimpleRefresh;
+	}
 
 	ami_cw->objects[GID_CW_WIN] = WindowObj,
   	    WA_ScreenTitle, ami_gui_get_screen_title(),
@@ -304,11 +309,13 @@ ami_cookies_create_window(struct ami_cookie_window *cookie_win)
 		WA_Height, nsoption_int(cookies_window_ysize),
 		WA_PubScreen, scrn,
 		WA_ReportMouse, TRUE,
-       	WA_IDCMP, IDCMP_MOUSEMOVE | IDCMP_MOUSEBUTTONS | IDCMP_NEWSIZE |
+		refresh_mode, TRUE,
+		WA_IDCMP, IDCMP_MOUSEMOVE | IDCMP_MOUSEBUTTONS | IDCMP_NEWSIZE |
 				IDCMP_RAWKEY | IDCMP_GADGETUP | IDCMP_IDCMPUPDATE |
-				IDCMP_EXTENDEDMOUSE | IDCMP_SIZEVERIFY,
+				IDCMP_EXTENDEDMOUSE | IDCMP_SIZEVERIFY | IDCMP_REFRESHWINDOW,
 		WINDOW_IDCMPHook, &ami_cw->idcmp_hook,
-		WINDOW_IDCMPHookBits, IDCMP_IDCMPUPDATE | IDCMP_EXTENDEDMOUSE,
+		WINDOW_IDCMPHookBits, IDCMP_IDCMPUPDATE | IDCMP_EXTENDEDMOUSE |
+				IDCMP_SIZEVERIFY | IDCMP_REFRESHWINDOW,
 		WINDOW_SharedPort, sport,
 		WINDOW_HorizProp, 1,
 		WINDOW_VertProp, 1,
diff --git a/frontends/amiga/corewindow.c b/frontends/amiga/corewindow.c
index 548ecac..d2bfbf9 100644
--- a/frontends/amiga/corewindow.c
+++ b/frontends/amiga/corewindow.c
@@ -84,6 +84,22 @@ ami_cw_scroller_top(struct ami_corewindow *ami_cw, ULONG *restrict x, ULONG *res
 	*y = ys;
 }
 
+static void
+ami_cw_window_size(struct ami_corewindow *ami_cw, int *width, int *height)
+{
+	struct IBox *bbox;
+
+	if(ami_gui_get_space_box((Object *)ami_cw->objects[GID_CW_DRAW], &bbox) != NSERROR_OK) {
+		amiga_warn_user("NoMemory", "");
+		return;
+	}
+
+	*width = bbox->Width;
+	*height = bbox->Height;
+
+	ami_gui_free_space_box(bbox);
+}
+
 
 /**
  * Convert co-ordinates relative to space.gadget
@@ -364,6 +380,41 @@ ami_cw_redraw(struct ami_corewindow *ami_cw, const struct rect *restrict r)
 	ami_schedule(1, ami_cw_redraw_cb, ami_cw);
 }
 
+static void ami_cw_simplerefresh(struct ami_corewindow *ami_cw)
+{
+	struct rect r;
+	struct RegionRectangle *regrect;
+
+	BeginRefresh(ami_cw->win);
+
+	r.x0 = ami_cw->win->RPort->Layer->DamageList->bounds.MinX;
+	r.x1 = ami_cw->win->RPort->Layer->DamageList->bounds.MaxX;
+	r.y0 = ami_cw->win->RPort->Layer->DamageList->bounds.MinY;
+	r.y1 = ami_cw->win->RPort->Layer->DamageList->bounds.MaxY;
+
+	ami_cw_coord_amiga_to_ns(ami_cw, &r.x0, &r.y0);
+	ami_cw_coord_amiga_to_ns(ami_cw, &r.y0, &r.y1);
+
+	regrect = ami_cw->win->RPort->Layer->DamageList->RegionRectangle;
+
+	ami_cw_redraw(ami_cw, &r); /* queue redraw */
+
+	while(regrect) {
+		r.x0 = regrect->bounds.MinX;
+		r.x1 = regrect->bounds.MaxX;
+		r.y0 = regrect->bounds.MinY;
+		r.y1 = regrect->bounds.MaxY;
+		ami_cw_coord_amiga_to_ns(ami_cw, &r.x0, &r.y0);
+		ami_cw_coord_amiga_to_ns(ami_cw, &r.y0, &r.y1);
+
+		regrect = regrect->Next;
+
+		ami_cw_redraw(ami_cw, &r); /* queue redraw */
+	}
+
+	EndRefresh(ami_cw->win, TRUE);
+}
+
 static void
 ami_cw_toggle_scrollbar(struct ami_corewindow *ami_cw, bool vert, bool visible)
 {
@@ -462,6 +513,17 @@ HOOKF(void, ami_cw_idcmp_hook, Object *, object, struct IntuiMessage *)
 			}
 		break;
 #endif
+
+		case IDCMP_SIZEVERIFY:
+		break;
+
+		case IDCMP_REFRESHWINDOW:
+			ami_cw_simplerefresh(ami_cw);
+		break;
+
+		default:
+			LOG("IDCMP hook unhandled event: %ld", msg->Class);
+		break;
 	}
 } 
 
@@ -539,6 +601,31 @@ ami_cw_drag_end(struct ami_corewindow *ami_cw, int x, int y)
 }
 
 /**
+ * User has resized window
+ */
+
+static void
+ami_cw_newsize(struct ami_corewindow *ami_cw)
+{
+	int win_w, win_h;
+	ami_cw_window_size(ami_cw, &win_w, &win_h);
+
+	if(ami_cw->objects[GID_CW_HSCROLL] != NULL) {
+		RefreshSetGadgetAttrs((struct Gadget *)ami_cw->objects[GID_CW_HSCROLL], ami_cw->win, NULL,
+			SCROLLER_Visible, win_w,
+		TAG_DONE);
+	}	
+
+	if(ami_cw->objects[GID_CW_VSCROLL] != NULL) {
+		RefreshSetGadgetAttrs((struct Gadget *)ami_cw->objects[GID_CW_VSCROLL], ami_cw->win, NULL,
+			SCROLLER_Visible, win_h,
+		TAG_DONE);
+	}
+
+	ami_cw_redraw(ami_cw, NULL);
+}
+
+/**
  * Main event loop for our core window
  *
  * \return TRUE if window destroyed
@@ -681,7 +768,7 @@ ami_cw_event(void *w)
 			break;
 
 			case WMHI_NEWSIZE:
-				ami_cw_redraw(ami_cw, NULL);
+				ami_cw_newsize(ami_cw);
 			break;
 
 			case WMHI_CLOSEWINDOW:
@@ -723,17 +810,8 @@ static void
 ami_cw_get_window_dimensions(struct core_window *cw, int *width, int *height)
 {
 	struct ami_corewindow *ami_cw = (struct ami_corewindow *)cw;
-	struct IBox *bbox;
 
-	if(ami_gui_get_space_box((Object *)ami_cw->objects[GID_CW_DRAW], &bbox) != NSERROR_OK) {
-		amiga_warn_user("NoMemory", "");
-		return;
-	}
-
-	*width = bbox->Width;
-	*height = bbox->Height;
-
-	ami_gui_free_space_box(bbox);
+	ami_cw_window_size(ami_cw, width, height);
 }
 
 
@@ -743,7 +821,7 @@ ami_cw_update_size(struct core_window *cw, int width, int height)
 	struct ami_corewindow *ami_cw = (struct ami_corewindow *)cw;
 	int win_w, win_h;
 
-	ami_cw_get_window_dimensions((struct core_window *)ami_cw, &win_w, &win_h);
+	ami_cw_window_size(ami_cw, &win_w, &win_h);
 
 	if(width == -1) {
 		ami_cw_toggle_scrollbar(ami_cw, false, false);
@@ -778,7 +856,7 @@ ami_cw_scroll_visible(struct core_window *cw, const struct rect *r)
 	ULONG win_x0, win_y0;
 	int win_x1, win_y1;
 
-	ami_cw_get_window_dimensions((struct core_window *)ami_cw, &win_w, &win_h);
+	ami_cw_window_size(ami_cw, &win_w, &win_h);
 
 	ami_cw_scroller_top(ami_cw, &win_x0, &win_y0);
 
diff --git a/frontends/amiga/gui.c b/frontends/amiga/gui.c
index e27d105..823bbcf 100644
--- a/frontends/amiga/gui.c
+++ b/frontends/amiga/gui.c
@@ -3784,7 +3784,7 @@ HOOKF(void, ami_scroller_hook, Object *, object, struct IntuiMessage *)
 		break;
 
 		default:
-			LOG("IDCMP hook unhandled event: %ld\n", msg->Class);
+			LOG("IDCMP hook unhandled event: %ld", msg->Class);
 		break;
 	}
 //	ReplyMsg((struct Message *)msg);
diff --git a/frontends/amiga/history.c b/frontends/amiga/history.c
index f326f91..b2a3cc0 100644
--- a/frontends/amiga/history.c
+++ b/frontends/amiga/history.c
@@ -360,6 +360,11 @@ static nserror
 ami_history_global_create_window(struct ami_history_global_window *history_win)
 {
 	struct ami_corewindow *ami_cw = (struct ami_corewindow *)&history_win->core;
+	ULONG refresh_mode = WA_SmartRefresh;
+
+	if(nsoption_bool(window_simple_refresh) == true) {
+		refresh_mode = WA_SimpleRefresh;
+	}
 
 	ami_cw->objects[GID_CW_WIN] = WindowObj,
   	    WA_ScreenTitle, ami_gui_get_screen_title(),
@@ -376,11 +381,13 @@ ami_history_global_create_window(struct ami_history_global_window *history_win)
 		WA_Height, nsoption_int(history_window_ysize),
 		WA_PubScreen, scrn,
 		WA_ReportMouse, TRUE,
-       	WA_IDCMP, IDCMP_MOUSEMOVE | IDCMP_MOUSEBUTTONS | IDCMP_NEWSIZE |
+		refresh_mode, TRUE,
+		WA_IDCMP, IDCMP_MOUSEMOVE | IDCMP_MOUSEBUTTONS | IDCMP_NEWSIZE |
 				IDCMP_RAWKEY | IDCMP_GADGETUP | IDCMP_IDCMPUPDATE |
-				IDCMP_EXTENDEDMOUSE | IDCMP_SIZEVERIFY,
+				IDCMP_EXTENDEDMOUSE | IDCMP_SIZEVERIFY | IDCMP_REFRESHWINDOW,
 		WINDOW_IDCMPHook, &ami_cw->idcmp_hook,
-		WINDOW_IDCMPHookBits, IDCMP_IDCMPUPDATE | IDCMP_EXTENDEDMOUSE,
+		WINDOW_IDCMPHookBits, IDCMP_IDCMPUPDATE | IDCMP_EXTENDEDMOUSE |
+				IDCMP_SIZEVERIFY | IDCMP_REFRESHWINDOW,
 		WINDOW_SharedPort, sport,
 		WINDOW_HorizProp, 1,
 		WINDOW_VertProp, 1,
diff --git a/frontends/amiga/hotlist.c b/frontends/amiga/hotlist.c
index a0fd303..8aa181b 100644
--- a/frontends/amiga/hotlist.c
+++ b/frontends/amiga/hotlist.c
@@ -464,6 +464,11 @@ static nserror
 ami_hotlist_create_window(struct ami_hotlist_window *hotlist_win)
 {
 	struct ami_corewindow *ami_cw = (struct ami_corewindow *)&hotlist_win->core;
+	ULONG refresh_mode = WA_SmartRefresh;
+
+	if(nsoption_bool(window_simple_refresh) == true) {
+		refresh_mode = WA_SimpleRefresh;
+	}
 
 	ami_cw->objects[GID_CW_WIN] = WindowObj,
   	    WA_ScreenTitle, ami_gui_get_screen_title(),
@@ -480,11 +485,13 @@ ami_hotlist_create_window(struct ami_hotlist_window *hotlist_win)
 		WA_Height, nsoption_int(hotlist_window_ysize),
 		WA_PubScreen, scrn,
 		WA_ReportMouse, TRUE,
-       	WA_IDCMP, IDCMP_MOUSEMOVE | IDCMP_MOUSEBUTTONS | IDCMP_NEWSIZE |
+		refresh_mode, TRUE,
+		WA_IDCMP, IDCMP_MOUSEMOVE | IDCMP_MOUSEBUTTONS | IDCMP_NEWSIZE |
 				IDCMP_RAWKEY | IDCMP_GADGETUP | IDCMP_IDCMPUPDATE |
-				IDCMP_EXTENDEDMOUSE | IDCMP_SIZEVERIFY,
+				IDCMP_EXTENDEDMOUSE | IDCMP_SIZEVERIFY | IDCMP_REFRESHWINDOW,
 		WINDOW_IDCMPHook, &ami_cw->idcmp_hook,
-		WINDOW_IDCMPHookBits, IDCMP_IDCMPUPDATE | IDCMP_EXTENDEDMOUSE,
+		WINDOW_IDCMPHookBits, IDCMP_IDCMPUPDATE | IDCMP_EXTENDEDMOUSE |
+				IDCMP_SIZEVERIFY | IDCMP_REFRESHWINDOW,
 		WINDOW_SharedPort, sport,
 		WINDOW_HorizProp, 1,
 		WINDOW_VertProp, 1,
diff --git a/frontends/amiga/sslcert.c b/frontends/amiga/sslcert.c
index 2cb3d8e..5929f7e 100644
--- a/frontends/amiga/sslcert.c
+++ b/frontends/amiga/sslcert.c
@@ -41,6 +41,7 @@
 #include "netsurf/plotters.h"
 #include "desktop/sslcert_viewer.h"
 #include "utils/messages.h"
+#include "utils/nsoption.h"
 
 #include "amiga/corewindow.h"
 #include "amiga/libs.h"
@@ -214,6 +215,11 @@ static nserror
 ami_crtvrfy_create_window(struct ami_crtvrfy_window *crtvrfy_win)
 {
 	struct ami_corewindow *ami_cw = (struct ami_corewindow *)&crtvrfy_win->core;
+	ULONG refresh_mode = WA_SmartRefresh;
+
+	if(nsoption_bool(window_simple_refresh) == true) {
+		refresh_mode = WA_SimpleRefresh;
+	}
 
 	ami_cw->objects[GID_CW_WIN] = WindowObj,
   	    WA_ScreenTitle, ami_gui_get_screen_title(),
@@ -227,11 +233,13 @@ ami_crtvrfy_create_window(struct ami_crtvrfy_window *crtvrfy_win)
 		WA_Height, scrn->Height / 2,
 		WA_PubScreen, scrn,
 		WA_ReportMouse, TRUE,
-       	WA_IDCMP, IDCMP_MOUSEMOVE | IDCMP_MOUSEBUTTONS | IDCMP_NEWSIZE |
+		refresh_mode, TRUE,
+		WA_IDCMP, IDCMP_MOUSEMOVE | IDCMP_MOUSEBUTTONS | IDCMP_NEWSIZE |
 				IDCMP_RAWKEY | IDCMP_GADGETUP | IDCMP_IDCMPUPDATE |
-				IDCMP_EXTENDEDMOUSE | IDCMP_SIZEVERIFY,
+				IDCMP_EXTENDEDMOUSE | IDCMP_SIZEVERIFY | IDCMP_REFRESHWINDOW,
 		WINDOW_IDCMPHook, &ami_cw->idcmp_hook,
-		WINDOW_IDCMPHookBits, IDCMP_IDCMPUPDATE | IDCMP_EXTENDEDMOUSE,
+		WINDOW_IDCMPHookBits, IDCMP_IDCMPUPDATE | IDCMP_EXTENDEDMOUSE |
+				IDCMP_SIZEVERIFY | IDCMP_REFRESHWINDOW,
 		WINDOW_SharedPort, sport,
 		WINDOW_UserData, crtvrfy_win,
 		/* WINDOW_NewMenu, twin->menu,   -> No menu for SSL Cert */


-- 
NetSurf Browser



More information about the netsurf-commits mailing list