** Description changed:

+ [ Impact ]
+ 
+ After switching from a laptop-only configuration back to laptop plus
+ external monitor, org.gnome.Mutter.DisplayConfig.GetCurrentState reports
+ both logical monitors as primary. Only the external monitor should be.
+ Clients that read the primary monitor from GetCurrentState, such as Dash
+ to Panel, put their panel on the wrong screen until the next monitor
+ reconfiguration.
+ 
+ The fix clears is_primary on all logical monitors before setting it on the
+ new primary.
+ 
+ [ Test Plan ]
+ 
+ 1. On Ubuntu 26.04 with GNOME on Wayland, set the external monitor as
+    primary with both displays enabled.
+ 2. Turn the external monitor off, wait until only the laptop screen is
+    active, then turn it back on (or unplug/replug, or suspend/resume with
+    a dock).
+ 3. Run `gdctl show | grep -A2 Primary` and verify only the external
+    monitor reports Primary: yes.
+ 4. Regression check: the correct monitor remains primary after hotplug,
+    suspend/resume, and display configuration changes.
+ 
+ [ Where problems could occur ]
+ 
+ The change is in logical-monitor primary handling. A regression could
+ show up as no monitor, or the wrong monitor, being reported as primary.
+ Test hotplug, suspend/resume, and switching between mirrored and extended
+ layouts.
+ 
+ [ Original description ]
+ 
  Package: mutter 50.1-0ubuntu2.5 (resolute), Wayland
  Ubuntu 26.04.1 LTS
  
  I have the following issue with Mutter, that is already fixed upstream.
  
  Problem:
  After going from a laptop-only configuration back to laptop + external 
monitor, the
  org.gnome.Mutter.DisplayConfig GetCurrentState D-Bus method reports both 
logical monitors as
  primary. Only the external monitor should be. The shell itself uses the 
correct primary.
  The wrong flag stays until the next monitor reconfiguration.
  
  D-Bus clients that take the primary monitor from GetCurrentState pick the 
wrong monitor.
  For example, the Dash to Panel extension puts its main panel on the laptop 
screen.
  
  Steps to reproduce:
  1. Laptop with an external monitor set as primary, both enabled.
  2. Turn the external monitor off, wait until only the laptop screen is 
active, turn it back on.
-    (Unplug/replug, or suspend/resume with a dock, has the same effect.)
+    (Unplug/replug, or suspend/resume with a dock, has the same effect.)
  3. Run `gdctl show | grep -A2 Primary`.
  
  Expected: only the external monitor shows "Primary: yes".
  Actual: both show "Primary: yes":
  
-     > gdctl show |grep -A2 Primary
-     │  ├──Primary: yes
-     │  └──Monitors: (1)
-     │      └──eDP-1 (Built-in display)
-     --
-        ├──Primary: yes
-        └──Monitors: (1)
-            └──DP-1 (Dell Inc. 27")
+     > gdctl show |grep -A2 Primary
+     │  ├──Primary: yes
+     │  └──Monitors: (1)
+     │      └──eDP-1 (Built-in display)
+     --
+        ├──Primary: yes
+        └──Monitors: (1)
+            └──DP-1 (Dell Inc. 27")
  
  Cause:
  meta_monitor_manager_update_logical_monitors() reuses existing logical 
monitors, and
  meta_monitor_manager_set_primary_logical_monitor() never clears is_primary on 
the previous
  primary. The laptop's logical monitor keeps the flag from the laptop-only 
configuration.
  
  Fix:
  Fixed upstream by "backends: Clear is_primary on non-primary logical 
monitors":
-   - https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/5228
-   - gnome-50: e58c910f23fc40c4ba8b6040be1f022887612aad (in 50.5)
-   - main: b59dc860bb7eb0283b576e74a24e61cdd9eba068 (in 51.0)
+   - https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/5228
+   - gnome-50: e58c910f23fc40c4ba8b6040be1f022887612aad (in 50.5)
+   - main: b59dc860bb7eb0283b576e74a24e61cdd9eba068 (in 51.0)
  It applies to 50.1-0ubuntu2.5 without changes. It only clears is_primary on 
all logical monitors
  before setting it on the new primary, so a regression would show up as no 
monitor or the wrong
  monitor being reported as primary.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2172991

Title:
  DisplayConfig GetCurrentState reports two primary logical monitors
  after hotplug (please backport upstream fix)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/mutter/+bug/2172991/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to