Wox-launcher/Wox · error

Could not open X11 display

Error message

Could not open X11 display

What it means

Error "Could not open X11 display" thrown in Wox-launcher/Wox.

Source

Thrown at wox.core/util/screen/screen_linux.go:280

	} else {
		size, pointerX, pointerY, err := getMouseScreenX11WithPointer()
		if err == nil {
			setLastMouseScreenDebug(fmt.Sprintf("source=x11 pointer=%d,%d screen=%d,%d %dx%d", pointerX, pointerY, size.X, size.Y, size.Width, size.Height))
			return size
		}
		setLastMouseScreenDebug(fmt.Sprintf("source=x11-failed err=%v", err))
	}

	// Give gtk a try, as it considers DPI and scaling of the screen
	size, err := GetMouseScreenGtk()
	if err == nil {
		setLastMouseScreenDebug(fmt.Sprintf("source=gtk-fallback screen=%d,%d %dx%d", size.X, size.Y, size.Width, size.Height))
		return size
	}
	// Fallback to X11
	display := C.openDisplay()
	if display == nil {
		panic("Could not open X11 display")
	}
	defer C.closeDisplay(display)

	var width, height C.int
	C.getScreenSize(display, &width, &height)
	setLastMouseScreenDebug(fmt.Sprintf("source=x11-size-fallback width=%d height=%d gtkErr=%v", int(width), int(height), err))

	return Size{
		Width:  int(width),
		Height: int(height),
	}
}

func isWaylandSession() bool {
	return strings.EqualFold(os.Getenv("XDG_SESSION_TYPE"), "wayland") || os.Getenv("WAYLAND_DISPLAY") != ""
}

func GetActiveScreen() Size {

View on GitHub (pinned to 1659730fcb)

When it happens

Trigger: Thrown at wox.core/util/screen/screen_linux.go:280 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Wox-launcher/Wox@1659730fcb (2026-08-15). Data as JSON: /api/errors/ba67954d084f7b96. Report an issue: GitHub.