i3: i3 says "could not create graphical context" with TigerVNC on NixOS
Output of i3 --moreversion 2>&- || i3 --version
:
Binary i3 version: 4.13 (2016-11-08) © 2009 Michael Stapelberg and contributors
URL to a logfile as per http://i3wm.org/docs/debugging.html:
http://logs.i3wm.org/logs/5637337312657408.bz2
What I did:
Install tigervnc
, then do
cat > ~/.vnc/xstartup <<EOF
#!/bin/sh
exec i3
EOF
chmod +x ~/.vnc/xstartup
vncserver
What I saw:
sean@loefah ~> cat .vnc/loefah:1.log
Xvnc TigerVNC 1.7.80 - built Jan 1 1970 00:00:01
Copyright (C) 1999-2016 TigerVNC Team and many others (see README.txt)
See http://www.tigervnc.org for information on TigerVNC.
Underlying X server release 11902000, The X.Org Foundation
Thu Apr 6 16:20:19 2017
vncext: VNC extension running!
vncext: Listening for VNC connections on all interface(s), port 5901
vncext: created VNC server for screen 0
04/06/2017 04:20:22 PM - [libi3] ERROR: Could not create graphical context. Error code: 9. Please report this bug.
04/06/2017 04:20:22 PM - [libi3] ERROR: Could not create graphical context. Error code: 9. Please report this bug.
04/06/2017 04:20:22 PM - [libi3] ERROR: Could not create graphical context. Error code: 9. Please report this bug.
04/06/2017 04:20:22 PM - [libi3] ERROR: Could not create graphical context. Error code: 9. Please report this bug.
04/06/2017 04:20:22 PM - [libi3] ERROR: Could not create graphical context. Error code: 9. Please report this bug.
04/06/2017 04:20:22 PM - [libi3] ERROR: Could not create graphical context. Error code: 9. Please report this bug.
04/06/2017 04:20:22 PM - [libi3] ERROR: Could not create graphical context. Error code: 9. Please report this bug.
04/06/2017 04:20:22 PM - [libi3] ERROR: Could not create graphical context. Error code: 9. Please report this bug.
04/06/2017 04:20:22 PM - [libi3] ERROR: Could not create graphical context. Error code: 9. Please report this bug.
04/06/2017 04:20:22 PM - [libi3] ERROR: Could not create graphical context. Error code: 9. Please report this bug.
04/06/2017 04:20:22 PM - [libi3] ERROR: Could not create graphical context. Error code: 9. Please report this bug.
04/06/2017 04:20:22 PM - [libi3] ERROR: Could not create graphical context. Error code: 9. Please report this bug.
04/06/2017 04:20:22 PM - [libi3] ERROR: Could not create graphical context. Error code: 9. Please report this bug.
04/06/2017 04:20:22 PM - [libi3] ERROR: Could not create graphical context. Error code: 9. Please report this bug.
04/06/2017 04:20:22 PM - [libi3] ERROR: Could not create graphical context. Error code: 9. Please report this bug.
04/06/2017 04:20:22 PM - [libi3] ERROR: Could not create graphical context. Error code: 9. Please report this bug.
04/06/2017 04:20:22 PM - [libi3] ERROR: Could not create graphical context. Error code: 9. Please report this bug.
04/06/2017 04:20:22 PM - [libi3] ERROR: Could not create graphical context. Error code: 9. Please report this bug.
i3status: trying to auto-detect output_format setting
i3status: auto-detected "i3bar"
Could not grab keyboard, status = 3
[libi3] libi3/font.c Using Pango font monospace, size 8
[libi3] libi3/font.c X11 root window dictates 96.094581 DPI
[libi3] libi3/font.c Using Pango font monospace, size 8
What I expected instead: A working VNC session using i3.
About this issue
- Original URL
- State: open
- Created 7 years ago
- Comments: 26 (13 by maintainers)
And I guess it’s this check in i3 which is wrong:
https://github.com/i3/i3/blob/55bc6741796e8b179b6111a721a3e9631934bb86/src/x.c#L116
This uses
get_visualid_by_depth
to find any visual with the given depth. Then it assumes that for any window having the default depth, it can use the visual that was found. However, this really should check if the window has the default visual, not the default depth.In the case we are investigating, there are two identical visuals (no idea why) and the default visual is later in the list than its duplicate. Thus,
get_visualid_by_depth(24)
will always find this other visual instead of the default visual.I’ll leave writing a patch to someone actually involved with i3. Feel free to acknowledge that I might have been a tiny bit helpful. 😉
If I use the default xstartup with twm, I can at least launch xterm and qutebrowser over VNC. I’m not sure what all i3 expects in its environment and if NixOS might be missing something there, though.