Github Issue #2136 - Xfce4 widget for displaying label/title of the currently focused AppVM

Github Issue #2136 - Xfce4 widget for displaying label/title of the currently focused AppVM

on Jun 30, 2016 (Joanna) Rutkowska writes:

Some user might want to have a fixed indicator (e.g. in the main top panel) which always displays the color (and title?) of the currently focused AppVM. This is to prevent GUI spoofing attacks where a red-bordered malicious windows draws a fake green-border-password-prompting windows inside itself, hoping the user would paste some sensitive password there. There are many ways to work around such attacks, e.g. via activation of expose-like effect (Present Windows in KDE, or the somehow less convenient version via Alt-Tab in Xfce4), or by manually moving the sensitive window around the screen. Still this method might be slightly more convenient.

Diagnosis & Analysis

This is going to be the start of major work. Almost all of Xfce4 panel plugins are written in C language. Time to say goodbye to Python for the time and flex C programming muscles. The documentation is scattered everywhere and not the best. There is no sample Qubes Xfce4 Panel plugin at the moment (as far as I know).

Solution

  • This is doable by a query of _NET_ACTIVE_WINDOW, then _QUBES_LABEL_COLOR and _QUBES_VMNAME for Window ID. A similar approach could be developed for Wayland in foreseeable future.
  • Marek recommends a new repository for Xfce4 plugins.

I have been working on the new repository, laying out the foundation for the Qubes OS specific Xfce4 Panel Plugins (it is currently private). The plugin suggested by Joanna is the most basic plugin which does something useful. Once (and if) it is approved, other plugins could be added to the repository for other purposes (e.g. XEN CPU load / RAM usage, Network download/upload rate of individual NetVMs, …)


It is necessary to decide, what should be the shape of panel plugin. Should it be Qubes logo in active window color? Should it be square? Should it be small? Large? Configurable? And should the title and/or label be in the panel itself or a tooltip. And what should happen if user clicks the widget. I believe it should open AppMenu and go directly to the active qube sub-menu. But all of these could wait. Since we want the initial repository to be light and easy for review.

1 Like

I think the color part could be integrated into Qubes Domains widget and change the color of the qube icon according to the currently active window.
But I’m not sure how to conveniently display the active window title.

1 Like

Yes. It is doable. And it is quiet easy. The window title could be a tooltip. But Qubes Domains is systray widget and they are square icons.

After this Xfce4 Panel Plugin is done, it should be possible to create another plugin similar to Xfce’s System Load monitor. But for total Xen CPU usage and RAM usage and per qube CPU load. Such plugins could consume very small area in the panel. Each indicator width is few pixels.

p.s.: And other users have other ideas for Qubes Domains icon:

While making Xfce plugins make it configurable based on user preference.

I understand that the purpose of this development is to create a simple example xfce plugin, but damn it seems redundant.

We can see that in the window buttons plugin: color and the name of the focused window. Maybe add domain name to the information displayed there?

Another way to do that would be to modify the window menu plugin. It already has an option to display current window’s icon, qubes domain color included. The only step missing is to add current domain name after the icon.

FYI there is generic (non-qubes) xfce sample plugin. They have sample python plugin too, check the readme.

Following this route, it should be possible to tackle issue 6654 too

I’ve been looking into the code for 5 minues or so to expand on this idea. It seems like xfce uses GtkWidget to add panel elements for the plugin:

struct _WindowMenuPlugin
{
  XfcePanelPlugin __parent__;

  /* the screen we're showing */
  WnckScreen         *screen;

  /* panel widgets */
  GtkWidget          *button;
  GtkWidget          *icon;

  /* settings */
  guint               button_style : 1;
  guint               workspace_actions : 1;
  guint               workspace_names : 1;
  guint               urgentcy_notification : 1;
  guint               all_workspaces : 1;

  /* urgent window counter */
  gint                urgent_windows;

  /* gtk style properties */
  gint                minimized_icon_lucency;
  PangoEllipsizeMode  ellipsize_mode;
  gint                max_width_chars;
};

It may be simple to add a text widget in there that would print currently focused window’s _QUBES_VMNAME value each time window menu plugin updates itself.

Yes. It could be the start of a new collection of Qubes specific Xfce Panel Plugins. I selected this specific one since it would be the simplest of all.

Yes. It could be shown on the panel itself or as tool-tips.

Yes. I thought about it. But I want to make the review for the 1st Xfce plugin easy. It will contain many auxiliary components (Makefiles, resources, …) which makes it hard for review. Currently we have a review bottleneck.

I used a much simpler one as the template to make the review easy (the repo is currently hidden). The Python sample plugin link is missing BTW.

Exactly. There are other nice ideas too.

1 Like