Summary: | XtAppMainLoop doesn't work without a Display | ||
---|---|---|---|
Product: | xorg | Reporter: | Jordan Hayes <jordan> |
Component: | Lib/Xt | Assignee: | Xorg Project Team <xorg-team> |
Status: | RESOLVED FIXED | QA Contact: | Xorg Project Team <xorg-team> |
Severity: | enhancement | ||
Priority: | medium | CC: | jordan |
Version: | 7.6 (2010.12) | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: |
Description
Jordan Hayes
2011-02-25 05:05:17 UTC
I don't believe libXt was ever designed, intended, or tested for use in non-GUI applications with no open display. This sounds like a request to add support for that, not a bug in failing to meet the design. (In reply to comment #1) > I don't believe libXt was ever designed, intended, or tested > for use in non-GUI applications with no open display. It was certainly discussed (and encouraged by Consortium engineering staff) in the late 80's (X11R2 timeframe), many years before the new ExitFlag mechanism was added. If you don't want to call it a bug, it's at least inconsistent with the documentation. For what it's worth, I do believe that the addition of the XtAppContext was specifically intended to more generally support event-driven programming. Later, Tk was inspired by XtAppMainLoop() and John Ousterhaut similarly migrated Tcl_MainLoop out of the graphical Tk and into the core Tcl base. I wrote a Usenix paper in 1994 about this kind of thing: http://bitway.com/jordan/papers/USENIX/AppDev.html I stand corrected - unfortunately, we have little information available to most developers today about what the Consortium did 20 years ago, and Xt itself is barely maintained for binary compatibility, with no one who knows much about it willing to spend time working on maintaining it. NTL the request is reasonable. I did some tests and found no problems so we should give it a go. LibXT did not have many changes inrecent times so it is ok to start fixing more exotic problems. This issue came up with the addition of the XtAppSetExitFlag() call; I can't tell from the history when that was added or by who. At the time, XtAppMainLoop() was changed from what it was originally to include the test for the exit flag; that's the genesis of this bug. Looks like XtAppSetExitFlag() was added by the X Consortium for the initial X11R6.0 release in 1994 - it's in there but not in X11R5. Ok ... so ... can we fix it? :-) Patch submitted to xorg-devel for review: http://lists.x.org/archives/xorg-devel/2011-March/019981.html I've not seen any noticable issues with the various Xt-based apps I ran from the X.Org app/* set, but not really fully-exercised them either, or more complex apps / toolkits like Motif. commit 42c611d9f8c80528f6e36ceb0ce245b06e8b1e8e Author: Jordan Hayes <jordan@bitway.com> Date: Sun Mar 6 11:35:47 2011 -0800 Bug 34715: XtAppMainLoop doesn't work without a Display https://bugs.freedesktop.org/show_bug.cgi?id=34715 XtAppNextEvent() doesn't return until there's an actual XEvent to be handled; it handles Xt-internal events (inputs, timers, signals) itself, but doesn't return (because of course, those aren't XEvents). Which means that the exit flag doesn't get a chance to break the loop until/unless there's an actual XEvent. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.