Add support for GNOME in dom0/GUI domain #1806

Open
marmarek opened this Issue Mar 4, 2016 · 13 comments

Projects

None yet

10 participants

@marmarek
Member
marmarek commented Mar 4, 2016

Tasks here:

  • window decoration (colorful frames)
  • stripping unneeded components (file manager, automounting devices etc)
  • adjusting application menu
  • Qubes Manager integration (whatever it means)
@marmarek marmarek added this to the Release 4.0 milestone Mar 4, 2016
@bnvk bnvk was assigned by marmarek Mar 4, 2016
@tasket
tasket commented Mar 11, 2016

Has there been any open discussion of the need/desire for this?

@bnvk
bnvk commented Mar 14, 2016

@ttasket yes, there has been some discussion on the mailing lists, but ultimately it was a decision of core team to work towards this!

@woju
Member
woju commented Mar 29, 2016

Results of a preliminary research:

  • GTK+3 prefers client-side decorations (CSD), though it still draws decorations around windows which don't draw them the GTK+ way; the code used is the same, CSS based, but done by the window manager (Mutter)
  • one general problem with GTK is that some applications want to customise their headerbars (they add some buttons); the result is two sets of decorations; we probably can design our decorations to just include thin border (like in "Activities" gnome-shell panel) and a label with domain name
  • based on comment by someone on one of the gnome-related IRC channels, it's currently not possible to do it in Mutter without patching
  • we control both the client and server side (the window belongs to gui-daemon and we can supply an extension to gnome shell)
  • @marmarek doesn't want to convert gui-daemon into GTK+ application, because:
    • there are some problems foreseen (something around event ordering, which I didn't understand
    • he would have to do it
  • playing around gnome shell JS console proved unsuccesful (the guy on IRC was probably right)
  • the following code is an example of styling window decoration; instantiation of Gtk.HeaderBar seems to be mandatory, if not created, the decorations are drawn by Mutter at least in 3.10 (Debian 8)
  • messing around style providers to write custom implementation in Python (to generate dynamic colours, because labels may be changed) was also fruitless, because they use private interfaces and the public, documented interfaces don't really work
#!/usr/bin/env python3

import pdb
import gi
from gi.repository import Gdk, Gtk

def get_css():
    return ''.join(
        '''
        .qubes-label-{name} .header-bar,
        .qubes-label-{name} .titlebar,
        .qubes-label-{name}
        {{
            background: dark{name};
        }}
        '''.format(name=name)
        for name in ('red', 'green', 'blue')).encode('ascii')

def main():
    provider = Gtk.CssProvider()
    provider.load_from_data(get_css())
#   provider.load_from_file(FILENAME)

    Gtk.StyleContext.add_provider_for_screen(
        Gdk.Screen.get_default(),
        provider,
        Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION
    )

    win = Gtk.Window(title='titlebar')
    win.get_style_context().add_class('qubes-label-blue')

    header_bar = Gtk.HeaderBar()
    header_bar.set_title('header-bar')
    header_bar.set_subtitle('dom0')
    header_bar.set_show_close_button(True)
    win.set_titlebar(header_bar)

    button = Gtk.Button(label='Break to PDB')
    def on_clicked(widget, win=win): #, header_bar=header_bar):
        try:
            pdb.set_trace()
        except bdb.BdbQuit:
            Gtk.main_quit(widget)
    button.connect('clicked', on_clicked)
    win.add(button)

    win.connect('delete-event', Gtk.main_quit)
    win.show_all()
    Gtk.main()

if __name__ == '__main__':
    main()

# vim: ts=4 sts=4 sw=4 et
@woju
Member
woju commented Mar 30, 2016

Oh, and forgot to add: there are two programs which aid debugging GTK+ applications: GTK+ Inspector (>= gtk 3.14) and gtkparasite (for older, like 3.10 in jessie).

@mfc
Member
mfc commented May 6, 2016

from my understanding of the warsaw meetings, @bnvk is no longer attempting to implement this anymore, so I removing it from being assigned to him. I am assigning a help wanted label as well.

@bnvk bnvk was unassigned by mfc May 6, 2016
@mfc mfc added the help wanted label May 6, 2016
@dumbl3d0re

What's the reason @bnvk stopped?

@marmarek
Member
marmarek commented May 7, 2016

Turned out to be harder than "just create custom theme", see #1806 (comment)

@adrelanos
Member

This might not happen for Qubes R4. Source: Qubes lead engineer @marmarek:
https://groups.google.com/d/msg/qubes-devel/cberCRs_nFE/reNS1BKOBwAJ

@mfc mfc referenced this issue May 31, 2016
Open

[META] Tails-like functionality in Qubes #2024

0 of 6 tasks complete
@andrewdavidwong andrewdavidwong added a commit that referenced this issue Jun 7, 2016
@andrewdavidwong andrewdavidwong Track #1806 eb8a5fc
@ileyd
ileyd commented Jul 4, 2016

I will try find them later, but there are a set of patches to metacity to enable window labelling and colouring for the MLS policy under SELinux. I imagine that may be helpful as reference (SELinux window labels are stored the same way as Qubes ones).

@marmarek
Member
marmarek commented Jul 6, 2016

Very interesting, can you paste a link? @ileyd

@ileyd
ileyd commented Jul 6, 2016

@marmarek Sure

I believe there are two different sets of patches available publicly. Also, I think there are some for Openbox and XFCE as well.

Mind you these are OLD, from when there seemed to be a burst in interest in producing a functional MLS desktop with SELinux/X11, but I'm sure newer versions exist.

It might be worth emailing the authors to that effect (there are definitely still people working on MLS with SELinux).

Bugzilla page
Screenshot of demo

Different patch (mailing list thread)


Some related links
Presentation relating to the above
Notes on a previous SELinux summit, covering some similar things as above
SELinux wiki page on MLS

@Drubble
Drubble commented Jan 8, 2017

It'd be a shame if Qubes gave up on Gnome altogether. I really find it a much nicer DE than Xfce/KDE. Is it still on the roadmap?

@andrewdavidwong
Member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment