KRunner Wayland issues on Qt 5.9

Martin Flöser mgraesslin at kde.org
Wed Jul 12 15:02:53 UTC 2017


Hi all,

I had a look at the issues of KRunner on Wayland with Qt 5.9 and want to 
share my findings.

What we see is KRunner working fine on first invokation, but afterwards 
everything is messed up:
* maximized windows shortly change their size
* KRunner opens behind other windows

With WAYLAND_DEBUG I was able to understand the issue. On first 
invokation everything is normal:
* Plasma shell surface gets created
* Plasma shell surface gets positioned
* Plasma shell surface gets marked as panel
* Panel is set to windows go below
* Panel is marked as accepts focus
* Surface gets mapped

Yay, a situation KWin can handle.

Now the window gets hidden, and shown again and Qt recreates the 
surface. Due to queuing we have
1. Surface gets mapped
2. KWin shows the window at random position
3. Plasma shell surface gets created and marked as panel
4. KWin adjust it to be a panel and moves maximized windows around
5. Plasma shell surface gets marked as panel with windows go below
6. KWin adjust it to be a panel with windows go below and moves 
maximized windows around
7. Panel gets marked as accepts focus (too late, too late)
8. KRunner gets positioned

So we are in a bad state. When looking at it our Plasma Shell Surface 
protocol is not double buffered which explains why KWin reacts on each 
and every of the actions. It was designed so that double buffered is not 
needed as it was supposed to be used before mapping the window.

Now with Qt's new behavior that bites our ass and I'm a little bit lost 
what to do. I think we can improve the situation by first setting the 
panel behavior, but the wrong position is something we cannot prevent if 
the window is already mapped. Even changing the protocol to be double 
buffered would not really help here as we are too late. It's not every 
frame is perfect.

Any ideas or advice?

Cheers
Martin

Problematic area from WAYLAND_DEBUG:
[2554538,395]  -> wl_surface at 135.attach(wl_buffer at 156, 0, 0)
[2554538,411]  -> wl_surface at 135.damage(0, 0, 2147483647, 2147483647)
[2554538,677]  -> wl_surface at 135.commit()
[2554538,793]  -> org_kde_plasma_surface at 109.set_role(2)
[2554538,807]  -> org_kde_plasma_surface at 109.set_panel_behavior(4)
[2554538,816]  -> org_kde_plasma_surface at 109.set_panel_takes_focus(1)
[2554538,855]  -> org_kde_kwin_slide_manager at 34.create(new id 
org_kde_kwin_slide at 157, wl_surface at 135)
[2554538,871]  -> org_kde_kwin_slide at 157.set_location(1)
[2554538,879]  -> org_kde_kwin_slide at 157.set_offset(0)
[2554538,886]  -> org_kde_kwin_slide at 157.commit()
[2554538,892]  -> wl_surface at 135.commit()


More information about the Plasma-devel mailing list