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

xfreerdp fullscreen enhancements #2426

Merged
merged 1 commit into from
Mar 12, 2015
Merged

Conversation

bjcollins
Copy link
Contributor

Remove override redirect flag for fullscreen with keyboard grab enabled. Window manager should always know about the main window.

Small cleanup of passing around decorations flag.
Limit PercentScreen to single monitor vs. entire desktop. IMO - this is better behavior in a multimonitor environment.

Handle fullscreen windows better:

  1. Ensure that size hints are set to allow resizing before setting a window to fullscreen as some window managers do not behave properly.
  2. Handle fullscreen toggles without destroying and recreating window.
  3. Use NET_WM_STATE_FULLSCREEN Extended Window Manager Hint for fullscreen functionality
  4. Use the NET_WM_FULLSCREEN_MONITORS Extended Window Manager Hint when appropriate
  5. When a single monitor fullscreen is requested - use the current monitor(as determined from mouse location)
  6. Handle cases where there is no local monitor at coordinate 0,0. The Windows server expect there to be a monitor at this location, so we maintain offset if necessary between our local primary monitor and the server side primary monitor located at 0,0.

I did take some of this from another pull request from a long time ago, but added things like handling when no local monitors have a 0,0 coordinate. Please provide comments/suggestions/thoughts.

…ed. Window manager should always know about the main window.

Small cleanup of passing around decorations flag.
Limit PercentScreen to single monitor vs. entire desktop. IMO - this is better behavior in a multimonitor environment.

Handle fullscreen windows better:
1. Ensure that size hints are set to allow resizing before setting a window to fullscreen as some window managers do not behave properly.
2. Handle fullscreen toggles without destroying and recreating window.
3. Use NET_WM_STATE_FULLSCREEN Extended Window Manager Hint for fullscreen functionality
4. Use the NET_WM_FULLSCREEN_MONITORS Extended Window Manager Hint when appropriate
5. When a single monitor fullscreen is requested - use the current monitor(as determined from mouse location)
6. Handle cases where there is no local monitor at coordinate 0,0. The Windows server expect there to be a monitor at this location, so we maintain offset if necessary between our local primary monitor and the server side primary monitor located at 0,0.
@freerdp-bot
Copy link

Can one of the admins verify this patch?

@bmiklautz
Copy link
Member

@freerdp-bot test

@freerdp-bot
Copy link

Refer to this link for build results (access rights to CI server needed):
https://ci.freerdp.com//job/PullRequestTester/83/
Test PASSed.

@bmiklautz
Copy link
Member

@bjcollins what window managers did you test this with?

@freerdp-bot
Copy link

Refer to this link for build results (access rights to CI server needed):
https://ci.freerdp.com//job/PullRequestTester/84/
Test PASSed.

@bjcollins
Copy link
Contributor Author

@bmiklautz I tested against metacity on CentOS 6.6. This follows along similar thinking to Change Request 1392 and uses some of its code, but since that CR was never acted on and I am actively looking at xfreerdp again - I decided to push my own change request. I believe in using the EWMH functionality for fullscreen and multimonitor support vs. override_redirects.

@Hobby-Student
Copy link
Contributor

Can't test the patch atm, but would really be happy to see it merged (using #1392 for some clients)

awakecoding added a commit that referenced this pull request Mar 12, 2015
xfreerdp fullscreen enhancements
@awakecoding awakecoding merged commit 719a0fd into FreeRDP:master Mar 12, 2015
@nfedera
Copy link
Contributor

nfedera commented Mar 16, 2015

@bjcollins Have you tested with /smart-sizing?

}

window->fullscreen = TRUE;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be window->fullscreen = fullscreen ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. It looks like it should. I do not think that variable is actually used by anything, which is probably why it got overlooked and did not cause me any functional problems.

@bjcollins
Copy link
Contributor Author

@nfedera I have not tested with smart-sizing(that is kind of new functionality to me and I missed it and how my changes affected it). Now that this patch has been merged, I will plan to work on a new patch to take into account smart-sizing.

@nfedera
Copy link
Contributor

nfedera commented Mar 16, 2015

@bjcollins very cool! However,I think smart-sizing was already partly broken before your commit. AFAIK at commit 415a0a1 it was still in perfect shape.

@nfedera
Copy link
Contributor

nfedera commented Mar 16, 2015

@bjcollins Important for smart sizing is that it works with full screen toggle. That is if you start your session with /size:1024x768, then resize the window to your likings, press ctrl+alt+enter to go into full screen, the session must be scaled accordingly. If you press ctrl+alt+enter again to get out of fullscreen the window should have the same smart-sized dimensions it had before toggeling.
Therefore in the code one should be aware that xfc->width is the rdp session width and not necessarily the width of the window which is in xfc->window->width ;)

In addition it is also possible to specify the initial scaled size using /smart-sizing:WidthxHeight
E.g. xfreerdp /smart-sizing:1024x768 /size:800x600 would create a 800x600 rdp session but display it scaled in a 1024x768 sized window.

