Schneegans / Burn-My-Windows

🔥 Disintegrate your windows with style.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

KDE-Wayland popups have animation!

alr86 opened this issue · comments

Describe the Bug

In KDE - Wayland popups have animation like "App or desktop switcher" & "[Safe Eyes] alerts" & ...
After the show every popup, says in Terminal:

This plugin does not support raise()

System

  • Linux distribution: Arch Linux
  • Burn-My-Windows version: 37 (I recently updated it)
  • KDE Plasma Shell version: 5.27.7
  • Qt version: 5.15.10
  • KDE Frameworks version: 5.109.0
  • kf5-config version: 1.0
  • Wayland version: 1.22.0-1

Hi there! Could you please explain in more detail what you are experiencing and what you consider to be an issue? How can I reproduce the issue, what happens and what shouldn't happen?

This sounds remotely related to #171.

In "KDE Plasma - Wayland" click Alt+Tab, and here's the Window Switcher popup like ordinary windows the popup opens with animation, but the X11 is not like this and popups have no animation
Even though the effect is trying to execute, as the video below is characterized, this doesn't happen and nothing will show until the end of the animation time.

Video: http://alr86.gigfa.com/discord/uploads/Kooha-2023-09-06-18-40-13.mp4

I've faced this problem also in Plasma Wayland session.
After some investigation I've found that the window.windowClass member of KWin Alt+Tab window switch animation in main.js file of effect is just some white spaces in Plasma Wayland session. (It's not like this in X11 tho)

So when you press Alt+Tab in Plasma Wayland session, you get a delay for animation start, and then the burn my windows effect after switch animation. Below you can see when I press Alt+Tab the TV effect will be launched after switch:

rec-screen-normal.mp4

I've work around this problem by ignoring empty window.windowClass in main.js file like this:

  static shouldAnimateWindow(window) {

    // Prevent effect on Plasma Alt+Tab key binding
    if (window.windowClass.trim().length < 1) {
      return false
    }
// Rest of code ...
   }

After adding this code I needed to log out and in back. But then the problem is solved for now. As you can see in the following video, the effect wont be launched for Alt+Tab animation:

rec-screen-fix.mp4

@Schneegans , I know this is a very bad solution, what's your thoughts? Is there any better solution for now?

The main problem here is that the Alt+Tab switch overlay of Plasma doesn't have any window classes on Wayland.

For reference I'll post the log of Alt+Tab window object here:

{
  "objectName": "",
  "geometry": {
    "x": 0,
    "y": 0,
    "width": 1920,
    "height": 1080,
    "left": 0,
    "right": 1920,
    "top": 0,
    "bottom": 1080
  },
  "expandedGeometry": {
    "x": 0,
    "y": 0,
    "width": 1920,
    "height": 1080,
    "left": 0,
    "right": 1920,
    "top": 0,
    "bottom": 1080
  },
  "height": 1080,
  "opacity": 1,
  "pos": {
    "x": 0,
    "y": 0
  },
  "screen": {
    "objectName": "",
    "geometry": {
      "x": 0,
      "y": 0,
      "width": 1920,
      "height": 1080,
      "left": 0,
      "right": 1919,
      "top": 0,
      "bottom": 1079
    },
    "devicePixelRatio": 1,
    "name": "HDMI-A-1",
    "manufacturer": "Ancor Communications Inc",
    "model": "ASUS VS228/G3LMTF024517",
    "serialNumber": "G3LMTF024517",
    "refreshRate": 60000
  },
  "size": {
    "width": 1920,
    "height": 1080
  },
  "width": 1920,
  "x": 0,
  "y": 0,
  "desktop": -1,
  "onAllDesktops": true,
  "onCurrentDesktop": true,
  "rect": {
    "x": 0,
    "y": 0,
    "width": 1920,
    "height": 1080,
    "left": 0,
    "right": 1920,
    "top": 0,
    "bottom": 1080
  },
  "windowClass": " ",
  "windowRole": "",
  "desktopWindow": false,
  "dock": false,
  "toolbar": false,
  "menu": false,
  "normalWindow": true,
  "dialog": false,
  "splash": false,
  "utility": false,
  "dropdownMenu": false,
  "popupMenu": false,
  "tooltip": false,
  "notification": false,
  "criticalNotification": false,
  "onScreenDisplay": false,
  "comboBox": false,
  "dndIcon": false,
  "windowType": 0,
  "managed": true,
  "deleted": true,
  "caption": "",
  "keepAbove": false,
  "keepBelow": false,
  "minimized": false,
  "modal": false,
  "moveable": false,
  "moveableAcrossScreens": false,
  "basicUnit": {
    "width": 1,
    "height": 1
  },
  "move": false,
  "resize": false,
  "iconGeometry": {
    "x": 0,
    "y": 0,
    "width": 0,
    "height": 0,
    "left": 0,
    "right": 0,
    "top": 0,
    "bottom": 0
  },
  "specialWindow": false,
  "icon": "",
  "skipSwitcher": false,
  "contentsRect": {
    "x": 0,
    "y": 0,
    "width": 1920,
    "height": 1080,
    "left": 0,
    "right": 1920,
    "top": 0,
    "bottom": 1080
  },
  "decorationInnerRect": {
    "x": 0,
    "y": 0,
    "width": 1920,
    "height": 1080,
    "left": 0,
    "right": 1920,
    "top": 0,
    "bottom": 1080
  },
  "hasDecoration": false,
  "activities": [],
  "onCurrentActivity": true,
  "onAllActivities": true,
  "decorationHasAlpha": false,
  "visible": true,
  "skipsCloseAnimation": false,
  "fullScreen": false,
  "unresponsive": false,
  "waylandClient": false,
  "x11Client": false,
  "popupWindow": false,
  "internalWindow": null,
  "outline": false,
  "lockScreen": false
}

As you can see, the windowClass is an empty string.

Funnily, I was investigating the exact same thing this very minute 🤣

I think the best solution would be to report this to the KWin developers. Different behavior on X11 and Wayland in this regard can be considered to be a bug, I think. I'll open a bug report later today!

Now, that's coincidence!

I hope it'll be an easy fix for KWin and they will be able to also backport it for Plasma 5.

Thank you for this great project, I hope Plasma Wayland will be ready soon.

I chatted with the KWin devs on Matrix and they pointed me to this report: https://invent.kde.org/plasma/kwin/-/issues/153

I added a note there, let's see if there's any progress.

Alternatively, we could maybe try to ignore windows for which (window.hasDecoration == false && window.onAllDesktops == true). I think this should be a pretty rare combination. What do you think? Maybe you could add this and see if it breaks anything else...

Good, I'll add that tomorrow to see what will happen

I've changed the condition like this as you suggested:

if(window.hasDecoration === false && window.onAllDesktops === true) {
      return false
}

And so far everything is good. I'll stick with this modification for now and if there was any problems I'll report it.

Thank you