1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-04-28 13:08:06 +00:00

Remove SIGPOLL usage (#385)

* Remove unnecessary calls to XLOCK/XUNLOCK

The X methods called by flush_display_region() and flush_display_lineregion() handle the
locking/unlocking, therefore it is unnecessary to invoke the locking here.

* Remove explict signals when doing XUNLOCK()

Call getXsignaldata() directly if a signal happened while X code
was locked, instead of generating a signal and then handling it.

Some macros and functions needed to pass the DspInterface instead of
extracting the X display and window and passing those so that the
correct structure was available for the XUNLOCK() call.
This commit is contained in:
Nick Briggs
2021-06-27 19:02:02 -07:00
committed by GitHub
parent 1c47bf5df0
commit ef6a6554ac
12 changed files with 59 additions and 66 deletions

View File

@@ -66,7 +66,7 @@ void Init_XCursor() {
cursorlist->next = NULL;
for (i = 0; i < CURSORHEIGHT; i++) cursorlist->bitmap[i] = newbm[i];
set_Xcursor(currentdsp, (uint8_t *)newbm, 0, 0, &(cursorlist->Xid), 1);
DefineCursor(currentdsp->display_id, currentdsp->DisplayWindow, &(cursorlist->Xid));
DefineCursor(currentdsp, currentdsp->DisplayWindow, &(cursorlist->Xid));
} /* end Init_XCursor */
/************************************************************************/
@@ -120,8 +120,8 @@ void Set_XCursor(int x, int y)
clp->next = cursorlist;
cursorlist = clp;
}
DefineCursor(currentdsp->display_id, currentdsp->DisplayWindow, &(clp->Xid));
XUNLOCK; /* Signals OK now */
DefineCursor(currentdsp, currentdsp->DisplayWindow, &(clp->Xid));
XUNLOCK(currentdsp); /* Signals OK now */
#ifdef NEWXCURSOR
/* Save the hotspot for later position reporting/setting */
@@ -140,16 +140,16 @@ void Set_XCursor(int x, int y)
/* */
/************************************************************************/
void init_Xcursor(Display *display, Window window)
void init_Xcursor(DspInterface dsp)
{
TPRINT(("TRACE: init_Xcursor()\n"));
XLOCK; /* Take no X signals during this activity (ISC 386) */
XAllocNamedColor(display, Colors, "black", &cursor_fore_xcsd, &xced);
XAllocNamedColor(display, Colors, "white", &cursor_back_xcsd, &xced);
XAllocNamedColor(dsp->display_id, Colors, "black", &cursor_fore_xcsd, &xced);
XAllocNamedColor(dsp->display_id, Colors, "white", &cursor_back_xcsd, &xced);
XUNLOCK; /* OK to take signals again */
XUNLOCK(dsp); /* OK to take signals again */
} /* end init_Xcursor */
@@ -190,6 +190,6 @@ void set_Xcursor(DspInterface dsp, const uint8_t *bitmap, int hotspot_x, int hot
XFreePixmap(dsp->display_id, Cursor_msk);
XFlush(dsp->display_id);
XUNLOCK;
XUNLOCK(dsp);
} /* end set_Xcursor */