Screen Edge handling in 4.11

Martin Gräßlin mgraesslin at kde.org
Mon Jan 21 10:03:53 UTC 2013


Hi workspace devs,

I just finished a rewrite of the Screen Edge handling in KWin [1] and now I 
want to tackle one of the long standing issues: hidden panel activation. For 
those who do not know the plans first designed years ago: instead of Plasma 
keeping track of where the panel is and reacting on the screen edge, we just 
let KWin handle this edge for Plasma and notify Plasma when the Panel should 
be shown. This brings the advantage that KWin and Plasma do not fight over the 
edge (normally KWin should win, though there are hacks to make Plasma win) and 
there is a consistent user experience on how to interact with screen edges.

The new architecture has been implemented in a way to make that possible and I 
have thought about how we can setup a protocol which does not only suit the 
Plasma Panel case but also the Gwenview fullscreen & co cases.

As communication medium I propose to use D-Bus and not X11 for the following 
reasons:
* make it easier to get the changes inside applications - they might not like 
plattform specific code
* support features where there is not yet a window present, e.g. activating 
KRunner
* obviously to have an easier way towards Wayland

The protocol I would suggest is:
1. Application calls D-Bus function in KWin with the following information
 * which edge to monitor (left/right/top/bottom)
 * offset on edge
 * length on edge
2. KWin returns a unique identifier for the registered area
3. Whenever this area is triggered, KWin emits a dbus signal with the unique 
identifier as parameter
4. If the Application does no longer need the geometry it calls a D-Bus 
function for unregister the geometry with the unique identifier as parameter

In addition both the Application and KWin should watch D-Bus for the other 
service going away. That is if the Application goes away KWin just unregisters 
all geometries from this Application, if KWin dies, the Application needs to 
re-register once KWin is alive again.

The idea behind the identifier is to make it easy to have multiple 
applications overlapping the same edge. By emitting the identifier 
applications will only handle the edge trigger they actually need, but also no 
application can get the information which other applications have registered 
an edge and which area. The idea of offset and length instead of global 
coordinates is to better handle multi screen. It takes away the responsibility 
to unregister/register whenever the screen geometry changes. Also it's in 
preparation for Wayland where global coordinates should not be known to the 
Client.

I'm of course open to any suggestion and are happy to explain the motivation 
in more detail.

What remains to do is also moving the Panel glow from Plasma to KWin. I want 
to have this as a generic feature available for all edges. E.g. when 
approaching the top left corner it should start glowing. Now a stupid 
question: where do I find that code?

--
Martin Gräßlin

[1] https://git.reviewboard.kde.org/r/108513/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20130121/b79cd340/attachment-0001.sig>


More information about the Plasma-devel mailing list