dtwm: fix hourglass not showing up where it should

This commit is contained in:
Chase
2025-11-27 22:16:31 -05:00
committed by Jon Trulson
parent f38cd20c5c
commit 5639630d61
4 changed files with 29 additions and 42 deletions

View File

@@ -391,9 +391,6 @@ Initialize (DtPanelShellWidget panel_shell)
Screen * screen = XtScreen (panel_shell);
Display * display = XtDisplay (panel_shell);
Pixmap busy_pixmap;
Pixmap busy_pixmap_mask;
Pixel black_pixel = BlackPixelOfScreen (screen);
Pixel white_pixel = WhitePixelOfScreen (screen);
@@ -408,7 +405,7 @@ Initialize (DtPanelShellWidget panel_shell)
/* Create busy cursor. */
_DtGetHourGlassCursor(display);
panel.busy_cursor = _DtGetHourGlassCursor(display);
panel.resolution = (int) (intptr_t) panel.element_values[PANEL_RESOLUTION].parsed_value;

View File

@@ -872,17 +872,17 @@ void ConfirmAction (WmScreenData *pSD, int nbr)
/*************************************<->*************************************
*
* ShowWaitState (flag)
*
* EnterWaitState (void)
* LeaveWatState (void)
*
* Description:
* -----------
* Enter/Leave the wait state.
*
* Enter the wait state.
* Leave the wait state.
*
* Inputs:
* ------
* flag = TRUE for Enter, FALSE for Leave.
* None.
*
*
* Outputs:
@@ -896,34 +896,23 @@ void ConfirmAction (WmScreenData *pSD, int nbr)
*
*************************************<->***********************************/
void ShowWaitState (Boolean flag)
void EnterWaitState(void)
{
unsigned int width;
unsigned int height;
unsigned int xHotspot;
unsigned int yHotspot;
Pixmap pixmap;
Pixmap maskPixmap;
XColor xcolors[2];
waitCursor = _DtGetHourGlassCursor(DISPLAY);
_DtGetHourGlassCursor(DISPLAY);
if (flag)
{
XGrabPointer (DISPLAY, DefaultRootWindow(DISPLAY), FALSE,
0, GrabModeAsync, GrabModeAsync, None,
waitCursor, CurrentTime);
XGrabKeyboard (DISPLAY, DefaultRootWindow(DISPLAY), FALSE,
GrabModeAsync, GrabModeAsync, CurrentTime);
}
else
void LeaveWaitState(void)
{
XUngrabPointer (DISPLAY, CurrentTime);
XUngrabKeyboard (DISPLAY, CurrentTime);
}
} /* END OF FUNCTION ShowWaitState */
/*************************************<->*************************************

View File

@@ -38,7 +38,8 @@ extern void PaintFeedbackWindow (WmScreenData *pSD);
extern void ShowFeedbackWindow (WmScreenData *pSD, int x, int y,
unsigned int width, unsigned int height,
unsigned long style);
extern void ShowWaitState (Boolean flag);
extern void EnterWaitState(void);
extern void LeaveWaitState(void);
extern void UpdateFeedbackInfo (WmScreenData *pSD, int x, int y,
unsigned int width, unsigned int height);
extern void UpdateFeedbackText (WmScreenData *pSD, int x, int y,

View File

@@ -495,7 +495,7 @@ void InitWmGlobal (int argc, char *argv [], char *environ [])
InitCursorInfo ();
InitWmDisplayEnv ();
ShowWaitState (TRUE);
EnterWaitState();
/*
* Initialize support for BMenu virtual mouse binding
@@ -628,7 +628,7 @@ void InitWmGlobal (int argc, char *argv [], char *environ [])
if (!(wmGD.Screens = (WmScreenData *)
XtCalloc (wmGD.numScreens, sizeof(WmScreenData))))
{
ShowWaitState (FALSE);
LeaveWaitState();
Warning (((char *)GETMESSAGE(40, 2, "Insufficient memory for Screen data")));
ExitWM (WM_ERROR_EXIT_VALUE);
}
@@ -748,7 +748,7 @@ void InitWmGlobal (int argc, char *argv [], char *environ [])
dpy2Argv);
if (!wmGD.display1)
{
ShowWaitState (FALSE);
LeaveWaitState();
Warning(((char *)GETMESSAGE(40, 4, "Could not open second display connection.")));
ExitWM (WM_ERROR_EXIT_VALUE);
}
@@ -820,7 +820,7 @@ void InitWmGlobal (int argc, char *argv [], char *environ [])
/*
* No screens for me to manage, give up.
*/
ShowWaitState (FALSE);
LeaveWaitState();
Warning (((char *)GETMESSAGE(40, 5, "Unable to manage any screens on display.")));
ExitWM (WM_ERROR_EXIT_VALUE);
}
@@ -857,7 +857,7 @@ void InitWmGlobal (int argc, char *argv [], char *environ [])
if (fcntl (ConnectionNumber (DISPLAY), F_SETFD, 1) == -1)
{
ShowWaitState (FALSE);
LeaveWaitState();
Warning (((char *)GETMESSAGE(40, 6, "Cannot configure X connection")));
ExitWM (WM_ERROR_EXIT_VALUE);
}
@@ -1138,7 +1138,7 @@ XFlush (DISPLAY);
InitKeyboardFocus ();
ShowWaitState (FALSE);
LeaveWaitState();
/*
* Tell the rest of DT that we're up
@@ -2077,7 +2077,7 @@ void InitScreenNames (void)
if (!(wmGD.screenNames =
(unsigned char **) XtMalloc (numScreens * sizeof(char *))))
{
ShowWaitState (FALSE);
LeaveWaitState();
Warning (((char *)GETMESSAGE(40, 12, "Insufficient memory for screen names")));
ExitWM (WM_ERROR_EXIT_VALUE);
}
@@ -2087,7 +2087,7 @@ void InitScreenNames (void)
if (!(wmGD.screenNames[num] =
(unsigned char *) XtMalloc (4*sizeof(char))))
{
ShowWaitState (FALSE);
LeaveWaitState();
Warning (((char *)GETMESSAGE(40, 13, "Insufficient memory for screen names")));
ExitWM (WM_ERROR_EXIT_VALUE);
}