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

Match client layout when using monitor mode #3749

Closed
TijZwa opened this issue Jan 26, 2023 · 3 comments
Closed

Match client layout when using monitor mode #3749

TijZwa opened this issue Jan 26, 2023 · 3 comments
Labels

Comments

@TijZwa
Copy link
Collaborator

TijZwa commented Jan 26, 2023

Is your feature request related to a problem? Please describe.
#3524 implements monitor mode. This works great. It would be very cool if the server can match the client's geometry, like Windows Terminal Server does.

Describe the solution you'd like
After the clients send it's ["desktop-size"] hello packet; create an XDUMMY display for each client display in a left-to-right order.
Then match the resolution of clients displays.

Describe alternatives you've considered
Using xrandr commands on the server to match the clients geo.

@TijZwa TijZwa added the enhancement New feature or request label Jan 26, 2023
@totaam
Copy link
Collaborator

totaam commented Jan 26, 2023

We need a new switch - not sure we should overload the resize command line option on the client to make this request.
Together with --desktop-fullscreen=true, we should do our best to take over the client's desktop area.

@totaam
Copy link
Collaborator

totaam commented Jan 30, 2023

There was already some support for this on the client side:

def _process_new_window(self, packet):
window = super()._process_new_window(packet)
if self.desktop_fullscreen and self._remote_server_mode in ("X11 desktop", "X11 monitor"):
from gi.repository import Gdk # @UnresolvedImport
screen = Gdk.Screen.get_default()
n = screen.get_n_monitors()
monitor = (len(self._id_to_window)-1) % n
window.fullscreen_on_monitor(screen, monitor)
log("fullscreen_on_monitor: %i", monitor)
return window

The commit above triggers now the same server code we already used in seamless mode for mirroring the client's monitor layout.
The key for clients is to specify desktop-fullscreen = True in the hello packet.
To configure the virtual monitors, the server will use the new (v4.4) monitors hello packet attribute or fallback to the legacy screen_sizes one.
@TijZwa can you give it a spin?

Here is an example of monitors definitions:

    monitors = {
        0 : {
            "name"      : "DP-2",
            "primary"   : True,
            "width"     : 3840,
            "height"    : 2160,
            "x"         : 3840,
            "y"         : 0,
            "mm-width"  : 708,
            "mm-height" : 398,
            "automatic" : True,
            },
        1 : {
            "name"      : "DP-0",
            "primary"   : False,
            "width"     : 3840,
            "height"    : 2160,
            "x"         : 0,
            "y"         : 0,
            "mm-width"  : 597,
            "mm-height" : 336,
            "automatic" : True,
            },
        }

@totaam
Copy link
Collaborator

totaam commented Mar 16, 2023

@TijZwa I assume that this works for you?

@totaam totaam closed this as completed Mar 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants