Integration of layer-shell in plasma

Vlad Zahorodnii vlad.zahorodnii at kde.org
Mon Aug 24 15:20:29 BST 2020


Howdy,

As you probably know, surfaces created by plasmashell need to be treated 
specially by the compositor. For example, notification windows must be 
always on top, panels may go above and below normal windows. That's why 
we use a proprietary protocol called plasma-shell for creating shell 
surfaces that provide the functionality required by plasmashell.

Unfortunately, there are technical issues with the plasma-shell protocol 
that can be fixed only by rewriting the protocol from scratch. Luckily 
for us, the sway community came up with a protocol called layer-shell 
that a desktop environment could use in order to build components such 
as panels, notifications, etc. The layer-shell protocol doesn't suffer 
from the problems that we have with the plasma-shell protocol.

The cool thing about is that with the layer-shell protocol it will be 
possible to make applications such as latte-dock run across desktop 
environments.

Over the last a couple of weeks, I've been working on a layer-shell 
protocol implementation in kwin. With the compositor side being almost 
complete (it's still under code review), it's a good time to focus on 
the client side.

The biggest difference between the layer-shell protocol and the 
plasma-shell protocol is that positioning is done in relative terms in 
the former protocol. For example, instead of saying "please place me at 
the specified position (x, y)," a client must say "please place me 10px 
away from the left screen edge." Which brings us to the first problem: 
we need to ditch specifying absolute window coordinates and transition 
to relative positioning. Unfortunately, we cannot do it all at once, so 
we need some way to smoothly transition between the two approaches. I 
see several options:

* Mimic absolute positioning via relative positioning. It's good as a 
short-term solution, but imho, we need something better
* Introduce a Plasma::Dialog with relative positioning and start 
gradually porting all plasma components to it

The second problem is that we need to integrate the layer-shell protocol 
in Qt in some way. Since plasmashell creates both normal windows and 
special-purpose windows, we need to use **both** the xdg-shell and the 
layer-shell protocol. It's not really clear how it can be achieved.

The most ideal case is where Qt provides native support for the 
layer-shell protocol out of the box. API-wise, plasmashell needs to set 
the layer, the namespace, the margins, etc. Alternatively, we could fork 
QtWayland QPA and extend it with features we need. Either way, we need 
some changes in Qt in order to be able to use several shell surface 
protocols simultaneously.

Any ideas or thoughts on what the best way to integrate the layer-shell 
protocol in plasma and Qt is?

Cheers,
Vlad


More information about the kwin mailing list