1 /****************************************************************************/
3 /* ALLIANCE CAD FRAMEWORK */
5 /* Tool : libXal Version 1.01 */
6 /* File : ForceUpdate.c */
8 /* (c) copyright 1993 MASI Laboratory. CAO & VLSI CAD Team */
9 /* All rights reserved. */
10 /* Support : e-mail cao-vlsi@masi.ibp.fr */
12 /* Author(s) : Nizar ABDALLAH Date : 02/02/1993 */
14 /* Modified by : Date : ../../.... */
15 /* Modified by : Date : ../../.... */
16 /* Modified by : Date : ../../.... */
18 /****************************************************************************/
20 /* This function is a superset of XmUpdateDisplay() in that it will ensure */
21 /* that a window's contents are visible before returning. The monitoring */
22 /* of window states is necessary because attempts to map a window are */
23 /* subject to the whim of the window manager. This introduces a signifi- */
24 /* cant delay before the window is actually mapped and exposed. */
26 /****************************************************************************/
29 /*--------------------------------------------------------------------------*/
31 /*--------------------------------------------------------------------------*/
34 /*-----------------------------*/
35 /* Motif for Alliance includes */
36 /*-----------------------------*/
41 /*---------------------------------------------------------------------------*/
43 /* FUNCTION : XalForceUpdate */
45 /* IN ARGS : .w : The widget that will serve to get the display pointer */
47 /* OUT ARGS : ( void ) */
49 /* OBJECT : Forces and updates the contents of a specific window. */
51 /*---------------------------------------------------------------------------*/
52 void XalForceUpdate(w
)
57 Widget diashell
, topshell
;
58 Window diawindow
, topwindow
;
59 XWindowAttributes xwa
;
60 XtAppContext cxt
= XtWidgetToApplicationContext(w
);
62 /*---------------------------------------*/
63 /* Locate the shell we are interested in */
64 /*---------------------------------------*/
65 for (diashell
= w
; !XtIsShell(diashell
);diashell
= XtParent(diashell
)) ;
67 /*------------------------------------*/
68 /* Locate it's primary window's shell */
69 /*------------------------------------*/
70 for (topshell
= diashell
; !XtIsTopLevelShell(topshell
);topshell
= XtParent(topshell
)) ;
72 /*-----------------------------------------------------------------------*/
73 /* If the dialog shell is not realized, don't bother. Nothing can happen */
74 /*-----------------------------------------------------------------------*/
75 if (XtIsRealized(diashell
) && XtIsRealized(topshell
))
77 dpy
= XtDisplay( topshell
);
78 diawindow
= XtWindow( diashell
);
79 topwindow
= XtWindow( topshell
);
81 /*----------------------------------*/
82 /* Wait for the dialog to be mapped */
83 /*----------------------------------*/
84 while ((XGetWindowAttributes( dpy
, diawindow
, &xwa
)) &&
85 (xwa
.map_state
!= IsViewable
) )
87 if ((XGetWindowAttributes( dpy
, topwindow
, &xwa
)) &&
88 (xwa
.map_state
!= IsViewable
))
90 XtAppNextEvent( cxt
, &event
);
91 XtDispatchEvent( &event
);
94 XmUpdateDisplay( topshell
);