summaryrefslogtreecommitdiff
path: root/windows
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2015-03-15 00:00:45 +0000
committerVincent Sanders <vince@kyllikki.org>2015-03-15 00:00:45 +0000
commit8a99b045bc48e0c5eb89129ea8ee034c72b955de (patch)
treef2dabbca020b91b41ab3f476fca1ed2378f8ced2 /windows
parent52b50db3a6f1d52b3c9e18b36121f487c09de906 (diff)
downloadnetsurf-8a99b045bc48e0c5eb89129ea8ee034c72b955de.tar.gz
netsurf-8a99b045bc48e0c5eb89129ea8ee034c72b955de.tar.bz2
Remove url from content thumbnailers API
The content thumbnailers for each frontend were being provided the contents url. This was only ever used to call the urldb thumbnail setting API. This changes it so the single callsite that passed a valid url adds the bitmap to that url itself in desktop_history.c instead of forcing every frontend to require the urldb API. Additionally the old API could pass the url as NULL which was causing asserts where this was not an expected parameter value. Because of this this fixes bug #2286 which was also present in the monkey frontend as both called nsurl_access() on the url without the NULL check and caused an assertion.
Diffstat (limited to 'windows')
-rw-r--r--windows/gui.c2
-rw-r--r--windows/main.c2
-rw-r--r--windows/thumbnail.c16
3 files changed, 8 insertions, 12 deletions
diff --git a/windows/gui.c b/windows/gui.c
index 408cd49d4..0df219002 100644
--- a/windows/gui.c
+++ b/windows/gui.c
@@ -56,6 +56,8 @@ void win32_run(void)
int timeout; /* timeout in miliseconds */
UINT timer_id = 0;
+ LOG(("Starting messgae dispatcher"));
+
while (!win32_quit) {
/* run the scheduler and discover how long to wait for
* the next event.
diff --git a/windows/main.c b/windows/main.c
index c762c52db..c5bb240fc 100644
--- a/windows/main.c
+++ b/windows/main.c
@@ -109,7 +109,7 @@ static struct gui_browser_table win32_browser_table = {
/**
- * Entry point from operating system
+ * Entry point from windows
**/
int WINAPI
WinMain(HINSTANCE hInstance, HINSTANCE hLastInstance, LPSTR lpcli, int ncmd)
diff --git a/windows/thumbnail.c b/windows/thumbnail.c
index c4ef63c43..1fee8ccf1 100644
--- a/windows/thumbnail.c
+++ b/windows/thumbnail.c
@@ -20,10 +20,9 @@
#include <windows.h>
-#include "content/urldb.h"
+#include "utils/log.h"
#include "desktop/browser.h"
#include "desktop/thumbnail.h"
-#include "utils/log.h"
#include "image/bitmap.h"
#include "windows/bitmap.h"
@@ -34,26 +33,24 @@
bool
thumbnail_create(hlcache_handle *content,
- struct bitmap *bitmap,
- nsurl *url)
+ struct bitmap *bitmap)
{
int width;
int height;
HDC hdc, bufferdc, minidc;
+ struct bitmap *fsbitmap;
struct redraw_context ctx = {
.interactive = false,
.background_images = true,
.plot = &win_plotters
};
- struct bitmap *fsbitmap;
-
width = min(content_get_width(content), 1024);
height = ((width * bitmap->height) + (bitmap->width / 2)) /
bitmap->width;
- LOG(("bitmap %p for url %s content %p width %d, height %d",
- bitmap, nsurl_access(url), content, width, height));
+ LOG(("bitmap %p for content %p width %d, height %d",
+ bitmap, content, width, height));
/* create two memory device contexts to put the bitmaps in */
bufferdc = CreateCompatibleDC(NULL);
@@ -87,9 +84,6 @@ thumbnail_create(hlcache_handle *content,
DeleteDC(bufferdc);
DeleteDC(minidc);
bitmap_destroy(fsbitmap);
-
- if (url)
- urldb_set_thumbnail(url, bitmap);
return true;
}