dynobo / normcap

OCR powered screen-capture tool to capture information instead of images
https://dynobo.github.io/normcap/
Other
1.8k stars 91 forks source link

NormCap keeps hanging in background and no window shown #642

Open jasiralavibiztripz opened 1 month ago

jasiralavibiztripz commented 1 month ago

What happened?

After recent update, Normcap fails to launch correctly. Tried reinstalling, but same errors.

It shows the Failed to sync with dbus proxy error while trying to launch from the gnome software app.

From terminal it shows the below error:

jasir@Jasir-Laptop-15s:~$ /usr/bin/flatpak run --branch=stable --arch=x86_64 --command=normcap com.github.dynobo.normcap 22:36:55 - WARNING - normcap.gui.dbus:211 - Failed to move window via org.gnome.Shell.extensions.windows! 22:36:55 - WARNING - normcap.gui.dbus:213 - If you experience issues with NormCap's in a multi monitor setting, try installing the Gnome Shell Extension 'Window Calls' from https://extensions.gnome.org/extension/4724/window-calls/ 22:36:55 - WARNING - normcap.gui.dbus:106 - Failed to move window via org.gnome.Shell.Eval! Tried with gnome extensions disabled, but same error shows up.

How did you install NormCap?

FlatPak (Linux)

Operating System + Version?

Ubuntu 24.04

[Linux only] Display Server (DS) + Desktop environment (DE)?

Wayland + Gnome 46

Debug log output?*

