How do you exit X11 program without Error

后端 未结 4 1404
暗喜
暗喜 2021-02-07 06:57

I have a fairly simple \"Hello World\" in X11 at end of question. But when it exits I get the run time error messages below:

$ ./xtest
XIO:  fatal IO error 11 (R         


        
4条回答
  •  你的背包
    2021-02-07 07:33

    Just call XDestroyWindow() right before XCloseDisplay().

    Edit:

    Sorry, I didn't understand the XSetWMProtocols thing. Now I've read up on it. I think you're accessing the wrong member of the event union.

    XDestroyWindow(display,e.xdestroywindow.window);

    Should probably be:

    XDestroyWindow(display,e.xclient.window);
    

提交回复
热议问题