matt-m-o / YomiNinja

Open-source OCR and dictionary tool.
GNU General Public License v3.0
219 stars 2 forks source link

Overlay broken on Linux Mint 21.1 (with standard Cinnamon desktop) #31

Open Letiliel opened 2 months ago

Letiliel commented 2 months ago

YomiNinja looks like exactly what I need, but I'm having several breaking issues:

  1. When hovering over overlay rectangles, the OCR'd text glitches, either showing the correct text or another to the right. Please check the provided video (the image glitching at the top is a bug with the casting app).
  2. The overlay is misplaced when applied to a window. It's fine when full screen but that doesn't solve issue 1.
  3. The external border of the overlay is missing the bottom and right lines, preventing resizing it when misplaced.
  4. When launching YomiNinja the desktop panels (menu bar etc) are hidden.

I would like to sponsor fixes for these. Or at least the first one which is the only one really preventing me to use your app. If you're interested, let's discuss

https://github.com/matt-m-o/YomiNinja/assets/4447503/379bee4b-6236-4eee-be99-52a88f1f9106

I tried changing various options and disabling extensions.

matt-m-o commented 1 month ago

I was able to test and confirm the misplacement issue, but not the glitch. Are you using Wayland? For some reason, the coordinates reported by xdotool are incorrect when using Linux Mint. I’ll try to find a better method to get the window coordinates.

In the meantime, you can try the following:

  1. Right-click the YomiNinja tray icon.
  2. Disable "Overlay Automatic Adjustment" (the checkmark won’t change on Linux, but it works)
  3. Press Ctrl+Shift+M and adjust the overlay position and size.
Letiliel commented 1 month ago

Thank you For windows coordinates, you could use xwininfo -id which seems to provide accurate absolute coordinates, except that it doesn't include window decorations. You can get the size of the latter with xprop -id <window_id> _NET_FRAME_EXTENTS.

Fixing that might also fix the glitch, as it seems that the mouse itself is being offset, or that you're using offset coordinates to trigger a hover event. Something like that?

PS: not using Wayland