dtsession: split ShowWaitState into Enter and LeaveWaitState

This commit is contained in:
Chase
2025-11-27 23:06:18 -05:00
committed by Jon Trulson
parent 5639630d61
commit 62a23fc33b
6 changed files with 29 additions and 28 deletions

View File

@@ -428,7 +428,7 @@ main (int argc, char **argv)
/*
* Put the program into a wait state
*/
ShowWaitState(True);
EnterWaitState();
InitErrorHandler();
@@ -491,7 +491,7 @@ main (int argc, char **argv)
XSelectInput(smGD.display, smGD.topLevelWindow,
windAtt.your_event_mask | PropertyChangeMask);
ShowWaitState(False);
LeaveWaitState();
/*
* Register for events

View File

@@ -340,7 +340,7 @@ CompleteSave (void)
* Start a wait state - don't want anything to happen while
* ICCC clients are being saved
*/
ShowWaitState(True);
EnterWaitState();
resSpec = (char *) SM_MALLOC(resSize * sizeof(char));
if (resSpec==NULL)
@@ -350,7 +350,7 @@ CompleteSave (void)
}
if (!WriteClientDatabase ()) {
ShowWaitState(False);
LeaveWaitState();
SM_FREE(resSpec);
return (-1);
}
@@ -381,7 +381,7 @@ CompleteSave (void)
*/
if(OutputResource())
{
ShowWaitState(False);
LeaveWaitState();
SM_FREE(resSpec);
return(-1);
}
@@ -398,7 +398,7 @@ CompleteSave (void)
PruneSessionDirectory ();
ShowWaitState(False);
LeaveWaitState();
return(0);
}

View File

@@ -1389,8 +1389,8 @@ DialogUp(
/*************************************<->*************************************
*
* ShowWaitState (flag)
*
* EnterWaitState (void)
* LeaveWaitState (void)
*
* Description:
* -----------
@@ -1399,7 +1399,7 @@ DialogUp(
*
* Inputs:
* ------
* flag = TRUE for Enter, FALSE for Leave.
* None.
*
*
* Outputs:
@@ -1414,25 +1414,24 @@ DialogUp(
*************************************<->***********************************/
void
ShowWaitState(
Boolean flag )
EnterWaitState(void)
{
if (flag)
{
XGrabPointer (smGD.display, DefaultRootWindow(smGD.display), FALSE,
0, GrabModeAsync, GrabModeAsync, None,
smGD.waitCursor, CurrentTime);
XGrabKeyboard (smGD.display, DefaultRootWindow(smGD.display), FALSE,
GrabModeAsync, GrabModeAsync, CurrentTime);
}
else
{
XUngrabPointer (smGD.display, CurrentTime);
XUngrabKeyboard (smGD.display, CurrentTime);
}
XGrabPointer (smGD.display, DefaultRootWindow(smGD.display), FALSE,
0, GrabModeAsync, GrabModeAsync, None,
smGD.waitCursor, CurrentTime);
XGrabKeyboard (smGD.display, DefaultRootWindow(smGD.display), FALSE,
GrabModeAsync, GrabModeAsync, CurrentTime);
XSync(smGD.display,0);
}
void LeaveWaitState(void){
XUngrabPointer (smGD.display, CurrentTime);
XUngrabKeyboard (smGD.display, CurrentTime);
XSync(smGD.display, 0);
}
/*************************************<->*************************************
*

View File

@@ -104,7 +104,8 @@ extern int WarnMsgFailure( void ) ;
extern Widget CreateLockDialogWithCover( Widget ) ;
extern Widget CreateCoverDialog( int, Boolean ) ;
extern void ImmediateExit( int, Tt_message, Boolean ) ;
extern void ShowWaitState( Boolean ) ;
extern void EnterWaitState();
extern void LeaveWaitState();
extern Boolean InitCursorInfo( void ) ;
extern void UpdatePasswdField( int );
extern int WarnNoStartup( void );

View File

@@ -803,9 +803,9 @@ SaveYourselfReqProc (
* appropriate location.
*/
if (notify) {
ShowWaitState(True);
EnterWaitState();
NotifyProxyClients ();
ShowWaitState(False);
LeaveWaitState();
}
for (pClientRec = connectedList; pClientRec != NULL;

View File

@@ -898,7 +898,8 @@ void ConfirmAction (WmScreenData *pSD, int nbr)
void EnterWaitState(void)
{
waitCursor = _DtGetHourGlassCursor(DISPLAY);
if (!waitCursor)
waitCursor = _DtGetHourGlassCursor(DISPLAY);
XGrabPointer (DISPLAY, DefaultRootWindow(DISPLAY), FALSE,
0, GrabModeAsync, GrabModeAsync, None,