CFile: avoid 'Assert failure' if IsOpened() is false inside doSeek - #294
Merged
Conversation
mrjimenez
pushed a commit
to mrjimenez/amule
that referenced
this pull request
Jul 4, 2026
) * fix(gui): scale main-toolbar icons on hi-DPI displays The toolbar icons (Downloads, Shared Files, etc.) were stored in a fixed 32x32 wxImageList and handed to wxToolBar as plain wxBitmaps. Since the executable declares PerMonitorV2 DPI awareness (amule-project#780), those bitmaps are drawn at 32 *physical* pixels, so on 4K / scaled displays the icons render tiny and blurry while the rest of the UI scales. Store each toolbar icon as a wxBitmapBundle instead (wx >= 3.2), built from the original 32px art plus a wxIMAGE_QUALITY_HIGH 2x upscale, converting the transparency mask to an alpha channel first so the scaler doesn't smear the mask colour into the icon edges. Drop the hard-coded SetToolBitmapSize(32,32) so the toolbar derives the logical size from the bundles and scales it per monitor DPI. SetMessagesTool gains a bounds guard because m_CurrentBlinkBitmap starts as a stale sentinel (24) that the old wxImageList::GetBitmap tolerated but vector indexing must not. Co-Authored-By: Claude Fable 5 <[email protected]> * refactor(gui): name toolbar icon indexes and drop dead code after review Code-review follow-ups to the wxBitmapBundle toolbar change: - Add ToolbarSkinEnum (mirroring ClientSkinEnum) so the m_tblist indexes duplicated across Apply_Toolbar_Skin, ShowConnectionState, OnGUITimer and the constructor are named instead of magic numbers whose meaning depends on the Add_Skin_Icon call order. - Initialize m_CurrentBlinkBitmap to Toolbar_Messages instead of the stale sentinel 24 (a fossil amuleDlgImages() resource id, never a valid m_tblist index) and drop the SetMessagesTool bounds guard that existed only to defend against it; both callers assign a valid index right before calling, so behavior is identical. - Remove the #ifdef __WXCOCOA__ branches in ShowConnectionState and SetMessagesTool: the old wxCocoa port was removed from wxWidgets before the 3.2 minimum this project requires (modern macOS defines __WXOSX_COCOA__), so those lines could never compile again. - Use the two-bitmap wxBitmapBundle::FromBitmaps overload instead of building a wxVector by hand. Co-Authored-By: Claude Fable 5 <[email protected]> * style(gui): use emplace_back for the fallback toolbar bundle Fixes the clang-tidy Tier-2 modernize-use-emplace warning on the wxBitmapBundle fallback path in Add_Skin_Icon. Co-Authored-By: Claude Fable 5 <[email protected]> --------- Co-authored-by: Carlos Barrero <[email protected]> Co-authored-by: Claude Fable 5 <[email protected]>
mrjimenez
pushed a commit
to mrjimenez/amule
that referenced
this pull request
Jul 5, 2026
…ect#295) The preferences dialog's page list (General, Connection, Directories, etc.) fed 16x16 bitmaps into a fixed-size wxImageList, so on DPI-aware builds the icons render at 16 physical pixels — tiny and blurry on hi-DPI screens, same problem as the main toolbar (amule-project#294). Hand the icons to the list control as wxBitmapBundles instead (wxListCtrl::SetSmallImages, wx >= 3.2), each built from the 16px art plus a wxIMAGE_QUALITY_HIGH 2x upscale with the mask converted to an alpha channel first. The macOS-only right/bottom padding is applied per resolution so the padded canvas keeps its proportions at 2x. Co-authored-by: Carlos Barrero <[email protected]> Co-authored-by: Claude Fable 5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #29
With first commit we see in the logs:
ED2k Client: IO failure while reading requested file: SafeIO::IOFailure::SeekFailure: Seeking failed: Bad file descriptorinstead the crashWith second commit we see in the logs:
ED2k Client: IO failure while reading requested file: SafeIO::IOFailure::SeekFailure: Cannot seek on closed file.instead