DreamSourceLab / DSView

An open source multi-function instrument for everyone
www.dreamsourcelab.com
GNU General Public License v3.0
1.13k stars 417 forks source link

Wayland support #806

Open benklop opened 2 months ago

benklop commented 2 months ago

DSView doesn't work quite right in wayland, whether in xorg compat mode (XWayland) or natively. It seems that window positioning / translation / resize is being handled by DSView itself rather than leaving it up to the compositor / window manager, and this is causing problems.

Specifically it's not possible to move the upper left corner of the window, nor the left side or the top, any attempt to do so ends up moving the opposite edge since in wayland the app can only control its size and not its position.

It would be great if it was possible to simply disable all the custom window handling stuff and just use the default compositor / Qt window decorations.

dreamsource-tai commented 2 months ago

@benklop Are you using Qt5?

benklop commented 2 months ago

I am using Qt5, yes. Sorry, I think I am using Qt6, though I thought I was using Qt 5. I'll try with Qt 5 shortly.

benklop commented 1 month ago

I'm having trouble getting it to compile with Qt5 - it's failing with:

[ 88%] Building C object CMakeFiles/DSView.dir/libsigrok4DSL/strutil.c.o
/home/benklop/Downloads/DSView-1.3.2/libsigrok4DSL/strutil.c: In function ‘sr_parse_sizestring’:
/home/benklop/Downloads/DSView-1.3.2/libsigrok4DSL/strutil.c:343:19: error: implicit declaration of function ‘strcasecmp’; did you mean ‘g_strcasecmp’? [-Wimplicit-function-declaration]
  343 |         if (*s && strcasecmp(s, "Hz"))
      |                   ^~~~~~~~~~
      |                   g_strcasecmp
make[2]: *** [CMakeFiles/DSView.dir/build.make:3462: CMakeFiles/DSView.dir/libsigrok4DSL/strutil.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/DSView.dir/all] Error 2
make: *** [Makefile:156: all] Error 2

I'm not sure what to make of this, or why it would only happen with Qt5 but not Qt6

dreamsource-tai commented 1 month ago

@benklop What is your operation system? You can try that replace "strcasecmp" as "strcmp".

vanbwodonk commented 1 month ago

Hi, I'm also having a similar issue. I'm using arch linux with KDE Plasma, and installed dsview via AUR. https://aur.archlinux.org/packages/dsview

i can only minimize and maximize window, drag window is not working.

eolder commented 1 month ago

I'm having trouble getting it to compile with Qt5 - it's failing with:

[ 88%] Building C object CMakeFiles/DSView.dir/libsigrok4DSL/strutil.c.o
/home/benklop/Downloads/DSView-1.3.2/libsigrok4DSL/strutil.c: In function ‘sr_parse_sizestring’:
/home/benklop/Downloads/DSView-1.3.2/libsigrok4DSL/strutil.c:343:19: error: implicit declaration of function ‘strcasecmp’; did you mean ‘g_strcasecmp’? [-Wimplicit-function-declaration]
  343 |         if (*s && strcasecmp(s, "Hz"))
      |                   ^~~~~~~~~~
      |                   g_strcasecmp
make[2]: *** [CMakeFiles/DSView.dir/build.make:3462: CMakeFiles/DSView.dir/libsigrok4DSL/strutil.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/DSView.dir/all] Error 2
make: *** [Makefile:156: all] Error 2

I'm not sure what to make of this, or why it would only happen with Qt5 but not Qt6

FWIW I replaced these with the suggested value and it compiled and worked afterwards, I don't own the hardware so I was just testing the "demo" probe but it seemed to be working as I would have expected it to work.

benklop commented 4 weeks ago

At least on Debian with a wayland desktop, compiled with Qt5 and the above suggested substitution, I get the same behavior - drag doesn't work but maximize/minimize does. That happens whether I start with QT_QPA_PLATFORM=xcb DSView or with QT_QPA_PLATFORM=wayland DSView

benklop commented 4 weeks ago

I suspect this has to do with pv/mainframe.cpp being from 2016 - 8 years is a pretty long time in the lifespan of wayland. In fact current sigrok doesn't even have that file..

ScherbakovAl commented 2 weeks ago

Hello! I encountered the same error message when trying to build the program. I'm using Fedora 41. In the end I just installed the DSView flatpak from the app store. There is also the same problem with dragging the window.