Show more

@alf was excited for a moment, but this doesn't seem to be open-source 😞

very meh considering the synth engine base is open...

Got gtk4 client-side window decoration size details dynamically now - github.com/falkTX/wayland-audi

No need for super hacky "render window offline and then fetch position based on pixels", instead it is just:
1. create dummy window
2. fetch its initial size (200x200 on my laptop)
3. add a title bar
4. get title bar size and updated window size
5. x,y offsets are (new size - old size) / 2

picture shows this working nicely, I have an intentional 20px padding around the yellow rectangle

@refi64 I went down to chromium code that calls directly into gtk and well, it's not pretty...

chromium.googlesource.com/chro

so they render an empty window "offline" to then try to find the bounds through the rendered bitmap, detecting pixels and whatnot.

this is insane, right?

@refi64 the gtk backend seems useful yes, but also over-complicated? why is it manually drawing things when gtk has ways to render a titlebar for us?

the only thing I need right now is finding the default titlebar height and the left-shadow-position offset. there are ways to find this info without drawing everything manually right? ...right?

@ColinKinloch @refi64 it is at least nice that we mostly only need to care about gnome/gtk settings here, as everyone else implements server-side decorations.

I bet things will look super messy when testing under weston... πŸ€”
I mean, should KDE apps follow KDE session settings or try to follow current desktop ones? Same for Gtk based tools, they always seem to follow their own rules even on foreigner desktops. I need to try this πŸ˜…

@albertyeah I open the file? there is nothing to do for some basic highlighting.

for auto-complete and other IDE-like features Kate makes use of "LSP", plugins that talk to daemons which do the auto-complete. For C++ this would be clangd, I think its just a matter of installing it and enabling the Kate plugin.

uploaded picture is an example, it knows which fields are available in the "sum" struct.
it "just works" for cmake-based projects. for other types use "bear" to generate command list

@refi64 err, my usecase is for audio plugins, which need to be self-contained.
This means each individual binary will have to contain its own copy of the entire libdecor..? πŸ€¦β€β™‚οΈ

Also libdecor also incorrectly assumes the buttons to be always on the right side πŸ˜”

Anyhow since my target is audio plugin UIs and they are mostly going to be embed in a host view, a super minimal hack for standalone windows using gtk and subsurfaces is quite ok with me, and that one gets the buttons correct

falktx boosted

KXStudio doing the Lord's work of maintaining Linux builds of a number of FOSS audio plugins:
kx.studio/Repositories:Plugins

#opensource #audio #linux

Never thought I would see a damn AI chatbot inside a DAW as an official feature πŸ˜•

This is not going to stop is it... 😞

Curious thing...
Font, window-title-bar and shadow size are different between gtk3 and gtk4.

This is on a stock Gnome desktop, installed today, no settings changed at all.

They look similar but have their inconsistencies.
Yay for client-side decorations! πŸŽ‰ 😒

Lazily loading gtk4 symbols in order to create a dummy window seems to work.
Also on gtk3.

Bless be wayland subsurfaces! πŸ™

@ggenois I didn't change anything, and there are no themes involved ? not sure why you think it's related at all to that link.

The KDE app is trying to show itself in some way that is broken outside of KDE. Typically the Qt based stuff tries to find a theme based on the current desktop/OS/etc, but here it fails badly.
The fact that the window decorations are in the wrong place leads me to think there might be some "gtk integration plugin" I am missing.

Anyhow, it just looks silly.

I tried to plug into gtk4 just for it to create a dummy window for me, idea being that then I don't need to deal with any of this lack-of-server-side-decoration business.

Well that presents its own problems, the wayland surface from the gtk4 window includes the shadow and decorations, also the size requested on start includes those too?? so I always get a smaller "window area" than expected, and I guess I now need to find that offset too somehow πŸ€”

Many hoops just to have window controls 😑

@bojidar_bg I did the sacrilege of running a KDE app on the Gnome desktop.

Since I am doing tests on Wayland, I need to try the Gnome desktop compositor (Mutter) to ensure things work there, as that one seems to be quite special.

I just ran dolphin, and it looks like that on a standard Debian stable.

Yeah I really hate client-side decorations 😑

From top to bottom:

1. Firefox is able to follow Gnome desktop settings, as it uses Gtk on the lower level πŸ‘

2. Konsole being KDE and based on Qt is not Gtk related, just makes assumptions on what decorations should be used

3. Carla being Qt behaves the same

4. Steam does its own thing, but also assumes what decorations should be used

I really thought Qt&KDE apps would behave better πŸ˜”

PS: Yes I prefer my window buttons on the left side

I mean, the app can request the compositor to have "server-side decorations" but this is treated as optional protocol.
See wayland.app/protocols/xdg-deco

It is implemented on all major desktops except Gnome 😭

So now all apps need to implement their own decoration, user resizing, etc feels very backwards and wasteful.

The way some compositors implement some features and some not is a bit annoying, but the main features are well supported overall.

Now to get DPF to support wayland... 😁

2 / 2

After a few days writing code and running tests directly with wayland APIs... I like it! πŸ‘

It is quite different from X11, but so is doing Windowing and events on macOS and Windows. So it is kinda like another platform altogether.

The way of dealing with "protocols" feels a little weird at first, but I can really appreciate the extensibility provided and a centralized place for them.

So far there is only 1 thing I hate - client-side decorations.

1/2

Show more
falkTX Mastodon

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!