dtsession: split ShowWaitState into Enter and LeaveWaitState
This commit is contained in:
@@ -428,7 +428,7 @@ main (int argc, char **argv)
|
|||||||
/*
|
/*
|
||||||
* Put the program into a wait state
|
* Put the program into a wait state
|
||||||
*/
|
*/
|
||||||
ShowWaitState(True);
|
EnterWaitState();
|
||||||
|
|
||||||
InitErrorHandler();
|
InitErrorHandler();
|
||||||
|
|
||||||
@@ -491,7 +491,7 @@ main (int argc, char **argv)
|
|||||||
XSelectInput(smGD.display, smGD.topLevelWindow,
|
XSelectInput(smGD.display, smGD.topLevelWindow,
|
||||||
windAtt.your_event_mask | PropertyChangeMask);
|
windAtt.your_event_mask | PropertyChangeMask);
|
||||||
|
|
||||||
ShowWaitState(False);
|
LeaveWaitState();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Register for events
|
* Register for events
|
||||||
|
|||||||
@@ -340,7 +340,7 @@ CompleteSave (void)
|
|||||||
* Start a wait state - don't want anything to happen while
|
* Start a wait state - don't want anything to happen while
|
||||||
* ICCC clients are being saved
|
* ICCC clients are being saved
|
||||||
*/
|
*/
|
||||||
ShowWaitState(True);
|
EnterWaitState();
|
||||||
|
|
||||||
resSpec = (char *) SM_MALLOC(resSize * sizeof(char));
|
resSpec = (char *) SM_MALLOC(resSize * sizeof(char));
|
||||||
if (resSpec==NULL)
|
if (resSpec==NULL)
|
||||||
@@ -350,7 +350,7 @@ CompleteSave (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!WriteClientDatabase ()) {
|
if (!WriteClientDatabase ()) {
|
||||||
ShowWaitState(False);
|
LeaveWaitState();
|
||||||
SM_FREE(resSpec);
|
SM_FREE(resSpec);
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
@@ -381,7 +381,7 @@ CompleteSave (void)
|
|||||||
*/
|
*/
|
||||||
if(OutputResource())
|
if(OutputResource())
|
||||||
{
|
{
|
||||||
ShowWaitState(False);
|
LeaveWaitState();
|
||||||
SM_FREE(resSpec);
|
SM_FREE(resSpec);
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
@@ -398,7 +398,7 @@ CompleteSave (void)
|
|||||||
|
|
||||||
PruneSessionDirectory ();
|
PruneSessionDirectory ();
|
||||||
|
|
||||||
ShowWaitState(False);
|
LeaveWaitState();
|
||||||
|
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1389,8 +1389,8 @@ DialogUp(
|
|||||||
|
|
||||||
/*************************************<->*************************************
|
/*************************************<->*************************************
|
||||||
*
|
*
|
||||||
* ShowWaitState (flag)
|
* EnterWaitState (void)
|
||||||
*
|
* LeaveWaitState (void)
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* -----------
|
* -----------
|
||||||
@@ -1399,7 +1399,7 @@ DialogUp(
|
|||||||
*
|
*
|
||||||
* Inputs:
|
* Inputs:
|
||||||
* ------
|
* ------
|
||||||
* flag = TRUE for Enter, FALSE for Leave.
|
* None.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* Outputs:
|
* Outputs:
|
||||||
@@ -1414,25 +1414,24 @@ DialogUp(
|
|||||||
*************************************<->***********************************/
|
*************************************<->***********************************/
|
||||||
|
|
||||||
void
|
void
|
||||||
ShowWaitState(
|
EnterWaitState(void)
|
||||||
Boolean flag )
|
|
||||||
{
|
{
|
||||||
if (flag)
|
XGrabPointer (smGD.display, DefaultRootWindow(smGD.display), FALSE,
|
||||||
{
|
0, GrabModeAsync, GrabModeAsync, None,
|
||||||
XGrabPointer (smGD.display, DefaultRootWindow(smGD.display), FALSE,
|
smGD.waitCursor, CurrentTime);
|
||||||
0, GrabModeAsync, GrabModeAsync, None,
|
XGrabKeyboard (smGD.display, DefaultRootWindow(smGD.display), FALSE,
|
||||||
smGD.waitCursor, CurrentTime);
|
GrabModeAsync, GrabModeAsync, CurrentTime);
|
||||||
XGrabKeyboard (smGD.display, DefaultRootWindow(smGD.display), FALSE,
|
XSync(smGD.display,0);
|
||||||
GrabModeAsync, GrabModeAsync, CurrentTime);
|
}
|
||||||
}
|
|
||||||
else
|
void LeaveWaitState(void){
|
||||||
{
|
XUngrabPointer (smGD.display, CurrentTime);
|
||||||
XUngrabPointer (smGD.display, CurrentTime);
|
XUngrabKeyboard (smGD.display, CurrentTime);
|
||||||
XUngrabKeyboard (smGD.display, CurrentTime);
|
|
||||||
}
|
|
||||||
XSync(smGD.display, 0);
|
XSync(smGD.display, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************<->*************************************
|
/*************************************<->*************************************
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -104,7 +104,8 @@ extern int WarnMsgFailure( void ) ;
|
|||||||
extern Widget CreateLockDialogWithCover( Widget ) ;
|
extern Widget CreateLockDialogWithCover( Widget ) ;
|
||||||
extern Widget CreateCoverDialog( int, Boolean ) ;
|
extern Widget CreateCoverDialog( int, Boolean ) ;
|
||||||
extern void ImmediateExit( int, Tt_message, Boolean ) ;
|
extern void ImmediateExit( int, Tt_message, Boolean ) ;
|
||||||
extern void ShowWaitState( Boolean ) ;
|
extern void EnterWaitState();
|
||||||
|
extern void LeaveWaitState();
|
||||||
extern Boolean InitCursorInfo( void ) ;
|
extern Boolean InitCursorInfo( void ) ;
|
||||||
extern void UpdatePasswdField( int );
|
extern void UpdatePasswdField( int );
|
||||||
extern int WarnNoStartup( void );
|
extern int WarnNoStartup( void );
|
||||||
|
|||||||
@@ -803,9 +803,9 @@ SaveYourselfReqProc (
|
|||||||
* appropriate location.
|
* appropriate location.
|
||||||
*/
|
*/
|
||||||
if (notify) {
|
if (notify) {
|
||||||
ShowWaitState(True);
|
EnterWaitState();
|
||||||
NotifyProxyClients ();
|
NotifyProxyClients ();
|
||||||
ShowWaitState(False);
|
LeaveWaitState();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (pClientRec = connectedList; pClientRec != NULL;
|
for (pClientRec = connectedList; pClientRec != NULL;
|
||||||
|
|||||||
@@ -898,7 +898,8 @@ void ConfirmAction (WmScreenData *pSD, int nbr)
|
|||||||
|
|
||||||
void EnterWaitState(void)
|
void EnterWaitState(void)
|
||||||
{
|
{
|
||||||
waitCursor = _DtGetHourGlassCursor(DISPLAY);
|
if (!waitCursor)
|
||||||
|
waitCursor = _DtGetHourGlassCursor(DISPLAY);
|
||||||
|
|
||||||
XGrabPointer (DISPLAY, DefaultRootWindow(DISPLAY), FALSE,
|
XGrabPointer (DISPLAY, DefaultRootWindow(DISPLAY), FALSE,
|
||||||
0, GrabModeAsync, GrabModeAsync, None,
|
0, GrabModeAsync, GrabModeAsync, None,
|
||||||
|
|||||||
Reference in New Issue
Block a user