In platform/graphics/gtk/ImageGtk.cpp, the position of the icon is computer like this: fileName = String::format("%s/webkit-1.0/images/%s.png", DATA_DIR, name).utf8()
This assumes that the runtime prefix will be identical to the configure-time prefix, which is not to be assumed on windows. The generic solution for this problem would be to simply get by win32 api call the position of the libwebkit*.dll at runtime and compute the position from this information. Something like:
#ifdef _WIN32
# include <shlobj.h>
# include <mbstring.h>
/* search for data relative to where we are installed */
static HMODULE hmodule;
#ifdef __cplusplus
extern "C" {
#endif
BOOL WINAPI
DllMain (HINSTANCE hinstDLL,
DWORD fdwReason,
LPVOID lpvReserved)
{
switch (fdwReason)
{
case DLL_PROCESS_ATTACH:
hmodule = hinstDLL;
break;
}
return TRUE;
}
#ifdef __cplusplus
}
#endif
static char *
get_webkit_datadir (void)
{
static char retval[1000];
static int beenhere = 0;
unsigned char *p;
if (beenhere)
return retval;
if (!GetModuleFileName (hmodule, (CHAR *) retval, sizeof(retval) - 10))
return DATA_DIR;
p = _mbsrchr ((const unsigned char *) retval, '\\');
*p = '\0';
p = _mbsrchr ((const unsigned char *) retval, '\\');
if (p) {
if (stricmp ((const char *) (p+1), "bin") == 0)
*p = '\0';
}
strcat (retval, "\\share");
beenhere = 1;
return retval;
}
#undef DATA_DIR
#define DATA_DIR get_webkit_datadir ()
#endif
which should work for the ImageGtk.cpp file. Although a more general solution in line with what we are doing in evolution could be provided if we expect this problem not to be an isolated one:
Created attachment 49887 [details]
Patch doing what was described before
Created attachment 50013 [details]
Patch that does what the previous one, but does not leak memory.
Created attachment 50027 [details]
Patch modified not to use String::format
Comment on attachment 50027 [details]
Patch modified not to use String::format
I don't know if that is the best thing to do, but it seems to make sense and it has no impact on UNIX for WebKitGTK+ and we don't seem to leak memory.
> +static char *
> +get_webkit_datadir(void)
I think this is a small style violation, but I see that we copy the code from other places.
Comment on attachment 50027 [details]
Patch modified not to use String::format
Clearing flags on attachment: 50027
Committed r55531: <>
All reviewed patches have been landed. Closing bug.
Created attachment 50033 [details]
Patch fixing a forgetful mind
Comment on attachment 50033 [details]
Patch fixing a forgetful mind
ooops.
reopening so that it can land
Comment on attachment 50033 [details]
Patch fixing a forgetful mind
Rejecting patch 50033 from commit-queue.
Failed to run "['/Users/eseidel/Projects/CommitQueue/WebKitTools/Scripts/svn-apply', '--reviewer', 'Holger Freyther', '--force']" exit_code: 1
patching file WebCore/ChangeLog
Hunk #1 succeeded at 1 with fuzz 3.
patching file WebCore/platform/graphics/gtk/ImageGtk.cpp
Hunk #1 FAILED at 159.
1 out of 1 hunk FAILED -- saving rejects to file WebCore/platform/graphics/gtk/ImageGtk.cpp.rej
Full output:
Looks like this patch will need an update.
The fix landed as a part of other patch, closing this bug