mrclksr / DSBMC

Qt5 client for DSBMD
BSD 2-Clause "Simplified" License
4 stars 2 forks source link

[FIXED] Please Add 'class' Identification For WM/DE Interaction #5

Open thesunexpress opened 1 year ago

thesunexpress commented 1 year ago

I came across a peculiarity when running dsbmc on recent Wayland variants like sway or hyprland & their respective configurations. dsbmc in particular appears to be missing the class identifier context. When comparing to some of your other DSB apps, they in turn do report their class context. For DSBMixer:

Window 889d5a800 -> DSBMixer:
    mapped: 1
    hidden: 0
    at: 640,330
    size: 640,420
    workspace: 3 (3)
    floating: 1
    monitor: 0
    class: dsbmixer
    title: DSBMixer
    initialClass: dsbmixer
    initialTitle: DSBMixer
    pid: 19272
    xwayland: 0
    pinned: 0
    fullscreen: 0
    fullscreenmode: 0
    fakefullscreen: 0
    grouped: 0
    swallowing: 0

For dsbbatmon:

Window 889d59000 -> Preferences:
    mapped: 1
    hidden: 0
    at: 654,411
    size: 611,258
    workspace: 1 (1)
    floating: 1
    monitor: 0
    class: dsbbatmon
    title: Preferences
    initialClass: dsbbatmon
    initialTitle: Preferences
    pid: 20332
    xwayland: 0
    pinned: 0
    fullscreen: 0
    fullscreenmode: 0
    fakefullscreen: 0
    grouped: 0
    swallowing: 0

For DSBMC:

Window 889dba000 -> DSBMC - DSBMD Client:
    mapped: 1
    hidden: 0
    at: 984,251
    size: 637,478
    workspace: 1 (1)
    floating: 1
    monitor: 0
    class: 
    title: DSBMC - DSBMD Client
    initialClass: 
    initialTitle: DSBMC - DSBMD Client
    pid: 20407
    xwayland: 0
    pinned: 0
    fullscreen: 0
    fullscreenmode: 0
    fakefullscreen: 0
    grouped: 0
    swallowing: 0

Note: See how DSBMC does not report a class: property identifier.

This is problematic when attempting to manipulate window size / geometric location & workspace assignment etc, in whatever Wayland deployments like sway hikari hyprland and so forth. The applications mentioned, all work flawlessly & without any problems.

I am not a super-ultra-source-code-master-hero, to be able to sniff through your source code to find out how one might do a little hack / patch -- for the specific purpose of implementing this class: property.

Hopefully this is informative enough & not very difficult to implement. And many thanks again for your very useful apps!

mrclksr commented 1 year ago

Hi @thesunexpress,

could you please try building DSBMC with the latest commit?

thesunexpress commented 1 year ago

Success!

Window 88321b800 -> DSBMC - DSBMD Client:
    mapped: 1
    hidden: 0
    at: 1034,168
    size: 637,478
    workspace: 1 (1)
    floating: 1
    monitor: 0
    class: dsbmc
    title: DSBMC - DSBMD Client
    initialClass: dsbmc
    initialTitle: DSBMC - DSBMD Client
    pid: 2133
    xwayland: 0
    pinned: 0
    fullscreen: 0
    fullscreenmode: 0
    fakefullscreen: 0
    grouped: 0
    swallowing: 0
thesunexpress commented 1 year ago

Thank you thank you thank you!

I can confirm it works as expected & reports it's class identification correctly in sway , hikari & Hyprland Looking at the small patches you made to the source, it is no wonder I couldn't figure it out. I was expecting to see something obvious like "MyApp class name blah-blah-blah" etc... Turns out it is a bunch of arg's. Excellent work!

thesunexpress commented 1 year ago

A little extra info: Build setup with qmake6 works without issue. Building with make -j20 on a i9-9820X platforms takes all of 6 seconds :)

mrclksr commented 1 year ago

I can confirm it works as expected & reports it's class identification correctly in sway , hikari & Hyprland Looking at the small patches you made to the source, it is no wonder I couldn't figure it out. I was expecting to see something obvious like "MyApp class name blah-blah-blah" etc... Turns out it is a bunch of arg's. Excellent work!

Thank you for the feedback :-) The bug was quite subtle, and it took me a moment to figure out what might cause the problem.

mrclksr commented 1 year ago

A little extra info: Build setup with qmake6 works without issue. Building with make -j20 on a i9-9820X platforms takes all of 6 seconds :)

Good to know :-) it's about time to start the migration to Qt6.

thesunexpress commented 1 year ago

I've been testing a bunch of QT6 stuff for a while now. Starting off with hacking the early qt6ct releases to get things working. Has actually been fun to follow!