surviving "broken connection" and/or XSetIOErrorHandler()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hi.

i have a serious newbie X-programming problem, which i have not been
able to solve using google and other ressources i found on the net:

i am writing an application which creates and destroys windows (which
are bound to a glx-context and where the app does some openGL-rendering)
on demand: the user requests a window to be created by pressing a
"create window" button; the window is destroyed when the user presses a
"destroy window" button.

however, when the created window gets destroyed from outside by closing
the window (via the small "x" at the upper-right window corner) or by
killing it (via xkill), my application get's no notion about this.
when the user now request to destroy the (already gone) window, my
application crashes on calling XCloseDisplay() (it also crashes when i
try to call glXMakeCurrent()) with the famous:
"X connection to :0.0 broken (explicit kill or server shutdown)."

of course, this is not the behaviour i prefer: i would like it best if
destroying the window "by other means" would be the same as using the
internal window-destruction routines.
however, for this to work i would like to be a) notified of
window-destruction of b) have a possibility to check whether the
display-connection is still valid.
i don't seem to find a solution to any of these.
whatever i do with the (invalid) Display, the functions either return
without an error or they crash with an IOError. there seems to be no
"isDisplayStillValid()"-function.
listening to events doesn't seem to work either: i tried to add
"DestroyNotify" to the events i listen too, but such event never appear
(other events like grabbing the system pointer of resizing the window
work fine though)
the best i can get is registering an error-handler with
XSetIOErrorHandler(): however this doesn't really help, since i don't
want to quit the application just because one of it's windows was closed
(and the IOErrorHandler does not give me an opportunity to return to the
my application)

i am pretty sure i miss something very obvious.
could someone please direct me into the right direction?


mfg.a.dsr
IOhannes

PS: this is my 2nd attempt to write send this email, so apologize for
possible double postings (i haven't been subscribed to xfree86-devel before)

_______________________________________________

Devel@xxxxxxxxxxx
http://XFree86.Org/mailman/listinfo/devel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [X Forum]     [XFree86]     [XFree86 Newbie]     [X.Org]     [IETF Annouce]     [Security]     [Fontconfig]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]

  Powered by Linux