#6540·fyne

Wayland: SIGSEGV in PollEvents when the window's monitor is switched away

Author: zveinnCreated Sep 22, 2026Updated Sep 24, 2026
Labelsunverified

Checklist

  • I have searched the issue tracker for open issues that relate to the same problem, before opening a new one.
  • This issue only relates to a single bug. I will open new issues for any other problems.

Describe the bug

Describe the bug

On Wayland, if the Fyne window sits on a monitor that goes away (KVM switch or unplug), the process dies. The crash is a SIGSEGV inside glfw.PollEvents, while GLFW handles wl_registry.global_remove for that output. recover() cannot catch it.

A window on a different monitor is fine. A KVM often leaves DRM status=connected and only sets enabled=disabled.

Hiding the window does not help. PollEvents still crashes on the events that arrived while the output was down. glfw.Terminate() drops those events without reading them. A new glfw.Init() and a new window can then be shown when the output is back.

How to reproduce

  1. Run a Fyne app on Wayland, with the window on one monitor.
  2. Switch that monitor away with a KVM, or unplug it.
  3. The process dies in glfw.PollEvents.

Screenshots

No response

Example code

go
package main

import "fyne.io/fyne/v2/app"

func main() {
	w := app.New().NewWindow("repro")
	w.ShowAndRun()
}

Fyne version

Fyne 2.8.1, go-gl/glfw v3.4 (v0.1.0-pre.2), Linux Wayland.

Go compiler version

go version go1.27.1-X:nodwarf5 linux/amd64

Operating system and version

Arch Linux, Cosmic DE

Additional Information

No response