java-native-access/jna · error · X11Exception

Cannot get window manager info properties. (_NET_SUPPORTING_

Error message

Cannot get window manager info properties. (_NET_SUPPORTING_WM_CHECK or _WIN_SUPPORTING_WM_CHECK)

What it means

X.getWindowManagerInfo() tries to read the _NET_SUPPORTING_WM_CHECK root-window property (EWMH), falling back to _WIN_SUPPORTING_WM_CHECK. If both property reads raise X11Exception, it throws X11Exception 'Cannot get window manager info properties...'. This means no EWMH-compatible window-manager info could be retrieved from the root window.

Source

Thrown at contrib/x11/src/jnacontrib/x11/api/X.java:169

            return atom;
        }

        /**
         * Returns the window manager information as an window.
         *
         * @return window manager information as an window
         * @throws X11Exception thrown if X11 window errors occurred
         */
        public Window getWindowManagerInfo() throws X11Exception {
            Window rootWindow = getRootWindow();

            try {
                return rootWindow.getWindowProperty(X11.XA_WINDOW, "_NET_SUPPORTING_WM_CHECK");
            } catch (X11Exception e) {
                try {
                    return rootWindow.getWindowProperty(X11.XA_CARDINAL, "_WIN_SUPPORTING_WM_CHECK");
                } catch (X11Exception e1) {
                    throw new X11Exception("Cannot get window manager info properties. (_NET_SUPPORTING_WM_CHECK or _WIN_SUPPORTING_WM_CHECK)");
                }
            }
        }

        /**
         * Returns the root window.
         *
         * @return root window
         */
        public Window getRootWindow() {
            return new Window(this, x11.XDefaultRootWindow(x11Display));
        }

        /**
         * Returns the current active window.
         *
         * @return current active window
         * @throws X11Exception thrown if X11 window errors occurred

View on GitHub (pinned to d036ad9781)

Solutions

  1. Verify a window manager is running and EWMH-compliant (most modern WMs set _NET_SUPPORTING_WM_CHECK).
  2. Use xprop -root | grep SUPPORTING to confirm the property exists before calling the API.
  3. In headless/test setups, run a lightweight EWMH WM (e.g. openbox, mutter, i3) alongside Xvfb.
  4. Catch X11Exception and degrade: proceed without WM info instead of failing the whole operation.

Example fix

// before
X.Window wmInfo = x.getWindowManagerInfo();
// after
try {
    X.Window wmInfo = x.getWindowManagerInfo();
} catch (X11Exception e) {
    LOG.warn("No EWMH window manager detected, skipping WM info");
}
Defensive patterns

Strategy: try-catch

Validate before calling

// shell probe before calling the API
// xprop -root _NET_SUPPORTING_WM_CHECK  (non-empty => supported)

Try / catch

try {
    info = x.getWindowManagerInfo();
} catch (X11Exception e) {
    info = null; // no EWMH WM present; continue without WM info
}

Prevention

When it happens

Trigger: Calling getWindowManagerInfo on a system where the window manager does not set _NET_SUPPORTING_WM_CHECK or _WIN_SUPPORTING_WM_CHECK on the root window, or when reading the property fails (wrong type/atom, no WM running).

Common situations: Bare X server with no window manager (Xvfb sessions), minimal tiling WMs without EWMH support, or Wayland sessions where the X root-window properties don't exist.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of java-native-access/jna@d036ad9781 (2026-09-12). Data as JSON: /api/errors/fa29df54e932b9fa. Report an issue: GitHub.