Skip to content

Commit 8645ef0

Browse files
committed
Add comprehensive logging for wallpaper debugging
1 parent a0cdd33 commit 8645ef0

3 files changed

Lines changed: 26 additions & 2 deletions

File tree

Bloxstrap/Bloxstrap.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
<UseWPF>true</UseWPF>
88
<UseWindowsForms>True</UseWindowsForms>
99
<ApplicationIcon>Bloxstrap.ico</ApplicationIcon>
10-
<Version>3.7.0</Version>
11-
<FileVersion>3.7.0</FileVersion>
10+
<Version>3.7.2</Version>
11+
<FileVersion>3.7.2</FileVersion>
1212
<ApplicationManifest>app.manifest</ApplicationManifest>
1313
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
1414
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>

Bloxstrap/UI/Elements/Settings/MainWindow.xaml.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,24 +36,36 @@ public MainWindow(bool showAlreadyRunningWarning)
3636
App.Logger.WriteLine("MainWindow", "Initializing settings window");
3737

3838
// Set random app background if wallpaper launcher is enabled
39+
App.Logger.WriteLine("MainWindow", $"EnableWallpaperLauncher = {App.Settings.Prop.EnableWallpaperLauncher}");
40+
3941
if (App.Settings.Prop.EnableWallpaperLauncher)
4042
{
4143
try
4244
{
45+
App.Logger.WriteLine("MainWindow", "Attempting to load random background...");
4346
var backgroundImage = AppBackgroundService.GetRandomBackground();
4447
if (backgroundImage != null)
4548
{
49+
App.Logger.WriteLine("MainWindow", "Background loaded successfully, applying to window");
4650
this.Background = new System.Windows.Media.ImageBrush(backgroundImage)
4751
{
4852
Stretch = System.Windows.Media.Stretch.UniformToFill
4953
};
5054
}
55+
else
56+
{
57+
App.Logger.WriteLine("MainWindow", "Background image is null");
58+
}
5159
}
5260
catch (Exception ex)
5361
{
5462
App.Logger.WriteLine("MainWindow", $"Failed to set background: {ex.Message}");
5563
}
5664
}
65+
else
66+
{
67+
App.Logger.WriteLine("MainWindow", "Wallpaper launcher is disabled in settings");
68+
}
5769

5870
if (showAlreadyRunningWarning)
5971
ShowAlreadyRunningSnackbar();

Bloxstrap/UI/ViewModels/Settings/ExperimentalViewModel.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,12 @@ private async Task SelectBackground(AppBackgroundService.BackgroundType type)
110110
{
111111
try
112112
{
113+
App.Logger.WriteLine("ExperimentalViewModel", $"SelectBackground called with type: {type}");
114+
113115
var backgroundImage = AppBackgroundService.GetBackground(type);
116+
117+
App.Logger.WriteLine("ExperimentalViewModel", $"Background image loaded: {backgroundImage != null}");
118+
114119
if (backgroundImage != null)
115120
{
116121
// Apply to current window immediately
@@ -119,10 +124,16 @@ await Application.Current.Dispatcher.InvokeAsync(() =>
119124
var mainWindow = Application.Current.Windows.OfType<MainWindow>().FirstOrDefault();
120125
if (mainWindow != null)
121126
{
127+
App.Logger.WriteLine("ExperimentalViewModel", "Applying background to MainWindow");
122128
mainWindow.Background = new System.Windows.Media.ImageBrush(backgroundImage)
123129
{
124130
Stretch = System.Windows.Media.Stretch.UniformToFill
125131
};
132+
App.Logger.WriteLine("ExperimentalViewModel", "Background applied successfully");
133+
}
134+
else
135+
{
136+
App.Logger.WriteLine("ExperimentalViewModel", "MainWindow not found!");
126137
}
127138
});
128139

@@ -137,6 +148,7 @@ await Application.Current.Dispatcher.InvokeAsync(() =>
137148
{
138149
WallpaperStatus = $"✗ Error: {ex.Message}";
139150
App.Logger.WriteLine("ExperimentalViewModel", $"Error selecting background: {ex.Message}");
151+
App.Logger.WriteLine("ExperimentalViewModel", $"Stack trace: {ex.StackTrace}");
140152
}
141153
}
142154

0 commit comments

Comments
 (0)