@nfedera
Copy link
Contributor

nfedera commented Mar 16, 2015

@bjcollins We do also have code for pinch/zoom and panning. Therefore, xfc->window->width is also not necessarily the width to be scaled to. We might be scaling, but the window has a fixed size (think of your smart phone's display as the window and the rdp session is the picture you're zooming). This is the reason why we need the separate xfc->scaledWidth and xfc->scaledHeight members.

@bjcollins
Copy link
Contributor Author

@nfedera thanks for the information. That all makes sense to me. I doubt I will get to it this week, but I will try to look into smart sizing soon and at the least try to submit a patch to correct my changes to also take into account smart sizing.

@nfedera
Copy link
Contributor

nfedera commented Apr 10, 2015

@bjcollins I've created PR #2530 which reverts your PR and fixes the issues which were already partly broken before your commit.
Once it gets merged it would be cool if you would redo your PR based on the new master coded considering smart-sizing. Also see https://github.com/FreeRDP/FreeRDP/wiki/Quality-Assurance-(QA)#smart-sizing

@nfedera
Copy link
Contributor

nfedera commented Apr 14, 2015

@bjcollins Have you tested full screen toggling (as in ctrl+alt+enter) with your patch ?

settings->MonitorCount = nmonitors;

vWidth = vHeight = 0;
settings->DesktopPosX = maxWidth - 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If that was the only real use for the variable maxWidth it should have been be removed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. That variable is no longer used and should be completely removed to simplify the code.

@bjcollins
Copy link
Contributor Author

@nfedera Yes. I tested with fullscreen toggle to be sure that I could remove the bit of code to destroy the window and create a new one every time there is a fullscreen toggle sequence. Have you seen issues with this?

@nfedera
Copy link
Contributor

nfedera commented Apr 14, 2015

@bjcollins there are of course issues with smart-sizing which was initialized in xf_create_window . Probably also if the setup changes because xf_create_window now is not called anymore which did also call xf_detect_monitors before. I'm currently looking into this but the complete x11 code (not talking about your patch) is really messy and needs a proper redesign IMHO.

@bjcollins
Copy link
Contributor Author

@nfedera I agree that the X11 code is generally messy. It may make sense to put the destroy/create window bit back if the smart-sizing stuff is too intertwined into those other functions right now. I do not believe that change was a requirement for the user facing functionality in my patch, it just seemed like unnecessary steps to completely destroy and recreate the window so that is why I removed it.

@nfedera
Copy link
Contributor

nfedera commented Apr 14, 2015

@bjcollins Is it just me or has your pr also broken /span and /multimon ?

[edit]
Ok it only seems to be broken with icewm ...

@bjcollins
Copy link
Contributor Author

@nfedera I just looked at the source real quickly for icewm and it does not seem to support the EWMH fullscreen bits, so that is probably the problem there. I would not expect it to just totally not work, were you only seeing an issue in certain scenarios or could you never get it to display on more than one monitor at all?

@nfedera
Copy link
Contributor

nfedera commented Apr 16, 2015

@bjcollins it seems that also simple /f is now broken too.
If my mouse is on the right monitor xfreerdp is displayed on the left monitor but with the dimensions of the right monitor and vice versa.
I guess this happens if screen 0 is right of screen 1.
Can you confirm this issue ?

@bjcollins
Copy link
Contributor Author

@nfedera Testing this functionality was a big part of my PR, so I do not think it is completely broken. However, I do not doubt that that you are having a problem. In an ideal situation, you would be using Xinerama and the WM would support the EWMH(mainly NET_WM_STATE_FULLSCREEN and NET_WM_FULLSCREEN_MONITORS) and I mainly tested with that. So, to help me understand the code path that is being taken can you confirm:

a) whether or not you have compiled xfreerdp with xinerama support
b) the wm you are using and whether it supports the EWMH

I will look at this later today, but wanted to see if I can learn a little more about your environment.

@nfedera
Copy link
Contributor

nfedera commented Apr 16, 2015

@bjcollins I'm running ubuntu 14.04 on an iMac. The native display is 2560x1440. I've connected an Asus 1920x1080 monitor via ThunderboldToDVI and positioned it left of the iMac.
For debugging I change to the console (Ctrl+Alt+F1) log in as a diferent user and start X11 like this:
startx /usr/bin/xterm -- /usr/bin/X11 :2
Now I dow the screen setup via xrandr: xrandr --output eDP --auto --rightof DisplayPort-3
(eDP is the native display and DisplayPort-3 is the ThunderBold)
At this point I can easily start different window managers and test.
The problem described happens with xfce4 and it was working before this PR.

However, don't bother looking into it.
I'm almost done with the new PR and we can test and improve starting from there ....

Thanks

[EDIT]
It also happens without the above magic when logging in from within Ubuntu's light-dm, choosing xfce session, and using xfce's display gui to configure the display positions.

@nfedera
Copy link
Contributor

nfedera commented Apr 16, 2015

@bjcollins Here it is #2547
Please test and check if it breaks any of the features you've added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants