Bug 391778 - FreeRDP second Full-Screen Monitor is hidden
Summary: FreeRDP second Full-Screen Monitor is hidden
Status: RESOLVED NOT A BUG
Alias: None
Product: kwin
Classification: Plasma
Component: xrandr (show other bugs)
Version: 5.12.1
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-12 20:22 UTC by Robert Cheramy
Modified: 2018-03-21 20:14 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
xprop, xwininfo, qdbus output and screenshot (1.34 MB, application/x-xz)
2018-03-14 09:16 UTC, armin.novak
Details
Output of kwin debug messages (29.33 KB, text/plain)
2018-03-16 21:09 UTC, Robert Cheramy
Details
Output of xev -root when Runing freerdp in Fullscreen mode with multiple Monitors (21.53 KB, text/plain)
2018-03-18 09:13 UTC, Robert Cheramy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Cheramy 2018-03-12 20:22:01 UTC
When using freerdp in multiple monitor mode (Full Screen), the second monitor is not displayed under KDE. This works with other Window Managers (fvwm, openbox, gnome, cinnamon).
A bug is filled on the FreeRDP side:
https://github.com/FreeRDP/FreeRDP/issues/2707

It would be great if KWin Developers and FreeRDP Developers could talk together about the issue and find a fix for it :-)
Comment 1 jat255 2018-03-12 20:24:28 UTC
I'm also experiencing this issue.
Comment 2 Martin Flöser 2018-03-12 20:44:09 UTC
I read through the complete bug report on github and don't see anything indicating that this is a bug in KWin. What we see in the bug report is FreeRDP having problems with fullscreen and with many, many window managers. In fact there are workarounds command line switches like "openbox". This is for me a sign that the issue must be with FreeRDP. Especially given that standard X11 functionality like checking in _NET_SUPPORTED what the WM provides has not been implemented.

From time to time it happens that bugs are reported that KWin is wrong. Every time when we investigated this, we observed, that:
a) the client is wrong
b) if other window managers made the client work, it was KWin implementing the specs correctly

I'm sorry, but my experience tells me, that this is not a bug in KWin. If it were a bug in KWin, there would be other applications affected as well.

So until someone proves me that KWin is wrong, by e.g. providing a test case which highlights the wrong behavior, I'm following my instincts and set this bug as invalid.

Unfortunately I'm not able to try to reproduce to show that FreeRDP is wrong as I don't have any server to connect to.
Comment 3 Martin Flöser 2018-03-12 20:54:27 UTC
Furthermore I want to add that relying on the _NET_WM_FULLSCREEN_MONITORS is quite questionable. To quote the spec: "The indices are from the set returned by the Xinerama extension."

Now there is just no xinerama extension used anymore. Today we use xrandr to configure multiple screens. I have no idea what these indices are that FreeRDP uses, but KWin (and probably any other window manager) doesn't know anything of Xinerama. KWin does have support for this protocol, but that's probably just for legacy support.
Comment 4 Robert Cheramy 2018-03-12 22:13:28 UTC
Thank you for taking your time to evaluate the Bug.

I've tried to look into the source code of FreeRDP, but I have no idea of X11 Programming an gave up in the end. I'll have to wait until FreeRDP Developers fix this.
Comment 5 armin.novak 2018-03-13 09:00:24 UTC
There seem to be some misunderstandings in this issue.
I'm a developer of FreeRDP, so let me clear up some things:
* The 'openbox' switch is not really part of freerdp but was suggested by a contributor in that thread.
This was due to another bug we had in FreeRDP with fullscreen switching, when we migrated to _NET_SUPPORTED et al. That one has already been dealt with.

* There still is the `/multimon:force` switch, which forces old X11 behaviour for a WM with broken support for the new standards. (this software is used on many custom distris, some have really weired configurations)

* We do support _NET_SUPPORTED, as already stated. The other paths are a fallback if the WM does not support these.

* Testing this with xfreerdp is quite easy, you only need to install `xrdp` locally and connect to it with `xfreerdp /v:localhost /multimon` (<ctrl>+<alt>+<Return> switches between fullscreen and window mode)

Maybe I'm missing something here, but I've tested the current 2.0 release candidates and master against debian and fedora with cinnamon, openbox, xfce, gnome and kde/plasma.
Only kde/plasma exposes these issues.
Comment 6 Martin Flöser 2018-03-13 18:14:18 UTC
I'm not going to test, sorry. I don't have the time to get this setup as I lack the FreeRDP domain knowledge.

What I would be interested in, is:
 * screenshot of the issue
 * xprop and xwininfo of the window
 * output of qdbus org.kde.KWin /KWin supportInformation
