• Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login
    1. Strawberry Music Player Forums
    2. mini_bomba
    3. Posts
    M
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 2
    • Best 1
    • Controversial 0
    • Groups 0

    Posts made by mini_bomba

    • RE: Hacking in PrettyOSD positioning on KDE Wayland

      @jonas
      I expected there to be a much simpler way to create a literal QString, but as I've said, I've got almost no C++ (let alone Qt) experience. That's one reason why I created a forum post rather than a pull request on the repo. Thanks for the insight though.

      As for wayland on nvidia: I myself also use an nvidia system and wayland on nvidia has been stable for some time now on the latest drivers. I wouldn't have been using it otherwise.

      I haven't done any extensive or exhaustive research, but I'm pretty sure there isn't a real way to position windows programmatically on wayland yet. There simply isn't a protocol in the suite to support this. And if there was, you'd expect the framework to implement it. I wouldn't have settled on this hack if I saw a viable way to properly implement this.
      I've also just tried forcing strawberry to run through xwayland (by setting QT_QPA_PLATFORM=xcb) and the pretty OSD appears to just™ work™ there without any hacks needed

      posted in Development
      M
      mini_bomba
    • 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.

      diff --git a/src/osd/osdpretty.cpp b/src/osd/osdpretty.cpp
      index c89a8504..00cd24c7 100644
      --- a/src/osd/osdpretty.cpp
      +++ b/src/osd/osdpretty.cpp
      @@ -100,6 +100,7 @@ OSDPretty::OSDPretty(Mode mode, QWidget *parent)
         Qt::WindowFlags flags = Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::X11BypassWindowManagerHint;
       
         setWindowFlags(flags);
      +  setWindowTitle(QString::fromUtf8("PrettyOSD", -1));
         setAttribute(Qt::WA_TranslucentBackground, true);
         setAttribute(Qt::WA_X11NetWmWindowTypeNotification, true);
         setAttribute(Qt::WA_ShowWithoutActivating, true);
      
      posted in Development
      M
      mini_bomba