wayfire icon indicating copy to clipboard operation
wayfire copied to clipboard

Decoration is not drawn

Open travankor opened this issue 5 years ago • 14 comments

Describe the bug Server side decorations are not always drawn or they are drawn incorrectly for certain views.

To Reproduce Steps to reproduce the behavior:

  1. Enable decoration plugin
  2. Start a Xwayland Unity (Wine) game

Expected behavior The decoration is drawn.

Wayfire version 0.6.0

travankor avatar Dec 25 '20 02:12 travankor

What do you mean by drawn incorrectly? The visual result is wrong, or they are drawn where they shouldn't?

Can you also provide the output of xprop of the window which doesn't have decorations but should?

ammen99 avatar Dec 25 '20 08:12 ammen99

Can you also provide the output of xprop of the window which doesn't have decorations but should?

I guess this one isn't a bug if it's set to fullscreen?

_NET_WM_STATE(ATOM) = _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MAXIMIZED_HORZ

The visual result is wrong, or they are drawn where they shouldn't?

This is for a native wayland view and the final visual result is wrong. The view changes geometry while loading, but the decoration doesn't change so it has partial decorations until you force it to redraw by resizing for example.

The debug log is here: ix.io/2Ju7

travankor avatar Dec 25 '20 12:12 travankor

@travankor What you say is conflicting It can't have X11 _NET properties and be a native wayland view, it's not native for sure. _NET_WM_STATE_FULLSCREEN are always undecorated.

After you force it to redraw is _NET_WM_STATE_FULLSCREEN gone?

damianatorrpm avatar Dec 25 '20 12:12 damianatorrpm

And also (not mentioned in the report), I've noticed that the decorations sometimes have a "ghost" effect where they leave pixels when you move the view.

travankor avatar Dec 25 '20 12:12 travankor

It can't have X11 _NET properties and be a native wayland view, it's not native for sure. _NET_WM_STATE_FULLSCREEN are always undecorated.

Sorry it's two different applications.

After you force it to redraw is _NET_WM_STATE_FULLSCREEN gone?

~No, I don't think so.~

Ah, yes it is, but there is no decoration

travankor avatar Dec 25 '20 12:12 travankor

No, I don't think so.

If not check the same on native X / Gnome Wayland. Views that have _NET_WM_STATE_FULLSCREEN are always undecorated on X as well.

Compare the _NET_WM_STATE_FULLSCREEN appearance on wayfire (before / after redraw) and same on X / Gnome Wayland.

EDIT: if the bug is also on X / Gnome Wayland it's an application bug.

damianatorrpm avatar Dec 25 '20 12:12 damianatorrpm

If the view is fullscreen then it should not have decorations. If the view itself is not fullscreen, then that is another bug (not related to decoration).

The wrong decoration size is strange, which app is it?

ammen99 avatar Dec 25 '20 12:12 ammen99

If the view itself is not fullscreen, then that is another bug (not related to decoration).

The view starts out maximized, but not fullscreen.

The wrong decoration size is strange, which app is it?

nwjs (basically chromium)

travankor avatar Dec 25 '20 12:12 travankor

as @travankor mentioned on IRC screenshot: https://files.catbox.moe/gz17wd.png

damianatorrpm avatar Dec 25 '20 12:12 damianatorrpm

@travankor Have you tried with latest wayfire from git? I cannot reproduce here.

soreau avatar Dec 25 '20 13:12 soreau

Also, you could try disabling "Use system title bar and borders" in the settings (if it is like chromium).

soreau avatar Dec 25 '20 13:12 soreau

Maybe there is a timing issue, race condition, or something? Here is a simple Qt program that opens 5 windows in quick succession:

#include <QMainWindow>
#include <QApplication>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    QMainWindow* w;

    for(int i = 0; i < 5; i++)
    {
        w = new QMainWindow();
        w->setWindowTitle(QString("#%1").arg(i));
        w->show();

        //a.processEvents();
    }

    return a.exec();
}

When I run the above program under Wayfire v0.7.0 (wlroots-0.12.0, Mesa 20.3.4 with vulkan support), only the first and last window opened gets a title bar with minimize/maximize/close server side decorations the way it should. The other three windows get nothing.

If I uncomment the "a.processEvents();" line and run it again, now the first two (sometimes three, especially with the Animate effect enabled) windows get the expected server side decorations, while the last three windows get no titlebar/decorations.

Note that this requires a system Qt library that has been compiled with Wayland support. Previously my Qt library was compiled for X11 only, and I think it never had the problem that way. Setting Wayfire to "Preferred decoration mode: Client" makes it work okay too (even with Qt compiled for Wayland).

This is on a Raspberry Pi 4, not overclocked.

k9spud avatar Mar 13 '21 17:03 k9spud

Does this still happen?

ammen99 avatar Oct 24 '23 14:10 ammen99

@ammen99 I tried the python version of the code above. I don't seem to be able to trigger this issue anymore. I tried opening as many as 100 windows in quick succession, and in all cases, the decoration was drawn.

Before transactions, opening even 5 windows would result in having at least two windows without borders.

marcusbritanicus avatar Oct 26 '23 02:10 marcusbritanicus