Open dwmw2 opened 8 years ago
You can already chose what screen to share in a multi-monitor setup. How does this scenario differ?
The dialog is a bit hidden since it appears after you click "Share my desktop" only when you actually have multiple monitors to choose from:
This scenario differs in that I don't actually have a second monitor. :)
I could go and get one and plug it in, or perhaps mess around with xrandr to try to enable an output from my video card which doesn't actually have a monitor attached, then get LibreOffice to display its presentation to that screen even though I can't (and don't want to) see it locally, and get SIPE to shadow it. But that's not quite the user experience I was after :)
Hrm... I think we implemented support in FreeRDP to also share a certain rectangular region, and also a certain app-window. I am thinking of how to best implement this kind of feature without making it LibreOffice-specific. ?:-I
One option might be to start a new X server (like Xvfb + shadow, or I suppose just Xvnc/Xrdp) and then let LibreOffice (or whatever) render to that as a separate display. You could even support things like emacs with M-x make-frame-on-display
rendering to the virtual screen.
We would probably still need to extend LibreOffice to be able to present to an arbitrary different X display instead of just the ones enumerated by Xrandr.
I don't know if it's possible to do it as an additional screen (e.g. :0.1
) on the existing display, or if X screens are a concept best forgotten about these days.
Haven't tried it, but xrandr seems to be able to extend one's desktop with virtual monitors:
If you look at the final comment, that isn't actually using a virtual monitor; it's (ab)using an existing output and adding a mode to it manually (since DPMS/etc won't have any if it's disconnected). Which kind of works but... ick :)
We'd want a real way to have virtual outputs, and ensure that they can be used for things like presentations but window managers would know not to use them.
You can create a virtual monitor in X that is 'off screen' and then have libreoffice present to that. I'm not sure how to hook that up to the network, but that has nothing to do with X.
$ xrandr ---fb 4864x3240 -setmonitor virtual 1024/256x768/192+3840+0 none
That appears to work; thanks! At least to a certain extent — I now have a virtual screen which Lync offers to share for me. I just can't see any other evidence that it exists, and can't see how to get anything to render to it. LibreOffice doesn't seem to notice it either, and still doesn't give me the multi-monitor options (and yes, I started LibreOffice since I know it needs that).
LibreOffice doesn't seem to notice it either, and still doesn't give me the multi-monitor options
It's probably in the way LibreOffice enumerates the available displays that it doesn't recognize the monitors created with xrandr. Pidgin (more precisely FreeRDP), which we see is able to detect the virtuals, uses this:
screens = XineramaQueryScreens(display, &numMonitors);
[1]
On LibreOffice side, the relevant code seems to be here, and how Application::GetScreenCount()
comes to its result can be traced to GtkSalSystem::countScreenMonitors()
which uses gdk_screen_get_n_monitors()
. One would have to dig even deeper and look how it's implemented in GDK in order to start fixing this.
It's not only LibreOffice - for example Cinnamon's display manager doesn't show the virtual monitors either. I get Keith implemented --setmonitor
into xrandr relatively recently (kudos for that) and applications will have to be updated in order to get full advantage of that feature.
Question remains what is the correct way to enumerate the connected monitors (both physical and virtual) in an X11 application nowadays. I'm not so sure if what FreeRDP does is really the best approach or there is some better API for that. @keith-packard, could you maybe give us some pointers?
There is some subtlety here. In some ways we don't want the additional virtual monitor to be noticed by the normal display manager. I don't want my desktop to suddenly be split across my real monitor and the fake one. For our purposes, it's only for external sharing. Not sure why Keith added it, and what the expected semantics are...
When LibreOffice is used on a system with multiple monitors, it has a presentation mode where it can display the presentation on one screen (usually an external display), and the presenter's notes on the other (typically on a laptop's own display).
It would be great to be able to use this mode in a Lync meeting — I see the LibreOffice 'presenter's notes' screen, while the real presentation is being shared.