Hi folks,

Where I work, we need to have some logic to manage surfaces from a client
point of view (application or toolkit). For example, we need to be able to :
- minimize (hide/show or more) surfaces, just like most desktop
environments allow ;
- manage layers, by arranging surfaces by z-orders e.g. ;
- ...

Having searched a bit, and because the core Wayland protocol does not
provide this, it seems that the xdg_shell protocol would be the way to go.

I just looked in the current Weston codebase, and found there are already
stubbed implementations for xdg_shell_set_minimize() e.g.. I plan to write
a minimal implementation adding the call handling to shell.c, and a new
taskbar.c plugin eventually receiving calls.
-----
As a proof-of-concept, I just wrote a patch for weston 1.3.x that
implements all the logic needed for a graphical taskbar, and manages
minimization/raise events for surfaces.

 Here's the patched version, which basically modifies shell, desktop_shell
and toytoolkit :
https://github.com/Tarnyko/weston-taskbar

 Here are some screenshots :
http://www.tarnyko.net/repo/weston131-taskbar1.png
http://www.tarnyko.net/repo/weston131-taskbar2.png

 And for the lazy ;-) , here is a video :
http://www.youtube.com/watch?v=7Svrb3iGBAs
-----
Here's how it works :

- When the compositor creates a shell_surface having the TOPLEVEL type,
it sets a numeral ID for it, and sends a "map" event to the desktop_shell
client ;

- the desktop_shell client receives the event, and then creates a
button on the taskbar associated with this ID. If the surface has a title
(typically set client-side with wl_shell_surface_set_title()), the button
will display it ; otherwise it will just contain "Default:<ID>".

- when the button is clicked, and the window is shown, it asks the
compositor
to hide it... or asks the contrary in the other case ;-) ;

- if it should be hidden, then the compositor sends the shell_surface to a
new
weston_layer named "taskbar_layer". This layer is not displayed at all. If
it
shouldn't, then it's moved back to the current workspace layer.

- lots of weston clients use the toytoolkit library ("weston-terminal"
e.g.).
When their "minimize" button is pressed, they now call a
taskbar_move_surface()
function which will do the former, and additionally send a hint to the
desktop_shell
that this has been done (so the corresponding taskbar button stays tuned).
---

As lots of code changed in 1.4, and xdg_shell interface is now implemented,
I will try to port it to git master along with xdg_shell additions.

Comments on this subject are very welcome !

PS : I will be at FOSDEM this w-e (
https://fosdem.org/2014/schedule/event/porting_legacy_x11_to_wayland/) if
anyone wants to discuss the subject with me.

-- 
Regards,



*Manuel BACHMANN Tizen Project VANNES-FR*
_______________________________________________
wayland-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to