fix a bug: call SyncUpdate when cursor moved; cursor surface lost when it was moved

This commit is contained in:
Vincent Wei
2020-03-08 19:52:40 +08:00
parent 4214de8490
commit c063acb4a6
2 changed files with 7 additions and 1 deletions

View File

@@ -933,6 +933,7 @@ BOOL kernel_RefreshCursor (int* x, int* y, int* button)
}
showcursor ();
GAL_SyncUpdate (__gal_screen);
}
// GAL_SyncUpdate (__gal_screen);
@@ -944,7 +945,7 @@ BOOL kernel_RefreshCursor (int* x, int* y, int* button)
if (csr_bmp.bmBits) {
hidecursor ();
showcursor ();
// GAL_SyncUpdate (__gal_screen);
GAL_SyncUpdate (__gal_screen);
}
else {
PCURSOR pcsr = (PCURSOR)CSR_CURRENT;

View File

@@ -277,6 +277,7 @@ static int PCXVFB_SetCursor (_THIS, GAL_Surface *surface, int hot_x, int hot_y)
PCXVFB_UpdateRects (this, 1, &rect);
}
PCXVFB_SyncUpdate (this);
return 0;
}
@@ -288,6 +289,7 @@ static int PCXVFB_MoveCursor (_THIS, int x, int y)
}
if (this->hidden->cursor) {
GAL_Surface* tmp;
GAL_Rect rect;
rect.x = boxleft (this);
rect.y = boxtop (this);
@@ -295,10 +297,12 @@ static int PCXVFB_MoveCursor (_THIS, int x, int y)
rect.h = CURSORHEIGHT;
/* update screen to hide cursor */
tmp = this->hidden->cursor;
this->hidden->cursor = NULL;
PCXVFB_UpdateRects (this, 1, &rect);
/* update screen to show cursor */
this->hidden->cursor = tmp;
this->hidden->csr_x = x;
this->hidden->csr_y = y;
@@ -307,6 +311,7 @@ static int PCXVFB_MoveCursor (_THIS, int x, int y)
rect.w = CURSORWIDTH;
rect.h = CURSORHEIGHT;
PCXVFB_UpdateRects (this, 1, &rect);
PCXVFB_SyncUpdate (this);
}
else {
this->hidden->csr_x = x;