Closed Bug 1762867 Opened 3 years ago Closed 3 years ago

New window opened after unplugging from dock (with two external monitors) dont show up on Ubuntu 22.04

Categories

(Core :: Widget: Gtk, defect, P2)

x86_64
Linux
defect

Tracking

()

RESOLVED FIXED
101 Branch
Tracking Status
firefox101 --- fixed

People

(Reporter: gerard-majax, Assigned: gerard-majax)

References

(Blocks 1 open bug)

Details

Crash Data

Attachments

(4 files)

STR:

  1. Ubuntu 22.04 with Ubuntu Wayland session ; two external monitors plugged via docking station, main laptop screen is disabled when docked
  2. mozilla-central
  3. mach run
  4. Unplug dock/external monitors
  5. Click menu, Open new window or Open new private window

Expected:
I see a new window

Actual:
I dont see anything

Other GTK apps (gedit) behaves fine. Thunderbird (Daily) also repro.
The window seems to be created somehow but not visible, because when trying to close the only visible window, the process does not exit gracefully and is waiting on some processes.

This Pernosco session reproduces the issue: https://pernos.co/debug/tYrKJgiInFEe7-DXbmuWxw/index.html

Attached file about:support

Looks like we failed to load monitor setup:

[ 670876.313] wl_output@72.geometry(0, 0, 310, 170, 0, "CSO", "0x1407", 0)
[ 670876.342] wl_output@72.mode(3, 3840, 2160, 60000)
[ 670876.379] wl_output@72.scale(2)
[ 670876.383] wl_output@72.done()
[ 671079.772] zxdg_output_v1@70.logical_position(0, 0)
[ 671079.776] zxdg_output_v1@70.logical_size(2560, 1440)
[ 671079.778] zxdg_output_v1@70.name("eDP-1")
[ 671079.781] zxdg_output_v1@70.description("Affichage intégré")
[ 671079.783] wl_output@72.done()
[ 671079.915] zxdg_output_v1@70.logical_position(0, 0)
[ 671079.921] zxdg_output_v1@70.logical_size(2560, 1440)
[ 671079.923] wl_output@72.done()
[ 671079.931] wl_output@77.done()
2022-04-04 09:57:29.281024 UTC - [Parent 2461020: Main Thread]: D/WidgetScreen done
2022-04-04 09:57:29.281029 UTC - [Parent 2461020: Main Thread]: D/WidgetScreen Refreshing screens
2022-04-04 09:57:29.281037 UTC - [Parent 2461020: Main Thread]: D/WidgetScreen Monitor 0 [0 0 -> 0 x 0 depth 32 content scale 0.000000 css scale 0.000000 DPI 96.000000]

so we end up with monitor 0,0 pixels large :)

Blocks: wayland
Priority: -- → P2
  2022-04-04 17:02:27.681244 UTC - [Parent 2686628: Main Thread]: D/WidgetScreen Add Monitor ID 115 num 1
  2022-04-04 17:02:27.681247 UTC - [Parent 2686628: Main Thread]: D/WidgetScreen Added Monitor 7fe41b20b840 ID 115 num 2
  2022-04-04 17:02:27.681249 UTC - [Parent 2686628: Main Thread]: D/WidgetScreen mMonitors[0]=7fe41b20b800 => id=113
  2022-04-04 17:02:27.681251 UTC - [Parent 2686628: Main Thread]: D/WidgetScreen mMonitors[1]=7fe41b20b820 => id=114
  2022-04-04 17:02:27.681253 UTC - [Parent 2686628: Main Thread]: D/WidgetScreen mMonitors[2]=7fe41b20b840 => id=115
  2022-04-04 17:02:27.918968 UTC - [Parent 2686628: Main Thread]: D/WidgetScreen wl_output: geometry position 0 0 physical size 310 170
  2022-04-04 17:02:27.918989 UTC - [Parent 2686628: Main Thread]: D/WidgetScreen wl_output: monitor:7fe41b20b840 (115) mode output size 3840 x 2160 refresh 60000
  2022-04-04 17:02:27.918993 UTC - [Parent 2686628: Main Thread]: D/WidgetScreen wl_output: monitor:7fe41b20b840 (115) set values mode output size 3840 x 2160 refresh 60000
  2022-04-04 17:02:27.918997 UTC - [Parent 2686628: Main Thread]: D/WidgetScreen wl_output: scale 2
  2022-04-04 17:02:27.919000 UTC - [Parent 2686628: Main Thread]: D/WidgetScreen done: 7fe41b20b840
  2022-04-04 17:02:27.919020 UTC - [Parent 2686628: Main Thread]: D/WidgetScreen MakeScreenWayland num=1 aMonitor=0 aId=115 7fe41b20b800
  2022-04-04 17:02:27.919034 UTC - [Parent 2686628: Main Thread]: D/WidgetScreen Monitor 0 [0 0 -> 0 x 0 depth 32 content scale 0.000000 css scale 0.000000 DPI 96.000000]