Comment 7 Martin Flöser 2018-03-13 18:43:44 UTC
@armin: do you really use _NET_WM_FULLSCREEN_MONITORS? If yes, I would like to ask how you think that is supposed to work given that no X server uses xinerama any more. It's till exposed, but in truth it's xrandr. I assume the problem here is that the indices don't match and that it might be pure chance in the other DEs to work.
Comment 8 armin.novak 2018-03-14 08:42:57 UTC
(In reply to Martin Flöser from comment #7)
> @armin: do you really use _NET_WM_FULLSCREEN_MONITORS? If yes, I would like
> to ask how you think that is supposed to work given that no X server uses
> xinerama any more. It's till exposed, but in truth it's xrandr. I assume the
> problem here is that the indices don't match and that it might be pure
> chance in the other DEs to work.

Yes, we use that for the multimonitor fullscreen case.
I (or more precisely a colleague) have not found another way to tell the WM to
a) set a window fullscreen and
b) which monitors to use for that

I understand that from a WM perspective multi monitor handling is done with the randr extension and xinerama, but I could not find anything replacing this atom.

I'd be more than happy to fix that in a more modern way, but the depths of X11 still have surprises whenever touched. (as I do that not really often)
Comment 9 armin.novak 2018-03-14 09:16:58 UTC
Created attachment 111393 [details]
xprop, xwininfo, qdbus output and screenshot

Attached the desired information.
The screenshot shows that the window is fullscreen only on the first (left) of a 2 monitor setup.
Comment 10 Martin Flöser 2018-03-14 18:31:49 UTC
(In reply to armin.novak from comment #8)
> I'd be more than happy to fix that in a more modern way, but the depths of
> X11 still have surprises whenever touched. (as I do that not really often)

I would create a dedicated window for each screen.
Comment 11 Martin Flöser 2018-03-14 18:47:48 UTC
What I noticed is that the xprop output is lacking the fullscreen monitor property.

This should create a debug message:
"fullscreenMonitors update failed. request higher than number of screens."

Could someone please enable the Debug category for KWin and check xsession-errors for this message?
Comment 12 Robert Cheramy 2018-03-16 21:09:37 UTC
Created attachment 111453 [details]
Output of kwin debug messages

Here is the Output of KWIN with Debug activated (I activated everything using kdebugsettings) when starting freerdp in fullscreen mode. I also checked .xsessions-error (which is empty as I started kwin --replace from the console. There are no other messages generated ther when I start freerdp), and did not find the error "fullscreenMonitors update failed. request higher than number of screens.".
Comment 13 Martin Flöser 2018-03-17 05:20:17 UTC
Thanks for the debug output.
Comment 14 Martin Flöser 2018-03-17 10:41:39 UTC
The combination of the xprop and the debug output would mean that KWin is not getting the callback from our windowing system library. I checked on build.kde.org and the code area is not test covered. I'll try to add a test case.
Comment 15 Martin Flöser 2018-03-17 11:00:39 UTC
I found a bug explaining why the property is not set, but it would not explain why the window is not shown correctly
Comment 16 Martin Flöser 2018-03-17 11:03:19 UTC
(In reply to Martin Flöser from comment #15)
> I found a bug explaining why the property is not set, but it would not
> explain why the window is not shown correctly

-> BUG #391960
Comment 17 Martin Flöser 2018-03-18 08:10:01 UTC
Could someone please run:
xev -root

then start freerdp and bring it into the broken state and attach the output of xev? This should show which events are sent from freerdp, maybe that helps to see what's going on.
Comment 18 Robert Cheramy 2018-03-18 09:13:17 UTC
Created attachment 111472 [details]
Output of xev -root when Runing freerdp in Fullscreen mode with multiple Monitors

Hope this helps.
Comment 19 Martin Flöser 2018-03-18 10:42:10 UTC
> Hope this helps.

Yes it does, now I understand the problem.

FreeRDP first sends the _NET_WM_FULLSCREEN_MONITORS and afterwards the change to fullscreen. Due to BUG #391960 this is not applied when FreeRDP switches to fullscreen. If the command process would be the other way around, I'm quite certain it would work. But I'm also quite confident that my fix to BUG #391960 will fix the problem.
Comment 20 armin.novak 2018-03-19 10:53:47 UTC
You're correct, setting fullscreen first and the monitors afterward is working with kwin too.

(In reply to Martin Flöser from comment #19)
> > Hope this helps.
> 
> Yes it does, now I understand the problem.
> 
> FreeRDP first sends the _NET_WM_FULLSCREEN_MONITORS and afterwards the
> change to fullscreen. Due to BUG #391960 this is not applied when FreeRDP
> switches to fullscreen. If the command process would be the other way
> around, I'm quite certain it would work. But I'm also quite confident that
> my fix to BUG #391960 will fix the problem.
Comment 21 Robert Cheramy 2018-03-21 20:14:45 UTC
Thank you very much Martin for your help!