Skip to content

Commit 2e7779b

Browse files
committed
screenshot debugging
1 parent 4f76956 commit 2e7779b

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

Services/ScreenshotService.cs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -277,16 +277,22 @@ private void TakeLinuxScreenshot(string saveDirectory)
277277
{
278278
if (IsFlameshotSetup())
279279
{
280-
string savePath = Path.Combine(saveDirectory, _config.LatestScreenshotName);
280+
string savePath = Path.Combine(saveDirectory, _config.LatestScreenshotName.Normalize());
281281

282282
if (File.Exists(savePath))
283283
{
284+
_loggingService.LogInfo("Old Screenshot exists - attempting delete");
284285
File.Delete(savePath);
286+
_loggingService.LogInfo($"Old Screenshot deleted: {!File.Exists(savePath)}");
287+
}
288+
else
289+
{
290+
_loggingService.LogInfo("Old Screenshot does not exist.");
285291
}
286292

287293
string arguments = _isInFlatpak
288-
? $"{_flameshotArgs} screen -r -p \"{ savePath}\""
289-
: $"screen -r -p \"{ savePath}\"";
294+
? $"{_flameshotArgs} screen -r -p \"{savePath}\""
295+
: $"screen -r -p \"{savePath}\"";
290296

291297
ProcessStartInfo flameshotStartInfo = new()
292298
{
@@ -295,7 +301,8 @@ private void TakeLinuxScreenshot(string saveDirectory)
295301
};
296302

297303
Process process = Process.Start(flameshotStartInfo);
298-
process.WaitForExit(2000);
304+
process.WaitForExit(5000);
305+
process.Close();
299306

300307
if (!File.Exists(savePath))
301308
{

0 commit comments

Comments
 (0)