jasir@Jasir-Laptop-15s:~$ flatpak run --command=normcap com.github.dynobo.normcap -v debug
22:43:13 - INFO    - normcap:50 - Start NormCap v0.5.6
22:43:13 - DEBUG   - normcap:95 - Set XCURSOR_SIZE=24
22:43:13 - DEBUG   - normcap:100 - Set QT_QPA_PLATFORM=wayland
22:43:13 - DEBUG   - normcap.gui.tray:70 - System info:
{'normcap_version': '0.5.6', 'python_version': '3.11.9', 'cli_args': '/app/bin/normcap -v debug', 'is_briefcase_package': False, 'is_flatpak_package': True, 'is_appimage_package': False, 'platform': 'linux', 'desktop_environment': <DesktopEnvironment.GNOME: 2>, 'display_manager_is_wayland': True, 'pyside6_version': '6.7.0', 'qt_version': '6.7.0', 'qt_library_path': '/usr/share/runtime/lib/plugins, /app/lib/python3.11/site-packages/PySide6/Qt/plugins, /usr/bin', 'locale': 'DEFAULT', 'config_directory': PosixPath('/home/jasir/.var/app/com.github.dynobo.normcap/config/normcap'), 'resources_path': PosixPath('/app/lib/python3.11/site-packages/normcap/resources'), 'tesseract_path': PosixPath('/app/bin/tesseract'), 'tessdata_path': PosixPath('/home/jasir/.var/app/com.github.dynobo.normcap/config/normcap/tessdata'), 'envs': {'TESSDATA_PREFIX': '/app/share', 'LD_LIBRARY_PATH': ''}, 'screens': [Screen(left=0, top=0, right=1919, bottom=1079, device_pixel_ratio=1.0, index=0, screenshot=None)]}
22:43:13 - DEBUG   - normcap.gui.settings:162 - Skip update of non existing setting (show_introduction: None)
22:43:13 - DEBUG   - normcap.gui.settings:162 - Skip update of non existing setting (cli_mode: False)
22:43:13 - DEBUG   - normcap.gui.settings:162 - Skip update of non existing setting (background_mode: False)
22:43:13 - DEBUG   - normcap.gui.settings:162 - Skip update of non existing setting (clipboard_handler: None)
22:43:13 - DEBUG   - normcap.gui.tray:384 - Listen on local socket v0.5.6-normcap.
22:43:13 - DEBUG   - normcap.screengrab.main:21 - Compatible capture handlers: ['DBUS_PORTAL', 'DBUS_SHELL']
22:43:13 - DEBUG   - normcap.screengrab.main:28 - Available capture handlers: ['DBUS_PORTAL', 'DBUS_SHELL']
22:43:13 - DEBUG   - normcap.screengrab.handlers.dbus_portal:92 - DBus request message: <PySide6.QtDBus.QDBusMessage(type=MethodReturn, service="", signature="o", contents=([ObjectPath: /org/freedesktop/portal/desktop/request/1_624/normcap_hbagfbci]) ) at 0x7c67905b2b80>
22:43:13 - DEBUG   - normcap.screengrab.handlers.dbus_portal:99 - Request accepted
22:43:13 - DEBUG   - normcap.ocr.tesseract:24 - Executing '/app/bin/tesseract --list-langs --tessdata-dir /home/jasir/.var/app/com.github.dynobo.normcap/config/normcap/tessdata'
22:43:13 - DEBUG   - normcap.ocr.tesseract:37 - Tesseract command output: List of available languages in "/home/jasir/.var/app/com.github.dynobo.normcap/config/normcap/tessdata/" (3): ¬ ara ¬ eng ¬ mal ¬
22:43:14 - DEBUG   - normcap.screengrab.handlers.dbus_portal:119 - DBus signal message: <PySide6.QtDBus.QDBusMessage(type=Signal, service=":1.79", path="/org/freedesktop/portal/desktop/request/1_624/normcap_hbagfbci", interface="org.freedesktop.portal.Request", member="Response", signature="ua{sv}", contents=(0, [Argument: a{sv} {"uri" = [Variant(QString): "file:///home/jasir/Pictures/Screenshot-70.png"]}]) ) at 0x7c67905a9580>
22:43:14 - DEBUG   - normcap.screengrab.handlers.dbus_portal:137 - Parse response
22:43:14 - DEBUG   - normcap.screengrab.post_processing:17 - Virtual geometry width: 1920
22:43:14 - DEBUG   - normcap.screengrab.post_processing:18 - Image width: 1920
22:43:14 - DEBUG   - normcap.screengrab.post_processing:19 - Resize ratio: 1.0
22:43:14 - INFO    - normcap.screengrab.main:67 - Screen captured using DBUS_PORTAL
22:43:14 - DEBUG   - normcap.gui.utils:22 - Save debug image as /tmp/normcap/2024-05-11_17-13-14_raw_screen0.png
22:43:14 - DEBUG   - normcap.gui.window:51 - Create window for screen 0
22:43:14 - DEBUG   - normcap.gui.window:127 - Set window of screen 0 to fullscreen
22:43:14 - DEBUG   - normcap.gui.dbus:177 - Moving window 'NormCap [0]' to (left=0, top=0, right=1919, bottom=1079) via org.gnome.Shell.extensions.windows
22:43:14 - WARNING - normcap.gui.dbus:211 - Failed to move window via org.gnome.Shell.extensions.windows!
22:43:14 - DEBUG   - normcap.gui.dbus:212 - Traceback (most recent call last):
  File "/app/lib/python3.11/site-packages/normcap/gui/dbus.py", line 186, in move_windows_via_window_calls_extension
    response = proxy.list_()
               ^^^^^^^^^^^^^
  File "/app/lib/python3.11/site-packages/jeepney/io/blocking.py", line 279, in inner
    return unwrap_msg(self._connection.send_and_get_reply(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/lib/python3.11/site-packages/jeepney/wrappers.py", line 214, in unwrap_msg
    raise DBusErrorResponse(msg)
jeepney.wrappers.DBusErrorResponse: [org.freedesktop.DBus.Error.UnknownMethod] ('Object does not exist at path “/org/gnome/Shell/Extensions/Windows”',)
22:43:14 - WARNING - normcap.gui.dbus:213 - If you experience issues with NormCap's in a multi monitor setting, try installing the Gnome Shell Extension 'Window Calls' from https://extensions.gnome.org/extension/4724/window-calls/
22:43:14 - DEBUG   - normcap.gui.dbus:81 - Moving window 'NormCap [0]' to (left=0, top=0, right=1919, bottom=1079) via org.gnome.Shell.Eval
22:43:14 - WARNING - normcap.gui.dbus:106 - Failed to move window via org.gnome.Shell.Eval!
22:43:14 - DEBUG   - normcap.gui.dbus:107 - Traceback (most recent call last):
  File "/app/lib/python3.11/site-packages/normcap/gui/dbus.py", line 104, in move_window_via_gnome_shell_eval
    raise RuntimeError("DBus response was not OK!")  # noqa: TRY301
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: DBus response was not OK!
jasiralavibiztripz commented 1 month ago

Just tried AppImage now. Getting the same error in the terminal.

sojusnik commented 1 month ago

Have same error message on freshly installed Ubuntu 24.04.

dynobo commented 1 month ago

Thanks for reporting!

NormCap on Gnome + Wayland + Multi-Monitor setup requires the Gnome Extension "Window Calls" to properly position its windows on the screen. (See #582 for the underlying issue).

But two things need to be improved here:

  1. This should be properly documented.
  2. NormCap should not crash, if "Window Calls" is missing. In single monitor setups, I think it should be save to just ignore the missing extension. In multi monitor setups, where NormCap certainly won't work realiably without it, it should show an info message an exit gracefully.

Working on it!

sojusnik commented 1 month ago

Using only one monitor here, so no multi-monitor setup present.

dynobo commented 1 month ago

@sojusnik , @jasiralavibiztripz, I just noticed, that the dbus exceptions are handled correctly, so it shouldn't crash NormCap. (If you look closely, you will see the exceptions logged as "DEBUG", and produce a subsequent "WARNING", but no "ERROR").

To me, it looks like the log output provided in the issue description might be incomplete?

Could anyone of you please provide me another debug log? From start until crashed/cancelled?

flatpak run com.github.dynobo.normcap -v debug
sojusnik commented 1 month ago

Here we go:

$ flatpak run com.github.dynobo.normcap -v debug
10:22:47 - INFO    - normcap:50 - Start NormCap v0.5.6
10:22:47 - DEBUG   - normcap:95 - Set XCURSOR_SIZE=24
10:22:47 - DEBUG   - normcap:100 - Set QT_QPA_PLATFORM=wayland
10:22:47 - DEBUG   - normcap.gui.tray:70 - System info:
{'normcap_version': '0.5.6', 'python_version': '3.11.9', 'cli_args': '/app/bin/normcap -v debug', 'is_briefcase_package': False, 'is_flatpak_package': True, 'is_appimage_package': False, 'platform': 'linux', 'desktop_environment': <DesktopEnvironment.GNOME: 2>, 'display_manager_is_wayland': True, 'pyside6_version': '6.7.0', 'qt_version': '6.7.0', 'qt_library_path': '/usr/share/runtime/lib/plugins, /app/lib/python3.11/site-packages/PySide6/Qt/plugins, /usr/bin', 'locale': 'de_DE', 'config_directory': PosixPath('/home/sojusnik/.var/app/com.github.dynobo.normcap/config/normcap'), 'resources_path': PosixPath('/app/lib/python3.11/site-packages/normcap/resources'), 'tesseract_path': PosixPath('/app/bin/tesseract'), 'tessdata_path': PosixPath('/home/sojusnik/.var/app/com.github.dynobo.normcap/config/normcap/tessdata'), 'envs': {'TESSDATA_PREFIX': '/app/share', 'LD_LIBRARY_PATH': ''}, 'screens': [Screen(left=0, top=0, right=1919, bottom=1079, device_pixel_ratio=1.0, index=0, screenshot=None)]}
10:22:47 - DEBUG   - normcap.gui.settings:162 - Skip update of non existing setting (show_introduction: None)
10:22:47 - DEBUG   - normcap.gui.settings:162 - Skip update of non existing setting (cli_mode: False)
10:22:47 - DEBUG   - normcap.gui.settings:162 - Skip update of non existing setting (background_mode: False)
10:22:47 - DEBUG   - normcap.gui.settings:162 - Skip update of non existing setting (clipboard_handler: None)
10:22:47 - DEBUG   - normcap.gui.tray:384 - Listen on local socket v0.5.6-normcap.
10:22:47 - DEBUG   - normcap.screengrab.main:21 - Compatible capture handlers: ['DBUS_PORTAL', 'DBUS_SHELL']
10:22:47 - DEBUG   - normcap.screengrab.main:28 - Available capture handlers: ['DBUS_PORTAL', 'DBUS_SHELL']
10:22:47 - DEBUG   - normcap.screengrab.handlers.dbus_portal:92 - DBus request message: <PySide6.QtDBus.QDBusMessage(type=MethodReturn, service="", signature="o", contents=([ObjectPath: /org/freedesktop/portal/desktop/request/1_185/normcap_fecfddfe]) ) at 0x79b569f0c340>
10:22:47 - DEBUG   - normcap.screengrab.handlers.dbus_portal:99 - Request accepted
10:22:47 - DEBUG   - normcap.ocr.tesseract:24 - Executing '/app/bin/tesseract --list-langs --tessdata-dir /home/sojusnik/.var/app/com.github.dynobo.normcap/config/normcap/tessdata'
10:22:47 - DEBUG   - normcap.ocr.tesseract:37 - Tesseract command output: List of available languages in "/home/sojusnik/.var/app/com.github.dynobo.normcap/config/normcap/tessdata/" (1): ¬ eng ¬
10:22:48 - DEBUG   - normcap.screengrab.handlers.dbus_portal:119 - DBus signal message: <PySide6.QtDBus.QDBusMessage(type=Signal, service=":1.90", path="/org/freedesktop/portal/desktop/request/1_185/normcap_fecfddfe", interface="org.freedesktop.portal.Request", member="Response", signature="ua{sv}", contents=(0, [Argument: a{sv} {"uri" = [Variant(QString): "file:///home/sojusnik/Bilder/Screenshot.png"]}]) ) at 0x79b569f07080>
10:22:48 - DEBUG   - normcap.screengrab.handlers.dbus_portal:137 - Parse response
10:22:48 - DEBUG   - normcap.screengrab.post_processing:17 - Virtual geometry width: 1920
10:22:48 - DEBUG   - normcap.screengrab.post_processing:18 - Image width: 1920
10:22:48 - DEBUG   - normcap.screengrab.post_processing:19 - Resize ratio: 1.0
10:22:48 - INFO    - normcap.screengrab.main:67 - Screen captured using DBUS_PORTAL
10:22:48 - DEBUG   - normcap.gui.utils:22 - Save debug image as /tmp/normcap/2024-05-18_08-22-48_raw_screen0.png
10:22:48 - DEBUG   - normcap.gui.window:51 - Create window for screen 0
10:22:48 - DEBUG   - normcap.gui.window:127 - Set window of screen 0 to fullscreen
10:22:48 - DEBUG   - normcap.gui.dbus:177 - Moving window 'NormCap [0]' to (left=0, top=0, right=1919, bottom=1079) via org.gnome.Shell.extensions.windows
10:22:48 - WARNING - normcap.gui.dbus:211 - Failed to move window via org.gnome.Shell.extensions.windows!
10:22:48 - DEBUG   - normcap.gui.dbus:212 - Traceback (most recent call last):
  File "/app/lib/python3.11/site-packages/normcap/gui/dbus.py", line 186, in move_windows_via_window_calls_extension
    response = proxy.list_()
               ^^^^^^^^^^^^^
  File "/app/lib/python3.11/site-packages/jeepney/io/blocking.py", line 279, in inner
    return unwrap_msg(self._connection.send_and_get_reply(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/lib/python3.11/site-packages/jeepney/wrappers.py", line 214, in unwrap_msg
    raise DBusErrorResponse(msg)
jeepney.wrappers.DBusErrorResponse: [org.freedesktop.DBus.Error.UnknownMethod] ('Das Objekt existiert nicht am Pfad »/org/gnome/Shell/Extensions/Windows«',)
10:22:48 - WARNING - normcap.gui.dbus:213 - If you experience issues with NormCap's in a multi monitor setting, try installing the Gnome Shell Extension 'Window Calls' from https://extensions.gnome.org/extension/4724/window-calls/
10:22:48 - DEBUG   - normcap.gui.dbus:81 - Moving window 'NormCap [0]' to (left=0, top=0, right=1919, bottom=1079) via org.gnome.Shell.Eval
10:22:48 - WARNING - normcap.gui.dbus:106 - Failed to move window via org.gnome.Shell.Eval!
10:22:48 - DEBUG   - normcap.gui.dbus:107 - Traceback (most recent call last):
  File "/app/lib/python3.11/site-packages/normcap/gui/dbus.py", line 104, in move_window_via_gnome_shell_eval
    raise RuntimeError("DBus response was not OK!")  # noqa: TRY301
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: DBus response was not OK!
dynobo commented 1 month ago

I found the issue. For some reason, .showFullScreen() doesn't work anymore on Ubuntu 24.04 with Gnome 46 + Unity. (It still works e.g. on Arch + Gnome 46). But I found a workaround: calling .show() upfront .showFullScreen(). Depending on the configure window animations, this might look not super nice, but it a quick fix for now.

PS: NormCap isn't crashing, it just keeps running uselessly in the background without any visible window. That's why the logs don't show any errors. The dbus warnings are really just informational and unrelated to the issue.

dynobo commented 1 month ago

Should be fixed in the latest release 0.5.7. (FlatPak is published with a few hours delay) It would be nice if you could report back, if it really fixed the issue.

sojusnik commented 1 month ago

I also reset the user data of this app, but the new version didn't help:

$ flatpak run com.github.dynobo.normcap -v debug
07:07:46 - INFO    - normcap:50 - Start NormCap v0.5.7
07:07:46 - DEBUG   - normcap:95 - Set XCURSOR_SIZE=24
07:07:46 - DEBUG   - normcap:100 - Set QT_QPA_PLATFORM=wayland
07:07:46 - DEBUG   - normcap.gui.tray:70 - System info:
{'normcap_version': '0.5.7', 'python_version': '3.11.9', 'cli_args': '/app/bin/normcap -v debug', 'is_briefcase_package': False, 'is_flatpak_package': True, 'is_appimage_package': False, 'platform': 'linux', 'desktop_environment': <DesktopEnvironment.GNOME: 2>, 'display_manager_is_wayland': True, 'pyside6_version': '6.7.0', 'qt_version': '6.7.0', 'qt_library_path': '/usr/share/runtime/lib/plugins, /app/lib/python3.11/site-packages/PySide6/Qt/plugins, /usr/bin', 'locale': 'de_DE', 'config_directory': PosixPath('/home/sojusnik/.var/app/com.github.dynobo.normcap/config/normcap'), 'resources_path': PosixPath('/app/lib/python3.11/site-packages/normcap/resources'), 'tesseract_path': PosixPath('/app/bin/tesseract'), 'tessdata_path': PosixPath('/home/sojusnik/.var/app/com.github.dynobo.normcap/config/normcap/tessdata'), 'envs': {'TESSDATA_PREFIX': '/app/share', 'LD_LIBRARY_PATH': ''}, 'screens': [Screen(left=0, top=0, right=1919, bottom=1079, device_pixel_ratio=1.0, index=0, screenshot=None)]}
07:07:46 - DEBUG   - normcap.gui.settings:151 - Reset settings to (color: #FF2E88)
07:07:46 - DEBUG   - normcap.gui.settings:151 - Reset settings to (language: eng)
07:07:46 - DEBUG   - normcap.gui.settings:151 - Reset settings to (mode: parse)
07:07:46 - DEBUG   - normcap.gui.settings:151 - Reset settings to (notification: True)
07:07:46 - DEBUG   - normcap.gui.settings:151 - Reset settings to (tray: False)
07:07:46 - DEBUG   - normcap.gui.settings:151 - Reset settings to (update: False)
07:07:46 - DEBUG   - normcap.gui.settings:151 - Reset settings to (version: 0.0.0)
07:07:46 - DEBUG   - normcap.gui.settings:151 - Reset settings to (show-introduction: True)
07:07:46 - DEBUG   - normcap.gui.settings:151 - Reset settings to (last-update-check: 0)
07:07:46 - DEBUG   - normcap.gui.settings:151 - Reset settings to (has-screenshot-permission: False)
07:07:46 - DEBUG   - normcap.gui.settings:162 - Skip update of non existing setting (show_introduction: None)
07:07:46 - DEBUG   - normcap.gui.settings:162 - Skip update of non existing setting (cli_mode: False)
07:07:46 - DEBUG   - normcap.gui.settings:162 - Skip update of non existing setting (background_mode: False)
07:07:46 - DEBUG   - normcap.gui.settings:162 - Skip update of non existing setting (clipboard_handler: None)
07:07:46 - DEBUG   - normcap.gui.tray:384 - Listen on local socket v0.5.7-normcap.
07:07:46 - DEBUG   - normcap.screengrab.permissions:222 - Checking screenshot permission
07:07:46 - DEBUG   - normcap.screengrab.handlers.dbus_portal:92 - DBus request message: <PySide6.QtDBus.QDBusMessage(type=MethodReturn, service="", signature="o", contents=([ObjectPath: /org/freedesktop/portal/desktop/request/1_279/normcap_cfbeefcb]) ) at 0x7ac8fd89fd00>
07:07:46 - DEBUG   - normcap.screengrab.handlers.dbus_portal:99 - Request accepted
07:07:46 - DEBUG   - normcap.ocr.tesseract:24 - Executing '/app/bin/tesseract --list-langs --tessdata-dir /home/sojusnik/.var/app/com.github.dynobo.normcap/config/normcap/tessdata'
07:07:47 - DEBUG   - normcap.ocr.tesseract:37 - Tesseract command output: List of available languages in "/home/sojusnik/.var/app/com.github.dynobo.normcap/config/normcap/tessdata/" (1): ¬ eng ¬
07:07:47 - DEBUG   - normcap.screengrab.handlers.dbus_portal:119 - DBus signal message: <PySide6.QtDBus.QDBusMessage(type=Signal, service=":1.89", path="/org/freedesktop/portal/desktop/request/1_279/normcap_cfbeefcb", interface="org.freedesktop.portal.Request", member="Response", signature="ua{sv}", contents=(0, [Argument: a{sv} {"uri" = [Variant(QString): "file:///home/sojusnik/Bilder/Screenshot.png"]}]) ) at 0x7ac8fd88da00>
07:07:47 - DEBUG   - normcap.screengrab.handlers.dbus_portal:137 - Parse response
07:07:47 - DEBUG   - normcap.screengrab.post_processing:17 - Virtual geometry width: 1920
07:07:47 - DEBUG   - normcap.screengrab.post_processing:18 - Image width: 1920
07:07:47 - DEBUG   - normcap.screengrab.post_processing:19 - Resize ratio: 1.0
07:07:50 - DEBUG   - normcap.screengrab.main:21 - Compatible capture handlers: ['DBUS_PORTAL', 'DBUS_SHELL']
07:07:50 - DEBUG   - normcap.screengrab.main:28 - Available capture handlers: ['DBUS_PORTAL', 'DBUS_SHELL']
07:07:50 - DEBUG   - normcap.screengrab.handlers.dbus_portal:92 - DBus request message: <PySide6.QtDBus.QDBusMessage(type=MethodReturn, service="", signature="o", contents=([ObjectPath: /org/freedesktop/portal/desktop/request/1_279/normcap_cccbeghc]) ) at 0x7ac8fd8a6b40>
07:07:50 - DEBUG   - normcap.screengrab.handlers.dbus_portal:99 - Request accepted
07:07:51 - DEBUG   - normcap.screengrab.handlers.dbus_portal:119 - DBus signal message: <PySide6.QtDBus.QDBusMessage(type=Signal, service=":1.89", path="/org/freedesktop/portal/desktop/request/1_279/normcap_cccbeghc", interface="org.freedesktop.portal.Request", member="Response", signature="ua{sv}", contents=(0, [Argument: a{sv} {"uri" = [Variant(QString): "file:///home/sojusnik/Bilder/Screenshot.png"]}]) ) at 0x7ac8fd88da00>
07:07:51 - DEBUG   - normcap.screengrab.handlers.dbus_portal:137 - Parse response
07:07:51 - DEBUG   - normcap.screengrab.post_processing:17 - Virtual geometry width: 1920
07:07:51 - DEBUG   - normcap.screengrab.post_processing:18 - Image width: 1920
07:07:51 - DEBUG   - normcap.screengrab.post_processing:19 - Resize ratio: 1.0
07:07:51 - INFO    - normcap.screengrab.main:67 - Screen captured using DBUS_PORTAL
07:07:51 - DEBUG   - normcap.gui.utils:22 - Save debug image as /tmp/normcap/2024-05-19_05-07-51_raw_screen0.png
07:07:51 - DEBUG   - normcap.gui.window:51 - Create window for screen 0
07:07:51 - DEBUG   - normcap.gui.window:141 - Set window of screen 0 to fullscreen
07:07:51 - DEBUG   - normcap.gui.dbus:177 - Moving window 'NormCap [0]' to (left=0, top=0, right=1919, bottom=1079) via org.gnome.Shell.extensions.windows
07:07:51 - WARNING - normcap.gui.dbus:211 - Failed to move window via org.gnome.Shell.extensions.windows!
07:07:51 - DEBUG   - normcap.gui.dbus:212 - Traceback (most recent call last):
  File "/app/lib/python3.11/site-packages/normcap/gui/dbus.py", line 186, in move_windows_via_window_calls_extension
    response = proxy.list_()
               ^^^^^^^^^^^^^
  File "/app/lib/python3.11/site-packages/jeepney/io/blocking.py", line 279, in inner
    return unwrap_msg(self._connection.send_and_get_reply(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/lib/python3.11/site-packages/jeepney/wrappers.py", line 214, in unwrap_msg
    raise DBusErrorResponse(msg)
jeepney.wrappers.DBusErrorResponse: [org.freedesktop.DBus.Error.UnknownMethod] ('Das Objekt existiert nicht am Pfad »/org/gnome/Shell/Extensions/Windows«',)
07:07:51 - WARNING - normcap.gui.dbus:213 - If you experience issues with NormCap's in a multi monitor setting, try installing the Gnome Shell Extension 'Window Calls' from https://extensions.gnome.org/extension/4724/window-calls/
07:07:51 - DEBUG   - normcap.gui.dbus:81 - Moving window 'NormCap [0]' to (left=0, top=0, right=1919, bottom=1079) via org.gnome.Shell.Eval
07:07:51 - WARNING - normcap.gui.dbus:106 - Failed to move window via org.gnome.Shell.Eval!
07:07:51 - DEBUG   - normcap.gui.dbus:107 - Traceback (most recent call last):
  File "/app/lib/python3.11/site-packages/normcap/gui/dbus.py", line 104, in move_window_via_gnome_shell_eval
    raise RuntimeError("DBus response was not OK!")  # noqa: TRY301
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: DBus response was not OK!
dynobo commented 1 month ago

Thanks for testing, @sojusnik ! Could you please try the appimage version, to see if the issue is flatpak specific? Edit: Nevermind, I already see the issue in your log: Your desktop environment is reported as "Gnome", while I implemented the workaround only for "Unity". I have to check, if the DE is reported differently from within flatpak, and adjust the triggering of the workaround accordingly.

dynobo commented 1 month ago

@sojusnik , did the new 0.5.8 fixed it?

sojusnik commented 1 month ago

@sojusnik , did the new 0.5.8 fixed it?

We have some progress! At the first time it works, the text gets OCRed, but when doing it another time, normcap hangs, see:

$ flatpak run com.github.dynobo.normcap -v debug
16:07:58 - INFO    - normcap:50 - Start NormCap v0.5.8
16:07:58 - DEBUG   - normcap:95 - Set XCURSOR_SIZE=24
16:07:58 - DEBUG   - normcap:100 - Set QT_QPA_PLATFORM=wayland
16:07:59 - DEBUG   - normcap.gui.tray:70 - System info:
{'normcap_version': '0.5.8', 'python_version': '3.11.9', 'cli_args': '/app/bin/normcap -v debug', 'is_briefcase_package': False, 'is_flatpak_package': True, 'is_appimage_package': False, 'platform': 'linux', 'desktop_environment': <DesktopEnvironment.GNOME: 2>, 'display_manager_is_wayland': True, 'pyside6_version': '6.7.0', 'qt_version': '6.7.0', 'qt_library_path': '/usr/share/runtime/lib/plugins, /app/lib/python3.11/site-packages/PySide6/Qt/plugins, /usr/bin', 'locale': 'de_DE', 'config_directory': PosixPath('/home/sojusnik/.var/app/com.github.dynobo.normcap/config/normcap'), 'resources_path': PosixPath('/app/lib/python3.11/site-packages/normcap/resources'), 'tesseract_path': PosixPath('/app/bin/tesseract'), 'tessdata_path': PosixPath('/home/sojusnik/.var/app/com.github.dynobo.normcap/config/normcap/tessdata'), 'envs': {'TESSDATA_PREFIX': '/app/share', 'LD_LIBRARY_PATH': ''}, 'screens': [Screen(left=0, top=0, right=1919, bottom=1079, device_pixel_ratio=1.0, index=0, screenshot=None)]}
16:07:59 - DEBUG   - normcap.gui.settings:162 - Skip update of non existing setting (show_introduction: None)
16:07:59 - DEBUG   - normcap.gui.settings:162 - Skip update of non existing setting (cli_mode: False)
16:07:59 - DEBUG   - normcap.gui.settings:162 - Skip update of non existing setting (background_mode: False)
16:07:59 - DEBUG   - normcap.gui.settings:162 - Skip update of non existing setting (clipboard_handler: None)
16:07:59 - DEBUG   - normcap.gui.tray:390 - Another instance is already running. Sending capture signal.
16:07:59 - INFO    - normcap.gui.tray:606 - Exit normcap
16:07:59 - DEBUG   - normcap.gui.tray:607 - Debug images saved in /tmp/normcap
16:07:59 - DEBUG   - normcap:183 - [QT] qtwarningmsg - qobject::starttimer: timers can only be used with threads started with qthread

If you kill normcap, launch it again to see it hanging and repeat that several times, then after some tries and with some luck normcap allows you to OCR once, but on the next run it will hang again. Very odd.