[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference bulova::decw_jan-89_to_nov-90

Title:DECWINDOWS 26-JAN-89 to 29-NOV-90
Notice:See 1639.0 for VMS V5.3 kit; 2043.0 for 5.4 IFT kit
Moderator:STAR::VATNE
Created:Mon Oct 30 1989
Last Modified:Mon Dec 31 1990
Last Successful Update:Fri Jun 06 1997
Number of topics:3726
Total number of notes:19516

2740.0. "Application hangs in XtMainLoop" by SARAH::P_DAVIS (Peter Davis, ZKO2-2/M28, 381-0838) Wed May 09 1990 15:20

    I'm having a serious problem here:
    
    After handling a button event in a pulldown menu, my application seems
    to go into suspended animation.  It doesn't get any more expose events,
    or respond to anything.  In processing the button event, I've 'n'ed
    through dbx all the back to XtMainLoop, and everything seems ok, but
    when I 'c' to continue, everything just hangs.  When I do a ^C, dbx
    shows I'm at:
    
>  0 select.select(0x52b8ec, 0x0, 0x0, 0x0, 0x3) ["select.s":18, 0x564398]
   1 _XWaitForReadable(0x54a794, 0x1005019c, 0x10087650, 0x1005019c,0x7fffe310)
 ["XConnDis.c":1252, 0x55dd68]
   2 _XRead(0x7fffe310, 0x10082cd4, 0x10042b38, 0x1005019c, 0x1)["XlibInt.c":71
7, 0x549634]
   3 _XReply(0x3, 0x0, 0x1, 0x7fffe39c, 0x409cb8)["XlibInt.c":1140, 0x549e78]
   4 XGetGeometry(0xb00033, 0x7fffe3a4, 0x7fffe390, 0x7fffe38c, 0x7fffe388)["XG
etGeom.c":159, 0x543ff8]
   5 color_displays(widget = 0x10082cd4, id = 0x100828f4, call_data =0x7fffe604
) ["toolbox.c":406, 0x409cb4]
   6 _XtCallCallbacks(0x8a, 0x3a, 0x4ecffc, 0x10082cd4, 0x4ed0f8)["Callback.c":
351, 0x4b4584]
   7 XtWidgetCallCallbacks(0x7fffe604, 0x1330000, 0x40003d, 0x4, 0x0)["Callback
.c":596, 0x4b4a84]
   8 DrawnB.Redisplay(0x7fffeab0, 0x0, 0x7fffe650, 0x10082cd4, 0x46)["DrawnB.c"
:714, 0x4ed0f4]
   9 DispatchEvent(0x4b7bf4, 0x10283da0, 0x0, 0x1004f360, 0x4a5d80)["Event.c":4
53, 0x4a537c]
  10 DecideToDispatch(0x0, 0x0, 0x1004f360, 0x1004f360, 0x4a631c)["Event.c":805
, 0x4a5c08]
  11 XtDispatchEvent(0x7fffeab0, 0x0, 0xc11a5e00, 0x0, 0x4a62e8)["Event.c":864,
 0x4a5d7c]
  12 XtAppMainLoop(0x0, 0x1, 0x0, 0x873abb, 0x409094) ["Event.c":1064,0x4a6318]
  13 XtMainLoop(0x1028a10c, 0x1003b920, 0x0, 0x0, 0x47aa04)["Event.c":1054, 0x4
a62e4]
  14 main(argc = 1, argv = 0x7fffec64) ["xsight.c":1925, 0x409090]

    Can anyone give me a clue what might be causing this?
    
    Thanks.
    -pd

    (Also posted in the X notesfile)
T.RTitleUserPersonal
Name
DateLines
2740.1SARAH::P_DAVISPeter Davis, ZKO2-2/M28, 381-0838Wed May 09 1990 15:5311
    This has something to do with having done:
    
    XDefineCursor (disp, wind, XCreateFontCursor (disp, XC_watch));
    
    inside the event handler.  When I took this out, everything worked
    ok.
    
    Is there something wrong with the above?
    
    Thanks.
    -pd
2740.2Cache itDECWIN::KLEINThu May 10 1990 11:047
Try:

    {
    static Cursor watchCursor;
    if (!watchCursor) watchCursor = XCreateFontCursor (disp, XC_watch);
    XDefineCursor (disp, wind, watchCursor);
    }
2740.3DAVIS::peterPeter Davis, ZKO2-2/M28, 381-0838Thu May 10 1990 12:5815
Re/ .2:

Tried it.  Didn't work.

Actually, what I did was to globally declare variables for the cursors
I'm using, define those cursors once in my main function, and then have
functions which set and unset the watch cursor.

What's strange is:  I call the cursor setting functions from inside a
button event handler with no problem, but when I call them from my
pulldown menu callback routine, the server goes into this weird state
and my application gets no further events, reports, or anything.  Other
clients continue to work.

I should mention that I'm running UWS 2.2, and Motif BL1, in a diskless environment.
2740.4GILROY::kleeKen LeeMon May 14 1990 18:305
There is a known bug in the Ultrix X server dealing with the OPEN FONT
protocol request.  You may be seeing this here.  You may be able to
work around it by doing a XSync() just before the XCreateFontCursor() call.

Ken
2740.5Maybe mixed intrinsics?UFP::MURPHYA bug? Use the source, Luke!Thu May 17 1990 13:395
    Another hint: I had a problem that was similar with a Motif
    application; XSetFontCursor did all sort of odd things. It turned out
    that I was including the *XUI* version of Intrinsic.h - you CAN NOT use
    that with the Motif intrinsics --- XtWindow returns the wrong thing.
    	-Rick
2740.6DAVIS::peterPeter Davis, ZKO2-2/M28, 381-0838Fri May 18 1990 17:048
Interesting ...

I WAS using the wrong Intrinsic.h, so I moved the Motif one over.  That
fixed another problem I had been having, but it did NOT fix the
SetFontCursor problem. It still hangs.

The other problem was then when I did a XtGetValues on a widget, I was
able to get the widget's height, but the width always came back as 0.
2740.7Probably still include file mismatchesUFP::MURPHYA bug? Use the source, Luke!Mon May 28 1990 00:3818
    re: your last problem; the reason it failed on the XtGetValues is that
    Motif defines Position as int and Dimension as Cardinal [unsigned int].
    X11R3 (at least the XUI include files..) define Position as short and
    Dimension as ShortCard [unsigned short]. The toolkit code's management
    of the structure fields don't agree with your code, so badness
    happens.. specifically with XtWindow and so forth - macros that pick
    fields out of the Core widget structure.
    
    Anyway, with your problem, it sounds like you still have mismatch
    somewhere - you need to searchlist thru the Motif directories for
    everything before looking in the XUI directories.
    
    On VMS, using "#include <X11/file>" works if you've invoked
    the DXM_LOGICALS command file. On Ultrix, I use -I to define the motif
    directory root as the root of the include tree.
    	-I/motif/distr/lib -I/motif/distr/lib/Xt 
    does it for me - but I don't grok Ultrix too well..
    	-Rick