From ea239ef0187835d7ce7f031e5a12796b2595bf64 Mon Sep 17 00:00:00 2001 From: RyanAI Date: Fri, 6 Mar 2026 01:23:12 +0800 Subject: [PATCH 1/4] fix: ensure thumbnail callback runs on UI thread The LoadItemThumbnail method was invoking the callback from background threads (inside Task.Run), causing bedHistory.Invalidate() to not refresh the menu items correctly on first try. Wrapping the callback in UiThread.RunOnIdle ensures it runs on the UI thread. Fixes MatterHackers/MatterControl#4959 --- MatterControlLib/Library/Providers/LibraryConfig.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/MatterControlLib/Library/Providers/LibraryConfig.cs b/MatterControlLib/Library/Providers/LibraryConfig.cs index 21b4351eae..5a50bb15fa 100644 --- a/MatterControlLib/Library/Providers/LibraryConfig.cs +++ b/MatterControlLib/Library/Providers/LibraryConfig.cs @@ -224,7 +224,11 @@ async void setItemThumbnail(ImageBuffer icon) { setItemThumbnail(image); })); - thumbnailListener?.Invoke(icon); + // Invoke callback on UI thread to ensure Invalidate() works correctly + UiThread.RunOnIdle(() => + { + thumbnailListener?.Invoke(icon); + }); } } From c7c63435a88b73233aeba8ff4b93ecdcbaa1e037 Mon Sep 17 00:00:00 2001 From: RyanAI Date: Fri, 6 Mar 2026 06:57:45 +0800 Subject: [PATCH 2/4] fix: enable Shift+Click text selection (submodule update) Updates agg-sharp to include the Shift+Click text selection fix. --- Submodules/agg-sharp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index 2f0d725538..86b43fd458 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit 2f0d725538c880d740ed516d6eb9d3d261f68c58 +Subproject commit 86b43fd458c3cf470f517d1a3c5383a9851de2cb From e57c295e843dc3a9f743a3e714f6a2d8fda967e0 Mon Sep 17 00:00:00 2001 From: RyanAI Date: Fri, 6 Mar 2026 07:17:52 +0800 Subject: [PATCH 3/4] fix: add M140 S0 to turn off heated bed in default end gcode The default end gcode was missing M140 S0 to turn off the heated bed after a print completes. This caused the bed to remain hot after printing. Added M140 S0 at the beginning of the end gcode to ensure the heated bed is properly turned off. Fixes: MatterHackers/MatterControl#5434 --- MatterControl.Printing/Settings/SliceSettingsFields.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MatterControl.Printing/Settings/SliceSettingsFields.cs b/MatterControl.Printing/Settings/SliceSettingsFields.cs index 0cb6f21e95..5dee947776 100644 --- a/MatterControl.Printing/Settings/SliceSettingsFields.cs +++ b/MatterControl.Printing/Settings/SliceSettingsFields.cs @@ -620,7 +620,7 @@ public static IEnumerable AllSettings() PresentationName = "End G-Code".Localize(), HelpText = "G-Code to be run at the end of all automatic output (the very end of the G-Code commands).".Localize(), DataEditType = DataEditTypes.MULTI_LINE_TEXT, - DefaultValue = "M104 S0 ; turn off temperature\\nG28 X0 ; home X axis\\nM84 ; disable motors", + DefaultValue = "M140 S0 ; turn off bed temperature\nM104 S0 ; turn off temperature\nG28 X0 ; home X axis\nM84 ; disable motors", Converter = new GCodeMapping(), }, new SliceSettingData() From 0828a72e9bae640068356932395daf4bf41f2f09 Mon Sep 17 00:00:00 2001 From: RyanAI Date: Thu, 12 Mar 2026 17:29:13 +0800 Subject: [PATCH 4/4] Fix Open Recent menu not refreshing thumbnails on first open When opening the 'Open Recent' menu for the first time after launch, thumbnails are loaded asynchronously. The original code only invalidated the individual menu item (bedHistory.Invalidate()), but this may not be sufficient to trigger a proper redraw of the submenu contents. This fix adds subMenu.Invalidate() alongside the existing bedHistory.Invalidate() to ensure both the menu item and its parent submenu are properly refreshed when thumbnails are loaded. Fixes: MatterHackers/MatterControl#4959 --- MatterControlLib/PartPreviewWindow/ViewToolBarControls.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MatterControlLib/PartPreviewWindow/ViewToolBarControls.cs b/MatterControlLib/PartPreviewWindow/ViewToolBarControls.cs index 9e1d35b806..d48d5897cc 100644 --- a/MatterControlLib/PartPreviewWindow/ViewToolBarControls.cs +++ b/MatterControlLib/PartPreviewWindow/ViewToolBarControls.cs @@ -643,7 +643,9 @@ void UpdateImageBuffer(ImageBuffer thumbnail) { // Copy updated thumbnail into original image imageBuffer.CopyFrom(thumbnail); + // Invalidate both the menu item and parent submenu to ensure proper refresh bedHistory.Invalidate(); + subMenu.Invalidate(); } ApplicationController.Instance.Library.LoadItemThumbnail(