Compact-Log-Format-Viewer icon indicating copy to clipboard operation
Compact-Log-Format-Viewer copied to clipboard

Can't read any log files under Mac OS

Open yankun opened this issue 2 years ago • 1 comments

Hi,

I've checked out the repository, build it for Mac OS and tried to open a VERY simple log file. Unfortunately I'm getting an error message when dropping the file onto the Application Window:

Screenshot 2024-01-03 at 10 01 22

The log file is very basic:

tinylog.log

I'm trying to run the App on a M3 MacBook Pro. Can anybody reproduce this under a different operating system?

yankun avatar Jan 03 '24 09:01 yankun

As a workaround, you can simply open the log file using the "Select a log file" button. This method works without any issues.

The problem with file dropping seems to occur when the application window is not in focus on Mac. After investigating, I found that modifying the following line in events.ts seems to resolve the issue:

// Original code
const currentWindow = webContents.getFocusedWebContents();

// Updated code
const currentWindow = event.sender;

This seems a more reliable way of detecting the window, at least on Mac. I haven't tested on Windows.

Bigfellahull avatar Feb 19 '25 19:02 Bigfellahull