Client Side Window Decorations

Hi guys,

First of all sorry for this noobie question.
I am trying out the mir library and created a basic tiling window manager based on the examples in the mir repository. Now I am wondering how to create custom window decorations (or how to customize the default ones) on the client side, but I’ve no idea where to start.

Does anyone have tips or hints on how to do this?
Thanks very much in advance

Here is the current title bar that I have:

1 Like

Hey @ramboss, as the “Client Side” name suggests, all of this happens on the client side :slight_smile:.

Mir just gets the full surface, drawn by the client. So to customize them you’d need to do it in the client.

But if you’re working on a compositor, don’t you rather mean to have server side decorations? We only draw some placeholder ones for X clients. There’s no API currently to do (or customize) server side decorations for Wayland clients. There is the xdg-decoration protocol extension that would probably be worth implementing, if you’re up to it :smiley:.

1 Like

Oh I see, it makes sense now. Thank you @saviq the info and the links. I had quite a mess in my head :sweat_smile: (a bit embarrassing…)

Yes I think that was the latter that I meant. So basically you either write a client (i.e. gedit, kate, etc) that hard codes the window decorations (handmade or a lib) and passes the whole to the server (mir). Or the server (mir) tells the client not to add any decorations and takes care of it itself. The latter has the benefit that all the client windows will have the same appearance independent of the toolkit that they use.

I will take a look at the xdc-decoration protocol extension :+1: (the idea to implement it is super cool but a bit daunting for me :grimacing:)

It’s more a negotiation (the server has a preference, the client has a preference, and they try to reconcile).

But also the disadvantage that the title bar may be ill fitted to the rest of the app, and you waste some real estate (client-side decorations often have more controls than just the title and max/min/close buttons).

Thanks for the clarification :+1:

Very good point! Out of curiosity, which one of the two do you prefer?

It really is the app developer’s design choice, and users’ preference :slight_smile:

Ok :slight_smile: Thanks!