[2574] in Athena Bugs
Fix to cursor trashing problem on the RT
daemon@ATHENA.MIT.EDU (John D. Kubiatowicz)
Mon Jul 17 06:32:00 1989
To: bugs@ATHENA.MIT.EDU
Cc: probe@ATHENA.MIT.EDU, epeisach@ATHENA.MIT.EDU
Date: Mon, 17 Jul 89 06:31:33 EDT
From: John D. Kubiatowicz <kubitron@ATHENA.MIT.EDU>
Following is a fix to the cursor trashing problem on the apa16 (cursor
cache corruption). Turns out that there were times when the cursor
code was attempting to put the cursor off screen, which caused
copies of negative length...
I believe that this could be a problem on other heads. I will look at this
later (after sleep).
--KUBI--
p.s. Rich, you can grab the file and RCS log out of the plx source tree.
*** /tmp/,RCSt1020524 Mon Jul 17 06:16:57 1989
--- apa16Curs.c Mon Jul 17 06:16:20 1989
***************
*** 20,30 ****
SOFTWARE.
******************************************************************/
! /* $Header: apa16Curs.c,v 1.1 89/07/16 23:48:08 kubitron Exp $ */
/* $Source: /afs/athena.mit.edu/mit/plx/src/X11R3/server/ddx/ibm/apa16/RCS/apa16Curs.c,v $ */
#ifndef lint
! static char *rcsid = "$Header: apa16Curs.c,v 1.1 89/07/16 23:48:08 kubitron Exp $";
#endif
#include "X.h"
--- 20,30 ----
SOFTWARE.
******************************************************************/
! /* $Header: apa16Curs.c,v 1.2 89/07/17 06:14:51 kubitron Exp $ */
/* $Source: /afs/athena.mit.edu/mit/plx/src/X11R3/server/ddx/ibm/apa16/RCS/apa16Curs.c,v $ */
#ifndef lint
! static char *rcsid = "$Header: apa16Curs.c,v 1.2 89/07/17 06:14:51 kubitron Exp $";
#endif
#include "X.h"
***************
*** 218,237 ****
TRACE(("apa16ShowCursor( x= %d, y= %d )\n",x,y));
! if ( ibmScreenState(ibmCurrentScreen)!= SCREEN_ACTIVE ) {
return;
}
APA16_GET_CMD(ROP_RECT_COPY,GXcopy,cmd);
if (x<ibmCursorHotX(ibmCurrentScreen)) {
offset= ibmCursorHotX(ibmCurrentScreen)-x;
apa16ClearCursor(ACTIVE_CURSOR);
! QUEUE_RESET();
! COPY_RECT(cmd, AND_EDGE(ACTIVE_CURSOR)-offset, CURSOR_AREA_BOTTOM,
! AND_EDGE(currentCursor), CURSOR_AREA_BOTTOM,
! CURSOR_WIDTH-offset, CURSOR_HEIGHT);
! COPY_RECT(cmd, XOR_EDGE(ACTIVE_CURSOR)-offset, CURSOR_AREA_BOTTOM,
! XOR_EDGE(currentCursor), CURSOR_AREA_BOTTOM,
! CURSOR_WIDTH-offset, CURSOR_HEIGHT);
CURSOR_X= 0;
CURSOR_Y= y-ibmCursorHotY(ibmCurrentScreen);
obscured= TRUE;
--- 218,240 ----
TRACE(("apa16ShowCursor( x= %d, y= %d )\n",x,y));
! if ( ibmScreenState(ibmCurrentScreen)!= SCREEN_ACTIVE) {
return;
}
+
APA16_GET_CMD(ROP_RECT_COPY,GXcopy,cmd);
if (x<ibmCursorHotX(ibmCurrentScreen)) {
offset= ibmCursorHotX(ibmCurrentScreen)-x;
apa16ClearCursor(ACTIVE_CURSOR);
! if (offset < CURSOR_WIDTH) {
! QUEUE_RESET();
! COPY_RECT(cmd, AND_EDGE(ACTIVE_CURSOR)-offset, CURSOR_AREA_BOTTOM,
! AND_EDGE(currentCursor), CURSOR_AREA_BOTTOM,
! CURSOR_WIDTH-offset, CURSOR_HEIGHT);
! COPY_RECT(cmd, XOR_EDGE(ACTIVE_CURSOR)-offset, CURSOR_AREA_BOTTOM,
! XOR_EDGE(currentCursor), CURSOR_AREA_BOTTOM,
! CURSOR_WIDTH-offset, CURSOR_HEIGHT);
! }
CURSOR_X= 0;
CURSOR_Y= y-ibmCursorHotY(ibmCurrentScreen);
obscured= TRUE;
***************
*** 239,251 ****
else if (x>APA16_WIDTH-CURSOR_WIDTH+ibmCursorHotX(ibmCurrentScreen)) {
offset= x-APA16_WIDTH-ibmCursorHotX(ibmCurrentScreen)+CURSOR_WIDTH;
apa16ClearCursor(ACTIVE_CURSOR);
! QUEUE_RESET();
! COPY_RECT(cmd, AND_EDGE(ACTIVE_CURSOR), CURSOR_AREA_BOTTOM,
! AND_EDGE(currentCursor)-offset, CURSOR_AREA_BOTTOM,
! CURSOR_WIDTH-offset, CURSOR_HEIGHT);
! COPY_RECT(cmd, XOR_EDGE(ACTIVE_CURSOR), CURSOR_AREA_BOTTOM,
! XOR_EDGE(currentCursor)-offset, CURSOR_AREA_BOTTOM,
! CURSOR_WIDTH-offset, CURSOR_HEIGHT);
CURSOR_X= APA16_WIDTH-48;
CURSOR_Y= y-ibmCursorHotY(ibmCurrentScreen);
obscured= TRUE;
--- 242,256 ----
else if (x>APA16_WIDTH-CURSOR_WIDTH+ibmCursorHotX(ibmCurrentScreen)) {
offset= x-APA16_WIDTH-ibmCursorHotX(ibmCurrentScreen)+CURSOR_WIDTH;
apa16ClearCursor(ACTIVE_CURSOR);
! if (offset < CURSOR_WIDTH) {
! QUEUE_RESET();
! COPY_RECT(cmd, AND_EDGE(ACTIVE_CURSOR), CURSOR_AREA_BOTTOM,
! AND_EDGE(currentCursor)-offset, CURSOR_AREA_BOTTOM,
! CURSOR_WIDTH-offset, CURSOR_HEIGHT);
! COPY_RECT(cmd, XOR_EDGE(ACTIVE_CURSOR), CURSOR_AREA_BOTTOM,
! XOR_EDGE(currentCursor)-offset, CURSOR_AREA_BOTTOM,
! CURSOR_WIDTH-offset, CURSOR_HEIGHT);
! }
CURSOR_X= APA16_WIDTH-48;
CURSOR_Y= y-ibmCursorHotY(ibmCurrentScreen);
obscured= TRUE;