Skip to content
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

Make sharing a single window work with Jitsi in Firefox #5789

Closed
marmarek opened this issue Apr 29, 2020 · 18 comments
Closed

Make sharing a single window work with Jitsi in Firefox #5789

marmarek opened this issue Apr 29, 2020 · 18 comments

Comments

@marmarek
Copy link
Member

The problem you're addressing (if any)
Jitsi (and other video conference software) allows desktop sharing. This includes convenient feature of sharing a single window. When running under Qubes, only "entire screen" option is present. Of course this "entire screen" in practice includes only content from that single VM.

Describe the solution you'd like
Adjust gui-agent-linux to set necessary metadata to enable enumerating windows/applications in a format that normal window manager does.

Where is the value to a user, and who might that user be?
More useful desktop sharing.

Additional context
Firefox code using for window enumeration: https://hg.mozilla.org/mozreview/gecko/file/tip/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_x11.cc
Specifically this is interesting:

  // Iterates through |window| hierarchy to find first visible window, i.e. one
  // that has WM_STATE property set to NormalState.
  // See http://tronche.com/gui/x/icccm/sec-4.html#s-4.1.3.1 .
  ::Window GetApplicationWindow(::Window window);

Windows within Qubes VMs do not have WM_STATE property. According to linked documentation there, it is responsibility of a window manager (gui-agent in this case).

Workaround

Manually set WM_STATE property on a window you want to share:

xprop -f WM_STATE 32c -set WM_STATE 1

(and click on the window)

Relevant documentation you've consulted

http://tronche.com/gui/x/icccm/sec-4.html#s-4.1.3.1

Related, non-duplicate issues
A list of links to other bug reports, feature requests, or tasks in the qubes-issues tracker. Do not describe any other unreported bugs, features, or tasks here.

@marmarek marmarek added T: enhancement C: gui-virtualization P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. labels Apr 29, 2020
@marmarek marmarek added this to the Far in the future milestone Apr 29, 2020
@Rudd-O
Copy link

Rudd-O commented May 1, 2020

It does seem like WM_STATE is a property that the window manager ought to respect / set.

Alternatively how about we push forward to Wayland?

@marmarek
Copy link
Member Author

marmarek commented May 1, 2020

It does seem like WM_STATE is a property that the window manager ought to respect / set.

Yes, exactly. And in case of AppVM, window manager = qubes-gui-agent.

Alternatively how about we push forward to Wayland?

This is tracked here: #3366

@xaki23
Copy link

xaki23 commented May 25, 2020

as a sidenote: this works for google meet on firefox too.
thanks!

@iamahuman
Copy link

iamahuman commented Jun 27, 2020

This also affects Wine; specifically, there's a few seconds of delay before a window is opened or closed.

This is what I'm using as a workaround: https://gist.github.com/iamahuman/34bd91b9815fb2cc5de72028d39d223c

The script acts as a "stub" window manager and handles the WM_STATE transition which the GUI agent lacks.

I shall perhaps also add this to https://github.com/Qubes-Community/Contents sooner or later...

@qubesos-bot
Copy link

Automated announcement from builder-github

The package gui-agent-linux has been pushed to the r4.1 testing repository for the CentOS centos8 template.
To test this update, please install it with the following command:

sudo yum update --enablerepo=qubes-vm-r4.1-current-testing

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The package pulseaudio-qubes-4.1.15-1.fc32 has been pushed to the r4.1 testing repository for dom0.
To test this update, please install it with the following command:

sudo qubes-dom0-update --enablerepo=qubes-dom0-current-testing

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The package qubes-gui-agent_4.1.15-1 has been pushed to the r4.1 testing repository for the Debian template.
To test this update, first enable the testing repository in /etc/apt/sources.list.d/qubes-*.list by uncommenting the line containing buster-testing (or appropriate equivalent for your template version), then use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The component gui-agent-linux (including package pulseaudio-qubes-4.1.15-1.fc32) has been pushed to the r4.1 testing repository for the Fedora template.
To test this update, please install it with the following command:

sudo yum update --enablerepo=qubes-vm-r4.1-current-testing

Changes included in this update

marmarek pushed a commit to QubesOS/qubes-gui-agent-linux that referenced this issue Jan 8, 2021
The WM_STATE property is defined by ICCCM, and should be set by the
window manager to indicate the current state of a client window.  It
is used for two primary purposes:

- A client can examine the property to determine whether the client's
  own window is conceptually "visible" (NormalState) or "hidden"
  (IconicState).

- A client can look for this property on other clients' windows, in
  order to distinguish application windows (which have the WM_STATE
  property) from windows created by the window manager.

One notable program that makes use of the latter feature is Mozilla
Firefox, which allows WebRTC sites to perform "screen sharing" - but
in order to share a single window rather than the whole screen, that
other window must have the WM_STATE property.

We want to set this property when a client window is mapped, and unset
it when the window is unmapped (withdrawn).  In Qubes, we pretend that
the window is always in normal state, regardless of whether it's
currently minimized/iconified/shaded in dom0.

Note that this property shouldn't be set for override-redirect
windows, since those are beyond the window manager's purview.

(cherry picked from commit 585fa45)
Notes from origin:
    Fixes QubesOS/qubes-issues#5789
@qubesos-bot
Copy link

Automated announcement from builder-github

The package gui-agent-linux has been pushed to the r4.0 testing repository for the CentOS centos8 template.
To test this update, please install it with the following command:

sudo yum update --enablerepo=qubes-vm-r4.0-current-testing

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The package gui-agent-linux has been pushed to the r4.0 stable repository for the CentOS centos8 template.
To install this update, please use the standard update command:

sudo yum update

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The component gui-agent-linux (including package pulseaudio-qubes-4.0.34-1.fc32) has been pushed to the r4.0 stable repository for the Fedora template.
To install this update, please use the standard update command:

sudo yum update

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The package qubes-gui-agent_4.1.16-1+deb10u1 has been pushed to the r4.1 stable repository for the Debian template.
To install this update, please use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The package gui-agent-linux has been pushed to the r4.1 stable repository for the CentOS centos8 template.
To install this update, please use the standard update command:

sudo yum update

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The component gui-agent-linux (including package pulseaudio-qubes-4.1.16-1.fc32) has been pushed to the r4.1 stable repository for the Fedora template.
To install this update, please use the standard update command:

sudo yum update

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The package pulseaudio-qubes-4.1.16-1.fc32 has been pushed to the r4.1 stable repository for dom0.
To install this update, please use the standard update command:

sudo qubes-dom0-update

Or update dom0 via Qubes Manager.

Changes included in this update

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