linuxmint / mint21.1-beta

BETA Bug Squash Rush
7 stars 0 forks source link

cinnamon: Monitor position lost after disabling and re-enabling the monitor #52

Closed tethragon closed 1 year ago

tethragon commented 1 year ago

This is a bug from mint 21 which is still present in mint 21.1 beta.

My dual monitor setup is as follows:

image

When I don't need second monitor, I deactivate it:

image

When I enable again my second monitor, it always defaults at the wrong position and not the one I had previously set:

image

It is counterproductive to always set my monitors' positioning when I enable and disable them. My settings should be saved somehow and they are not. I think this is a bug.

clefebvre commented 1 year ago

Hi @tethragon,

Can you turn off your monitor physically instead of deactivating? Does that work as a workaround?

Let me know. I'm not only trying to find a workaround for this, if this work it will tell me something relevant about the issue.

tethragon commented 1 year ago

Hi @tethragon,

Can you turn off your monitor physically instead of deactivating? Does that work as a workaround?

Let me know. I'm not only trying to find a workaround for this, if this work it will tell me something relevant about the issue.

If I turn off 2nd monitor physically without deactivating from display manager, then the system does not understand that the 2nd monitor is turned off and behaves like the 2nd monitor is on. This means that the cursor escapes to the left (where the 2nd monitor would be). Also app windows can be transferred to the left, while 2nd monitor is turned off. In conclusion, turning off physically 2nd monitor does not work as workaround. You need to turn it off from display manager, so the system can behave properly. Thank you for your time investigating this matter.

clefebvre commented 1 year ago

You're welcome. The way monitor configuration works changed with the mutter rebase.. I'm not familiar with the new system.

In the old one the configuration for one monitor would be distinct than the configuration for both of them, so I would expect two sets of configuration to be saved here. This would have been in .config/monitors.xml.

I don't know if this is still the case. I'll ask @mtwebster to look into this.

mtwebster commented 1 year ago

Just to be clear, this was not an issue in 20.x?

How are these monitors connected - hdmi or display-port?

I'm not certain but I think turning off a monitor is 'modifying the current configuration' and not a separate one (like if you physically disconnect the monitor). I thought that was also the case in 20.x but I never really operated with disabled monitors so I'm not sure.

The behavior when turning off a monitor is correct I think (or at least expected).

tethragon commented 1 year ago

Just to be clear, this was not an issue in 20.x?

It was a reported issue in 20.x, 21 and 21.1 beta.

How are these monitors connected - hdmi or display-port?

Display port- both. I have tried hdmi also, problem still remains.

This would have been in .config/monitors.xml.

Yes. From my investigation, the correct monitor positioning is not saved properly in this file, once I deactivate my second monitor.

My workaround (so I don't have each time to reposition my 2nd monitor in display monitor) is to use a script to turn on/off my second monitor, but this causes some other problems and it is not so elegant. This is the script:

#!/bin/bash
xrandr --listactivemonitors | grep 'DisplayPort-1' && xrandr --output DisplayPort-1 --off || xrandr --output DisplayPort-1 --left-of DisplayPort-0 --auto
clefebvre commented 1 year ago

OK. Settings are being lost when a monitor is disabled.

It seems to be done by design, so it not a bug but a feature request, but I definitely agree with the fact that we need to improve this.

We checked 20.3 (pre mutter-rebase) and it indeed happened there as well.

So with this in mind, we're not fixing this right now as a priority. It won't block the 21.1 release, but I'm marking it as part of the bug reports which will be looked at in priority during the next dev cycle.

mtwebster commented 1 year ago

As another workaround, physically unplugging the unused monitor should create a separate configuration and end up working how you expect. We need to treat 'disabled' monitors in the same manner (creating a new configuration rather than updating the existing one).