{"record":{"id":"ba67954d084f7b96","repo":"Wox-launcher/Wox","slug":"could-not-open-x11-display","errorCode":null,"errorMessage":"Could not open X11 display","messagePattern":"Could not open X11 display","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"wox.core/util/screen/screen_linux.go","lineNumber":280,"sourceCode":"\t} else {\n\t\tsize, pointerX, pointerY, err := getMouseScreenX11WithPointer()\n\t\tif err == nil {\n\t\t\tsetLastMouseScreenDebug(fmt.Sprintf(\"source=x11 pointer=%d,%d screen=%d,%d %dx%d\", pointerX, pointerY, size.X, size.Y, size.Width, size.Height))\n\t\t\treturn size\n\t\t}\n\t\tsetLastMouseScreenDebug(fmt.Sprintf(\"source=x11-failed err=%v\", err))\n\t}\n\n\t// Give gtk a try, as it considers DPI and scaling of the screen\n\tsize, err := GetMouseScreenGtk()\n\tif err == nil {\n\t\tsetLastMouseScreenDebug(fmt.Sprintf(\"source=gtk-fallback screen=%d,%d %dx%d\", size.X, size.Y, size.Width, size.Height))\n\t\treturn size\n\t}\n\t// Fallback to X11\n\tdisplay := C.openDisplay()\n\tif display == nil {\n\t\tpanic(\"Could not open X11 display\")\n\t}\n\tdefer C.closeDisplay(display)\n\n\tvar width, height C.int\n\tC.getScreenSize(display, &width, &height)\n\tsetLastMouseScreenDebug(fmt.Sprintf(\"source=x11-size-fallback width=%d height=%d gtkErr=%v\", int(width), int(height), err))\n\n\treturn Size{\n\t\tWidth:  int(width),\n\t\tHeight: int(height),\n\t}\n}\n\nfunc isWaylandSession() bool {\n\treturn strings.EqualFold(os.Getenv(\"XDG_SESSION_TYPE\"), \"wayland\") || os.Getenv(\"WAYLAND_DISPLAY\") != \"\"\n}\n\nfunc GetActiveScreen() Size {","sourceCodeStart":262,"sourceCodeEnd":298,"githubUrl":"https://github.com/Wox-launcher/Wox/blob/1659730fcb37154f26497e07308b1f8789d659fe/wox.core/util/screen/screen_linux.go#L262-L298","documentation":"Error \"Could not open X11 display\" thrown in Wox-launcher/Wox.","triggerScenarios":"Thrown at wox.core/util/screen/screen_linux.go:280 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1659730fcb37154f26497e07308b1f8789d659fe","analyzedAt":"2026-08-15T23:31:07.596Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}