The buffer in the titlebar was small and the file path was truncated. Therefore, the buffer in the titlebar was expanded from 51 to 300.
From: 3ts75 bimy1280163@gn.iwasaki.ac.jp
--- programs/winhlp32/hlpfile.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/programs/winhlp32/hlpfile.h b/programs/winhlp32/hlpfile.h index 55ef681edd8..1ed8e65f5e0 100644 --- a/programs/winhlp32/hlpfile.h +++ b/programs/winhlp32/hlpfile.h @@ -26,7 +26,7 @@ typedef struct { char type[10]; char name[9]; - char caption[51]; + char caption[300]; POINT origin; SIZE size; int style;
Did you check what windows does it that case (with the .hlp file you're referring to)? - display whole string ? - truncate to filename only - truncate partial path & filename only? Anyway, the 51 size comes from the .hlp internal data structure, and IMO shouldn't be changed as such. Either Windows displays the whole path in that case and we'd better use a dynamic allocated buffer ; or the path is somehow truncated.
Win2K3 : does not show file title at all : ![image](/uploads/feb18faddc1769bc68c2ee8c72f2a6c9/image.png)
Maybe a better option would be NOT to display file path at all ?
@epo : since @3ts75 is not longer active, any opportunity that you take over with the proposed simplification (eg : no file path in title bar, similarly to Win2K3 behavior) ?
In particular situation made even worse by https://github.com/wine-mirror/wine/commit/6cd7240fec06829e73f240104f6e690b7... from @julliard limiting buffer to 40 chars.
[the patch you mention doesn't make it worse, it just reduces the size of the STID_WINE_HELP resource which should fit in 40 char:s AFAICS from po files]
there are .hlp files which caption is still in the form 'title help - filename'
when in that form, only the filename part is displayed (drive and directories are dropped)
(2 out of 78 in my local store). reason isn't 100% clear (even if the two report an error 'buf[0x14] = 0' which an entry which isn't implemented yet; but 2 is to few to be able to generalize). We need to figure out whether it just shows incorrect encoding (and the title derives from that), or something else
last but not least, I have also (1) .hlp file where the title isn't cropped to 51 characters
so IMO, it will require more work
perhaps first and simple step would be to remove driver and directories from displayed filename:
* that would be one step into the right direction * it will reduce the not useful information (even if not perfect)
Strangely enougth, using Wine 8.0.2 in Ubuntu, the code path used is then the second branch, not even showing the title : ![image](/uploads/62cd3b0249def640ae800103ffd10806/image.png) [GNUCHESS.HLP](/uploads/2e29088670b97d2df88f1dce3b19aa51/GNUCHESS.HLP)
I've opened https://gitlab.winehq.org/wine/wine/-/merge_requests/4758 which should fix most of the issues I'm aware of (compared with win98's native winhlp32.exe behavior)
@epo : Then this MR should be closed and marked superseeded by https://gitlab.winehq.org/wine/wine/-/merge_requests/4758 ?
This merge request was closed by Alexandre Julliard.
Superseded by !4758.