MeshCentral icon indicating copy to clipboard operation
MeshCentral copied to clipboard

linux Multiple desktops being detected as one

Open cristianadrielbraun opened this issue 3 years ago • 15 comments

Hi! I have this issue since the beginning of times, I just never reported it. I can confirm this happens in a Ubuntu 20.10 desktop, with an Nvidia 1080ti. Sadly I don't have a lot of dual monitor computers to try this haha.

When I connect, instead of getting two monitors recognized by the viewer, is just one very large monitor. You can see it here:

Image

I'm sure this is probably related to how Nvidia drivers manages the monitors, so I'm not sure if mesh central can do anything about it

cristianadrielbraun avatar May 29 '21 13:05 cristianadrielbraun

By default, you'll see all connected monitors in one view. Towards the bottom right, there should be a dropdown, at least when connecting to Windows devices, that lets you switch between them. It says "All Displays" by but you can select individual monitors from there as well.

PetieM avatar May 30 '21 02:05 PetieM

Nope. That's exactly the issue, I have no option to switch in this case

cristianadrielbraun avatar May 30 '21 08:05 cristianadrielbraun

That's very odd. I don't have a Linux desktop with multiple displays to test with though if I had to guess, I'd say that's likely the problem (and arguably better than the current behavior on multi-monitor Macs which just ignores the other displays entirely). Display selection might be limited to Windows hosts at the moment, though don't quote me on that.

For reference, here's a screenshot of a connection being made to my own Windows-based PC, also with a 1080 Ti:

image

PetieM avatar May 30 '21 23:05 PetieM

Bryan needs to look into this. I think it's been reported a few times that multi-monitor does not work on Linux and this needs to be fixed.

Ylianst avatar May 31 '21 17:05 Ylianst

On the console tab, can you run the following command: (ignore the cyclic input error) eval "require('monitor-info').getInfo(1000).then(function (m){sendConsoleText(JSON.stringify(m,null,1));});"

(substitute the UID of whatever the currently logged in user is, if it isn't 1000)

krayon007 avatar Jun 01 '21 16:06 krayon007

eval "require('monitor-info').getInfo(1000).then(function (m){sendConsoleText(JSON.stringify(m,null,1));});"

Hi! I tried this but I got this error:

Command returned an exception error: TypeError: undefined not callable (property 'trim' of [object Function])

I just copied and pasted your command, is that ok?:

image

Just in case, my user UID is 1000 indeed

cristianadrielbraun avatar Jun 01 '21 16:06 cristianadrielbraun

I just tried this on both a Windows PC and a Mac, both of which have multiple monitors connected.

Windows:

[
 {
  "left": 0,
  "top": 0,
  "right": 1024,
  "bottom": 768
 }
]

Mac:

Command returned an exception error: TypeError: undefined not callable (property 'getInfo' of [object Object])

I also ran it on my only Linux machine that has a UI, a Raspberry Pi in this case, but it doesn't have a monitor connected at all and it only has one virtual desktop so I'm not sure if that's going to be helpful or not.

Linux:

Command returned an exception error: _GenericMarshal.CreateVariable(): Invalid Parameter

PetieM avatar Jun 08 '21 18:06 PetieM

I'm also experiencing this issue on Linux computers and I have many with dual display. I'm running MeshCentral 1.0. I would love this feature to exist for Linux machines and happy to test.

map7 avatar Mar 22 '22 23:03 map7

The crux of the issue, is that currently on linux, (from what I've seen on my systems at least), is that when I query the displays from the X server, it gives me a single virtual display that spans all the displays. I need to figure out how to get it to give me each display independently.

krayon007 avatar Mar 23 '22 03:03 krayon007

On the command line of the linux client itself the command 'xrandr' should give individual displays, maybe the meshagent isn't using this to pass back the individual displays to the meshcentral server.

map7 avatar Mar 23 '22 03:03 map7

Using xrandr doesn't really help because I need to interact with the shared memory of the display object of the X server to do screen capture. So I need to be able to have the x server give me individual display objects.

krayon007 avatar Mar 23 '22 05:03 krayon007

@krayon007 Is using xcb an option?

I have a small sample code that reports the display servers, monitors for each one and then the shared memory for each screen. It's not clean, but I can work on it if using xcb, xcb-randr, xcb-shm is an option.

Or maybe this will give you some ideas as how to fix this issue for Linux?

Here is the snippet.

hojjatabdollahi avatar Jul 22 '22 19:07 hojjatabdollahi

Just checking to see if there are any updates on this. This would be an incredibly useful feature to have. I have about 10 users and all of us run Linux machines with multiple monitors. We would all greatly appreciate this feature.

pravardhanreddy avatar May 07 '23 19:05 pravardhanreddy

Unfortunate issue. Workaround is to mirror displays temporarily.

DovieW avatar Dec 24 '23 22:12 DovieW

I don't have a lot of technical insights about this, but I'm almost sure that the problem is related to how Linux actually "reports" the monitors. The system is not actually reporting two monitors, it's just reporting one big screen with "co-ordinates", something like: from pixel x to 1920, this image will be displayed, and from 1921 to xxxx, this other image. So it actually is just one big screen, so I guess the "fix" would need a complete re-implementation of this for Linux. Given the repo is barely maintained anymore and the fact that Linux represents a very small percentage of users, i don't have a lot of hopes. Meshcentral still rocks, regardless of this!

cristianadrielbraun avatar Jan 26 '24 18:01 cristianadrielbraun