-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
On Fri, Feb 26, 2016 at 04:24:20AM -0800, Jon wrote:
>
>
> On Thursday, February 25, 2016 at 11:34:32 AM UTC+13, Eric Shelton wrote:
>
> > I wanted to point out that this is a small, discrete project where someone
> > with the right skills (KDE 5/Qt 5 development experience) - or someone
> > interested in putting forth the effort to learn the necessary frameworks -
> > could, probably without too much effort, make a contribution that has a
> > significant effect for the Qubes project.
> >
>
> I started looking into this a few days ago. There are very few people with
> any experience right now because the area has undergone/is undergoing large
> changes. The re-factored framework is not as amenable to Qubes needs as the
> old framework was. I will dump what I've discovered/been thinking so far in
> case anyone else is working on this (or thinking of starting). I'd be happy
> to discuss further if so.
Thanks for detailed analysis of the problem!
> The existing way of drawing decorations is to have all the drawing done in
> C++ called by the window manager with the drawing code having full access
> to the underlying X window. This was great from Qubes POV because data
> could be stashed in the X window and used to decorate it. Specifically, the
> code in gui-daemon/gui-daemon/xside.c which proxies windows to dom0 sets
> the window properties _QUBES_LABEL and _QUBES_VMNAME in the window. These
> are the label color and name of the VM respectively. The Qubes plastik
> plugin reads them from the window and sets the border color/ window title
> prefix accordingly.
Exactly, very accurate description of the mechanism.
> The refactored system in KF5 is designed to decouple the X window from the
> decoration as far as possible and to promote the use of scripting to draw
> the decoration. One consequence of this design is that any property of the
> window that the decoration code wants to access must be exposed through a
> window managers 'client' interface which is static (doesn't support
> arbitrary runtime properties). This makes for a larger/more spread out diff
> than just changing the drawing code, and its unlikely that this code could
> be generalised enough to be taken upstream. The current version of the KF5
> plastik code is very basic and only uses C++ for drawing buttons. Since its
> now a theme rather that a native decoration it cant be modified in the same
> way as before.
Is 'theme' able to set anything on per-window basis (unlike the same for
every window)? Like some javascript or so? Or the only option for this
is going with native decoration?
> There are only 2 native decorations now, breeze and oxygen. Both
> unfortunately look worse than plastik, but they are better targets for
> adding this functionality to. It seems that no-one has managed to build an
> out of tree decoration plugin and even if they could, the code is bound to
> continue changing. IIRC the developers even advise against it.
What a pity... Out of tree decoration plugin for KDE 4 worked well for a
long time.
Does the same applies to themes (if answer to previous question is
positive)?
> So we are
> probably stuck with maintaining a patch.
>
> If we follow the existing approach then the task seems to be:
>
> - Expose the 2 Qubes properties through the kwin client interface
> - Pick a native decoration and hack it to use/obey the properties
>
> This second part is a bit vague because I haven't looked into it in great
> detail yet. I have hacked up some code to expose a mock qubes property
> through the client interface and I've just recently got it to build -
> instructions for fedora are badly out of date and testing it is
> challenging. I also hacked the window title to append a mock domain to see
> what it looked like, and the result wasn't terrible. These little
> experiments are in the very early stages at present.
>
> I wondered if there was a better way (or at least one with less friction)
> to implement what Qubes needs. I also wonder if we could allow more
> customisation of themes and/or even allow a choice of window
> decorations/label colors by the user (for color blind/visually impaired
> folks for example). If we could do this with minimum changes or changes
> that can be upstreamed then obviously that would be great.
>
> Currently when displaying remote windows kwin appends the remote
> machine/session id to the window title. It seems to me that this remoting
> is basically what Qubes is doing, just with a different model and
> nomenclature of what a remote session is. Certainly we can hijack this
> functionality easily enough and append the VM name treating it like a
> machine name. The code to do that should be pretty minimal.
That's a good idea. In fact VM name is something like remote machine
name :)
> I like this idea because I think if we then went to the kwin devs and asked
> to be able to style the <machine name>, for example to bold it, wrap it in
> [], put it before the window title or whatever, we would have a good case
> for it or at least getting code that exposes this through the client
> interface accepted upstream.
Does this means that "remote machine name" isn't exposed in that client
interface yet? Only already composed window title?
Can you paste a link for the client interface doc/spec/header, for
reference?
> That would make any patch we have to carry
> smaller. It also means that we could change the plugins that we ship so
> that they highlight the machine name as an option. That could likely go
> upstream as well. Users could use any decoration plugin they wanted if they
> were happy with the plain formatting. If we follow the VM=remote model to
> its logical conclusion then the [dom0] label would disappear from window
> titles too (as non-remotes) - which I think would be more intuitive as well
> :-)
>
> The second piece of the puzzle is the border coloring. While I was poking
> around the kwin code, I came across an old but potentially very interesting
> window property called _KDE_NET_WM_COLOR_SCHEME. This allows applications
> to set a color palette from a file for the windows decoration and appears
> to have been completely unused in the wild. I hacked up a program to set
> the property to point a local .colors file and at least under breeze it
> works to change the window border color . Full disclosure, it didn't under
> oxygen but I haven't investigated why. However for decorations that do
> respect the palette (or can be made to do so) this seems like a nice
> method, since it could allow e.g. the user to customise the rest of the
> palette/decoration, the desaturation for inactive windows, choose a high
> contrast/no green collection of palettes etc etc. Also, any changes or
> fixes made to better support this property would seem more likely to be
> accepted upstream.
In the worst case (or maybe not such bad?), decoration
plugin/theme/whatever can extract VM color from VM settings based on its
name. So having: a) VM name, and b) ability to run some code on per-window
basis would be enough.
But if there is simpler option (like reusing existing control for
decoration colors), of course it would be simpler to reuse them.
> There are of course other issues like forcing borders to be drawn
What do you mean by this? VM have very little control over window
properties, so advanced features like "border less dialog windows" or
such are out of VM control. Is there any situation where normal windows
get no border?
>, the
> system tray and task bar,
If standard "System Tray Protocol"[1] is still supported, it should just work. At
least in theory ;)
> and no doubt I'm still missing a lot of
> info/understanding.
>
> I will continue investigating and at some point I may
> reach out to the kwin devs to get their opinion/advice (I don't want to
> waste their time without a fuller understanding of the kwin code).
>
> Perhaps raising an issue for this would be a good idea, so we can link any
> investigations/notes/experiments etc together.
https://github.com/QubesOS/qubes-issues/issues/1784
[1]
https://specifications.freedesktop.org/systemtray-spec/systemtray-spec-latest.html
- --
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQEcBAEBCAAGBQJW0FKbAAoJENuP0xzK19csqVAH/0jPtAhwPvn0PLC3ln/SwGon
Vfw/kAwPWTICuZqZNoCA0SylKFA+FncCBqKilys5qiuqPBFyheIxHz7HB04qR4kA
6S7Lqm/l0hbzM4SUnveQ8TfOH93JMwZS/1EAlIQn0LqpNOE3d1Ut5JK435eJfsMz
x6D+C9LTmTskKeR0hCPC1E8Q5nAgKsNEABGl2Kq/KqKmHE4t7G7rUxpa6jZ+xAWf
kLu+Xvu8EkAhYt8ia1NOCLdgK8JvxSZl8KdDkT7555Zc+Kf+9kiwu5Z7la0iQlkV
GNrzA9+pfQQmDGQ70OPShDCd3PJldOYjswjd9N5yb9J3sze8vuat3d0rgDVuhLg=
=EH27
-----END PGP SIGNATURE-----