[SOLVED] GLFW.glfwSetWindowIcon - X Error of failed request: BadAtom

Started by aaron.santos, May 01, 2016, 02:14:14

Previous topic - Next topic

aaron.santos

Hi, I'm using LWJGL 3.0.0 SNAPSHOT build 79 on Ubuntu 15.10 and trying the new glfwSetWindowIcon method.

This is the error that I get. If I remove the glfwSetWindowIcon call, then no error occurs.

X Error of failed request:  BadAtom (invalid Atom parameter)
  Major opcode of failed request:  18 (X_ChangeProperty)
  Atom id in failed request:  0x0
  Serial number of failed request:  181
  Current serial number in output stream:  182


I'm following the code here as an example https://github.com/LWJGL/lwjgl3/blob/04396b62611a1739a799f9f53cd3053889ebcf78/modules/core/src/test/java/org/lwjgl/demo/glfw/Events.java#L86

My icons buffer prints out like this
org.lwjgl.glfw.GLFWImage$Buffer[pos=0 lim=1 cap=2]
. The byte buffers used for the image pixels look ok to me. The first image (16x16) is
java.nio.DirectByteBuffer[pos=0 lim=1024 cap=1024]
and the second (32x32)
java.nio.DirectByteBuffer[pos=0 lim=4096 cap=4096]
. The buffer sizes look correct and I'm assuming that the pixel data should be in RGBA order. Every buffer pos is 0 indicating that I correctly flipped them before passing them on.

The code that creates my GLFWImage.Buffer is here https://github.com/aaron-santos/zaffre/blob/9f57285f4f419e13e3580db22dfaa7a8d4964349/src/zaffre/imageutil.clj#L37 and my code that calls glfwSetWindowIcon is here https://github.com/aaron-santos/zaffre/blob/9f57285f4f419e13e3580db22dfaa7a8d4964349/src/zaffre/glterminal.clj#L235. I know Clojure can be hard to read for some people so if this isn't enough, I can translate it to Java.

spasi

I was able to reproduce this and it's a GLFW issue. Details here. Afaict, Unity discourages per-window icons (like OS X), so I'm afraid there won't be a clean solution to this issue (other than fixing the crash by ignoring the call to glfwSetWindowIcon).

aaron.santos

Thank you for the issue link. That's exactly what I was looking for.  :)