@mini_bomba said in Hacking in PrettyOSD positioning on KDE Wayland:
I've been using strawberry on KDE for a few years now.
From the start I've loved the "pretty OSD" style of notifications. They're just so much better than native ones.
They work great under X11, but ever since I've moved to Wayland, the rough edges of that display protocol were apparent every time the OSD appeared... the OSD would always spawn in the middle of the screen, which is just sad.
Now while I understand that this is a shortcoming of the Wayland protocols, that probably won't be resolved anytime soon (even though it should) and that the strawberry project can do nothing to resolve the issue for every Wayland user out there... this doesn't stop individual users (like myself) from hacking in solutions for their own use cases.
So KDE has this neat feature called "window rules". It basically allows me to create sets rules for specific windows, provided that there's a way to select the desired window. These rules may include forcing a specific positioning of a window, which would be quite helpful in this case.
There's only one issue. I couldn't find a way to distinguish the main strawberry player window from the OSD "window". Having the whole player be stuck to the top right corner of my screen wouldn't be ideal.
That's why I've been running a patched version of strawberry for the past few months. One with literally just a one line patch that simply sets the title of the OSD window to "PrettyOSD". This makes it possible to match the OSD window by its new title.
Now while this is a change that I made only to enable a DE-specific hack, I think it's quite a sensible change to make outside of this hack context.
I'll attach the patch I use below as a reference, but keep in mind that I've got almost no C++ experience and this might be the worst way to implement my general idea. I didn't use any AI "help" though, if that makes anyone more confident about the quality of that hacky patch.
Thanks for sharing this! I really appreciate how thoughtfully you’ve tackled this limitation — especially considering the current state of Wayland’s window placement protocols.
You're absolutely right: while the core issue lies in Wayland’s constrained control over arbitrary window positioning, your use of KDE's window rules is a clever and practical workaround. Patching Strawberry to include a unique window title for the OSD is a lightweight and elegant solution, and I agree it’s a change that could benefit more users, even beyond this use case.
This is a great example of how user-driven micro-patches can solve DE-specific issues cleanly without bloating the main project. Honestly, small touches like this — that improve usability without breaking general behavior — should be easy candidates for upstream consideration.
If you’re into sharing insights like this, you might enjoy a recent post I read on digitaldriv , which discusses how user-side patches and desktop-level scripting can bridge gaps in compositors like Wayland. It’s focused on Norwegian developers but offers universal perspectives for niche problems like this one.