(In reply to Alexandre LISSY :gerard-majax from comment #6)

  2022-04-04 17:02:27.681244 UTC - [Parent 2686628: Main Thread]: D/WidgetScreen Add Monitor ID 115 num 1
  2022-04-04 17:02:27.681247 UTC - [Parent 2686628: Main Thread]: D/WidgetScreen Added Monitor 7fe41b20b840 ID 115 num 2
  2022-04-04 17:02:27.681249 UTC - [Parent 2686628: Main Thread]: D/WidgetScreen mMonitors[0]=7fe41b20b800 => id=113
  2022-04-04 17:02:27.681251 UTC - [Parent 2686628: Main Thread]: D/WidgetScreen mMonitors[1]=7fe41b20b820 => id=114
  2022-04-04 17:02:27.681253 UTC - [Parent 2686628: Main Thread]: D/WidgetScreen mMonitors[2]=7fe41b20b840 => id=115
  2022-04-04 17:02:27.918968 UTC - [Parent 2686628: Main Thread]: D/WidgetScreen wl_output: geometry position 0 0 physical size 310 170
  2022-04-04 17:02:27.918989 UTC - [Parent 2686628: Main Thread]: D/WidgetScreen wl_output: monitor:7fe41b20b840 (115) mode output size 3840 x 2160 refresh 60000
  2022-04-04 17:02:27.918993 UTC - [Parent 2686628: Main Thread]: D/WidgetScreen wl_output: monitor:7fe41b20b840 (115) set values mode output size 3840 x 2160 refresh 60000
  2022-04-04 17:02:27.918997 UTC - [Parent 2686628: Main Thread]: D/WidgetScreen wl_output: scale 2
  2022-04-04 17:02:27.919000 UTC - [Parent 2686628: Main Thread]: D/WidgetScreen done: 7fe41b20b840
  2022-04-04 17:02:27.919020 UTC - [Parent 2686628: Main Thread]: D/WidgetScreen MakeScreenWayland num=1 aMonitor=0 aId=115 7fe41b20b800
  2022-04-04 17:02:27.919034 UTC - [Parent 2686628: Main Thread]: D/WidgetScreen Monitor 0 [0 0 -> 0 x 0 depth 32 content scale 0.000000 css scale 0.000000 DPI 96.000000]

So when we unplug and move from 2x external monitors to one laptop screen, we:

  • Add Monitor ID 115 => 7fe41b20b840
    • mMonitors[0]=7fe41b20b800
    • mMonitors[1]=7fe41b20b820
    • mMonitors[2]=7fe41b20b840
      => We have MonitorConfig* data for wayland listeners that points to mMonitors[2]
  • We get two consecutives RemoveMonitorConfig
    • mMonitors[0]=7fe41b20b800
      => Now, our ID=115 is 7fe41b20b800
  • wl_output listener comes in, it tries to use 7fe41b20b840 which seems to be still valid (because of the mentionned TODO leak?)
  • So we dont update the correct value with the new resolution infos.

NOT performing the array remove at https://searchfox.org/mozilla-central/rev/26a1b0fce12e6dd495a954c542bb1e7bd6e0d548/widget/gtk/ScreenHelperGTK.cpp#306 we can open a window.

Assignee: nobody → lissyx+mozillians
Status: NEW → ASSIGNED
Severity: -- → S3
OS: Unspecified → Linux
Hardware: Unspecified → x86_64
Attachment #9270854 - Attachment description: Bug 1762867 - Update correct wayland MonitorConfig r?stransky! → Bug 1762867 - Update correct wayland MonitorConfig r?stransky!,emilio!
Pushed by alissy@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/245305794760 Update correct wayland MonitorConfig r=emilio
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 101 Branch

after a few days on nightly we should probably request uplift

Flags: needinfo?(lissyx+mozillians)

So installing a VM locally, unfortunately, KVM / virt-manager does not offer hotplug of monitors, so I can't really verify again.
Several colleagues could not reproduce as well, so my guess is that it depends on the physical setup.

Mine is two external monitors connected over display port, with a KVM switch, then wired to a ThinkPad docking station connected to my laptop. When the laptop is "docked", its internal screen is turned off and only the two external monitors are used. When I undock, laptop main screen takes precedence obviously, and on a lower level the chain of event is:

  • Add monitor (laptop screen)
  • Remove monitor (one external monitor)
  • Remove monitor (one external monitor)

Olivier, you might want to know about that bug in case you get reports in the wild, we could uplift. But so far I wont request uplift.

Flags: needinfo?(lissyx+mozillians) → needinfo?(olivier)

Ack, thanks for the heads up Alexandre.

Flags: needinfo?(olivier)
QA Whiteboard: [qa-101b-p2]

Copying crash signatures from duplicate bugs.

Crash Signature: [@ mozilla::detail::InvalidArrayIndex_CRASH | mozilla::widget::ScreenGetterWayland::GetScreenForWindow]

I've experienced this crash on firefox 103: https://crash-stats.mozilla.org/report/index/791812db-df8a-4673-a7cb-277600220801#tab-details

Slightly different STR:

  1. having firefox running
  2. open laptop lid (+1 montor)
  3. unplug usb-c hub (-1 monitor)
  4. firefox crashes

System: Gnome 42.3 on Wayland, Arch Linux

Blocks: 1782522
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: