Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing wayland support #12

Open
meliache opened this issue Aug 23, 2021 · 3 comments · Fixed by #13
Open

Missing wayland support #12

meliache opened this issue Aug 23, 2021 · 3 comments · Fixed by #13

Comments

@meliache
Copy link

I tried monolens under wayland with the sway window manager via pipx and it crashed with

On OSX, you need to give Monolens permission to make screenshots, which is safe.
Traceback (most recent call last):
  File "/home/michael/.local/pipx/.cache/ec49a1adcc18bdc/bin/monolens", line 8, in <module>
    sys.exit(main())
  File "/home/michael/.local/pipx/.cache/ec49a1adcc18bdc/lib/python3.9/site-packages/monolens/__init__.py", line 46, in main
    lens = Lens()
  File "/home/michael/.local/pipx/.cache/ec49a1adcc18bdc/lib/python3.9/site-packages/monolens/lens.py", line 35, in __init__
    self._updateScreenshot(self.screen())
  File "/home/michael/.local/pipx/.cache/ec49a1adcc18bdc/lib/python3.9/site-packages/monolens/lens.py", line 187, in _updateScreenshot
    self._updateConverted()
  File "/home/michael/.local/pipx/.cache/ec49a1adcc18bdc/lib/python3.9/site-packages/monolens/lens.py", line 191, in _updateConverted
    util.grayscale(self._converted, self._screenshot)
  File "/home/michael/.local/pipx/.cache/ec49a1adcc18bdc/lib/python3.9/site-packages/monolens/util.py", line 66, in grayscale
    s = qimage_array_view(source)
  File "/home/michael/.local/pipx/.cache/ec49a1adcc18bdc/lib/python3.9/site-packages/monolens/util.py", line 45, in qimage_array_view
    assert format == QtGui.QImage.Format_RGB32
AssertionError

I'm not entirely surprise, since screenshotting utilities etc. are different under wayland. But from the stacktrace it's not obvious why exactly it crashed and in theory, Qt should be able to handle wayland, or shouldn't it?

Anyway, would be cool if someone else could try it and if they can reproduce it, add it to the limitations in the readme, after all wayland is slowly becoming more mainstream. But maybe just something with my system configuration is broken 🤷‍♂️

@HDembinski
Copy link
Owner

Sorry for the late reply, I think that's interesting feedback. It is difficult for me to debug this without having a Linux system with Wayland. Perhaps there is an easy fix: I just need to support more QImage formats other than RGB32.

@meliache
Copy link
Author

meliache commented Aug 9, 2022

After #13 was merged I now cloned this rep and did a clean install and monolens still fails with the same backtrace as above, i.e. fails from the assert

    assert format == QtGui.QImage.Format_RGB32

I opened a debugger and format in that assert has the value PySide6.QtGui.QImage.Format.Format_Invalid for me.

I understand that it's frustrating not being able to test this. At this point I'm not sure if that error occurs for all wayland users or maybe it's just some misconfiguration on my side with my sway wm setup. Since this seems to be implemented in QT, maybe it might work in a KDE wayland desktop environment.

Anyway thanks for your effort!

@HDembinski HDembinski reopened this Aug 10, 2022
@HDembinski
Copy link
Owner

HDembinski commented Aug 10, 2022

If the format is invalid, then I cannot do anything to make it work on Wayland, I am afraid. This has to be fixed in Qt then.

@HDembinski HDembinski changed the title AssertionError under wayland, Missing wayland support Aug 10, 2022
@HDembinski HDembinski reopened this Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants