New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for GNOME in dom0/GUI domain #1806

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

Comments

Projects
None yet
@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)
@tasket

This comment has been minimized.

Show comment
Hide comment
@tasket

tasket Mar 11, 2016

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

tasket commented Mar 11, 2016

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

@bnvk

This comment has been minimized.

Show comment
Hide comment
@bnvk

bnvk 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!

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

This comment has been minimized.

Show comment
Hide comment
@woju

woju Mar 29, 2016

Member

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
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

This comment has been minimized.

Show comment
Hide comment
@woju

woju Mar 30, 2016

Member

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).

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

This comment has been minimized.

Show comment
Hide comment
@mfc

mfc May 6, 2016

Member

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.

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.

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost May 7, 2016

What's the reason @bnvk stopped?

ghost commented May 7, 2016

What's the reason @bnvk stopped?

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek May 7, 2016

Member

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

Member

marmarek commented May 7, 2016

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

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

adrelanos May 17, 2016

Member

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

Member

adrelanos commented May 17, 2016

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 added a commit that referenced this issue Jun 7, 2016

@liilac

This comment has been minimized.

Show comment
Hide comment
@liilac

liilac 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).

liilac 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

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Jul 6, 2016

Member

Very interesting, can you paste a link? @ileyd

Member

marmarek commented Jul 6, 2016

Very interesting, can you paste a link? @ileyd

@liilac

This comment has been minimized.

Show comment
Hide comment
@liilac

liilac 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

liilac 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

This comment has been minimized.

Show comment
Hide comment
@Drubble

Drubble 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?

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

This comment has been minimized.

Show comment
Hide comment
Member

andrewdavidwong commented Jan 8, 2017

@mfc mfc referenced this issue Jan 31, 2017

Closed

create GSOC 2017 Ideas List #2607

2 of 2 tasks complete
@rootkovska

This comment has been minimized.

Show comment
Hide comment
@rootkovska

rootkovska Feb 16, 2017

Member

I would just like to note that this is currently a very low priority for us to migrate from Xfce to Gnome. At least for Qubes 4.0 and 4.1.

At this stage (4.0/4.1), even if we got somebody to offer patches, the core team would likely not have time to review the patches. A significantly more important task, related to GUI re-engineering is #833. Even thought it might seem that these should be fairly independent, in practice I highly doubt it. We will need some kind of a fallback mode for when GPU passthrough cannot be used on a given hardware in which case to use "software" GPU domain, as explained in #833. This, however, would most likely mean that GNOME would work horribly in such a mode (no GPU access), and so we would need to keep Xfce4. But maintaining two different environments would be a very resource-consuming and error-generating situation.

I suggest we reconsider this after we get #833 implemented. So, 4.2-ish.

Member

rootkovska commented Feb 16, 2017

I would just like to note that this is currently a very low priority for us to migrate from Xfce to Gnome. At least for Qubes 4.0 and 4.1.

At this stage (4.0/4.1), even if we got somebody to offer patches, the core team would likely not have time to review the patches. A significantly more important task, related to GUI re-engineering is #833. Even thought it might seem that these should be fairly independent, in practice I highly doubt it. We will need some kind of a fallback mode for when GPU passthrough cannot be used on a given hardware in which case to use "software" GPU domain, as explained in #833. This, however, would most likely mean that GNOME would work horribly in such a mode (no GPU access), and so we would need to keep Xfce4. But maintaining two different environments would be a very resource-consuming and error-generating situation.

I suggest we reconsider this after we get #833 implemented. So, 4.2-ish.

@v6ak v6ak referenced this issue May 9, 2018

Open

Full touchscreen support #3887

1 of 5 tasks complete
@v6ak

This comment has been minimized.

Show comment
Hide comment
@v6ak

v6ak May 9, 2018

Optional task: verify that touches work well with multi-monitor setup when using input proxy – regardless of screen positions and primary/secondary screen status. (It might require no implementation, but it should be verified if it works well. See #2281 (comment) for more details.)

v6ak commented May 9, 2018

Optional task: verify that touches work well with multi-monitor setup when using input proxy – regardless of screen positions and primary/secondary screen status. (It might require no implementation, but it should be verified if it works well. See #2281 (comment) for more details.)

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