chrys87 / ocrdesktop

Accessiblity tool for use the current window with OCR technique
https://wiki.archlinux.org/index.php/Ocrdesktop
15 stars 3 forks source link

OCRDesktop does not work on Wayland #8

Open francescotissera1211 opened 1 year ago

francescotissera1211 commented 1 year ago

Tested this on ArchLinux with kde Plasma 5.27.6, wayland session. OCRDesktop does not work under Wayland.

Steps to reproduce:

  1. log in to a Wayland session.
  2. open a terminal and try the command: "ocrdesktop"
  3. the command will throw an error that I can't copy paste for some reason, but you'll get it none the less.

Expected results: OCRDesktop should work under Wayland as well, giving the user more flexibility of choice when it comes to display server.

Actual results: the program does not work under Wayland at all.

ayushh2k commented 1 year ago

(ocrdesktop:164631): Wnck-WARNING **: 16:55:54.496: libwnck is designed to work in X11 only, no valid display found [1] 164631 segmentation fault (core dumped) ocrdesktop

This is the error message

chrys87 commented 1 year ago

Howdy,

for wayward does currently no API equivalent to libwnck exist. Its used to get window size and position.

you might want to try -d parameter, it dors screenshot the ehole desktop instead the current window, so libwnck is not involved there. You might get better results in fullscreen the window you wanna OCR first.

cheers chrys

ayushh2k commented 1 year ago

is it possible to feed ocrdesktop a region of the screen using slurp, that might resolve the window size and position problem

chrys87 commented 1 year ago

Howdy,

sure, you can pass almost any image file or pdf using -f filename parameter

ocrdesktop -f /home/user/screenshot.png

but you can’t interact with the window then using the mouse emulation. OCRdesktop know than the imagedata of the window but not where it is located on screen.

chrys87 commented 1 year ago

Well if you find a way to get the window position, i can add a parameter to pass this values to OCRdesktop and activate mouse emulation with this information to be able to emulate clicks on right position.

chrys87 commented 10 hours ago

well, in the meantime pipewire comes into plan. maybe we can resolve this issue asking pipewire for the screen content.

ayushh2k commented 10 hours ago

sure, i've been using normcap recently and it does the job for wayland