Shell – Sharing your desktop with Google Hangouts, dual monitor and GNOME Shell

displaygnome-shell

I have a laptop with a built-in screen and an attached monitor.

When I start a Google's video Hangout and share my desktop, I would like to be able to share only the attached screen, but I don't know how.

Right now I have two monitors: LVDS1 corresponds to my laptop's screen, which is configured as the secondary screen and DP1 which is my primary screen. But the problem still remains if I change my laptop's screen to be the primary screen.

$ xrandr
Screen 0: minimum 320 x 200, current 3286 x 1468, maximum 8192 x 8192
LVDS1 connected 1366x768+1920+700 (normal left inverted right x axis y axis) 344mm x 194mm
   1366x768      60.06*+
   1024x768      60.00  
   800x600       60.32    56.25  
   640x480       59.94  
VGA1 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
DP1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 475mm x 267mm
   1920x1080     60.00*+
   1280x1024     75.02    60.02  
   1152x864      75.00  
   1024x768      75.08    60.00  
   800x600       75.00    60.32  
   640x480       75.00    60.00  
   720x400       70.08  

Whenever I start sharing my desktop in the Hangout, only the built-in (smaller) screen is shared. Best thing would be to be able to chose which one to share, but if not, how could I share only the attached (bigger) screen?

I bet Google's Hangout is looking for a configuration file to choose which screen to share, but don't know which file it is.

NOTE

Using Fedora 20, x86_64, Linux 3.15.10-200, GNOME Shell 3.10.4-8, Firefox 31.

NOTE 2

Using Google Chrome makes Google Hangouts share both screens at the same time instead of only the laptop's screen, which I think is even worse. Still trying to find out how could I choose which screen to share.

Best Answer

Problem

It turns out there's already an open issue in the Chromium tracker about this annoying inconvenience. Existing options offered by Hangouts have major drawbacks:

  1. Share Entire Screen: If you have multiple screens (I have three) and share "Entire Screen", other people in the hangout won't be able to see anything.

  2. Share Application: If you only share a specific application, then:

    • You will have to manually switch to other apps while streaming by going back to hangouts and switching Screen Share on/off.
    • In some applications, extra windows (such as dialogs for preferences, menus, popups, etc.) won't be captured as part of the app you're sharing. And most of the times it's these dialogs you want to focus on.

Solution / workaround

A very good workaround is at Comment 18 of this same discussion, so all the credits should go to the comment's author.

I'll summarize the process here, which allows you to Share a Part/Area of your multi-monitor screen in Google Hangouts running in a Linux Machine.

  1. Open VLC in "Screen Capture" mode and tell it which part of your X11 screen you want it to capture, using the appropriate Screen Module command-line parameters. You can either do this through GUI configuration OR using the command line:

    vlc \
        --no-video-deco \
        --no-embedded-video \
        --screen-fps=20 \
        --screen-top=32 \
        --screen-left=0 \
        --screen-width=1920 \
        --screen-height=1000 \
        screen://
    
  2. If VLC complains about not being able to open screen://, please make sure you have correct module installed. For me, on ubuntu 19.10, I had to install an additional package vlc-plugin-extra-access by invoking apt install vlc-plugin-access-extra.

  3. Go back to Google Hangouts and share the newly opened VLC window, which now acts as your "portal" to the interesting part of your screen.

Important notes

  1. Move the VLC window away from the part of the screen you are capturing to avoid inception effects.

  2. Do NOT resize OR minimize the VLC window because it will affect the resolution of your screen share. If you want to get it out of your way while streaming to hangouts, just move it off-screen WITHOUT resizing it, or just pretend it's not there.

  3. The mouse pointer is not captured by VLC in linux. The author of the workaround suggests a solution for this as well: ExtraMaus, a simple C programs which creates a "clone" of your mouse, but visible by VLC.

[TL;DR] Explaining the values I chose in the example

  1. The screen:// parameter indicates we want to enable the Screen Capture module. You'll always use this parameter as is.

  2. The flags --no-video-deco and --no-embedded-video hide the window menu and video control toolbar respectively. You don't want to share these through Hangouts, so I suggest you always include these parameters.

  3. The --screen-fps=20 does not have to be 20. You can make it 30 or 10, since performance is primarily affected by how Chrome encodes the video stream.

  4. The area of the screen you want to captured follows the standard convention [--screen-top, --screen-left, --screen-width, --screen-height]. Supposing I had two monitors, each 1920x1080, giving a total 3840x1080 "virtual" screen when placed one next to the other, I could give the following coordinates:

    1. [ 0, 0, 1920, 1080] for my entire left screen
    2. [ 0, 1920, 1920, 1080] for my entire right screen
    3. [32, 0, 1920, 1000] for a part of my left screen which spans across its full width but trims 32 pixels from its top (where I usually have a window's title bar) and 1080-1000-32 = 48 pixels from its bottom (where I have my KDE taskbar).