WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
32711
[gtk] Make paths relocatable on runtime
https://bugs.webkit.org/show_bug.cgi?id=32711
Summary
[gtk] Make paths relocatable on runtime
Fridrich Strba
Reported
2009-12-18 06:18:38 PST
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:
http://git.gnome.org/cgit/evolution/tree/e-util/e-win32-reloc.c
Attachments
Patch doing what was described before
(2.50 KB, patch)
2010-03-03 01:45 PST
,
Fridrich Strba
no flags
Details
Formatted Diff
Diff
Patch that does what the previous one, but does not leak memory.
(2.73 KB, patch)
2010-03-04 07:11 PST
,
Fridrich Strba
no flags
Details
Formatted Diff
Diff
Patch modified not to use String::format
(2.72 KB, patch)
2010-03-04 08:23 PST
,
Fridrich Strba
no flags
Details
Formatted Diff
Diff
Patch fixing a forgetful mind
(1.20 KB, patch)
2010-03-04 10:13 PST
,
Fridrich Strba
no flags
Details
Formatted Diff
Diff
Show Obsolete
(4)
View All
Add attachment
proposed patch, testcase, etc.
Fridrich Strba
Comment 1
2010-03-03 01:45:31 PST
Created
attachment 49887
[details]
Patch doing what was described before
Fridrich Strba
Comment 2
2010-03-04 07:11:36 PST
Created
attachment 50013
[details]
Patch that does what the previous one, but does not leak memory.
Fridrich Strba
Comment 3
2010-03-04 08:23:49 PST
Created
attachment 50027
[details]
Patch modified not to use String::format
Holger Freyther
Comment 4
2010-03-04 09:10:10 PST
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.
WebKit Commit Bot
Comment 5
2010-03-04 10:00:17 PST
Comment on
attachment 50027
[details]
Patch modified not to use String::format Clearing flags on attachment: 50027 Committed
r55531
: <
http://trac.webkit.org/changeset/55531
>
WebKit Commit Bot
Comment 6
2010-03-04 10:00:22 PST
All reviewed patches have been landed. Closing bug.
Fridrich Strba
Comment 7
2010-03-04 10:13:44 PST
Created
attachment 50033
[details]
Patch fixing a forgetful mind
Holger Freyther
Comment 8
2010-03-04 10:18:15 PST
Comment on
attachment 50033
[details]
Patch fixing a forgetful mind ooops.
Fridrich Strba
Comment 9
2010-03-04 10:21:04 PST
reopening so that it can land
WebKit Commit Bot
Comment 10
2010-03-04 11:39:17 PST
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:
http://webkit-commit-queue.appspot.com/results/331689
Eric Seidel (no email)
Comment 11
2010-03-05 14:38:52 PST
Looks like this patch will need an update.
Fridrich Strba
Comment 12
2010-03-05 14:40:09 PST
The fix landed as a part of other patch, closing this bug
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug