mirror of
https://github.com/VincentWei/MiniGUI.git
synced 2026-09-25 11:07:54 +08:00
handle all implementations of kernel_ShowCursorForGDI
This commit is contained in:
+37
-14
@@ -1081,6 +1081,12 @@ void kernel_ShowCursorForGDI (BOOL fShow, void* pdc)
|
||||
const RECT* prc;
|
||||
|
||||
prc = &cur_pdc->rc_output;
|
||||
|
||||
/* Since 5.0.13 */
|
||||
if (!fShow) {
|
||||
GAL_LockSurface(cur_pdc->surface);
|
||||
}
|
||||
|
||||
if (cur_pdc->surface != __gal_screen) {
|
||||
if (fShow) {
|
||||
GAL_UpdateRect (cur_pdc->surface,
|
||||
@@ -1090,7 +1096,7 @@ void kernel_ShowCursorForGDI (BOOL fShow, void* pdc)
|
||||
}
|
||||
else {
|
||||
if (!mgIsServer && (SHAREDRES_TOPMOST_LAYER != __mg_layer)) {
|
||||
return;
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (!fShow) {
|
||||
@@ -1109,6 +1115,12 @@ void kernel_ShowCursorForGDI (BOOL fShow, void* pdc)
|
||||
UNLOCK_CURSOR_SEM ();
|
||||
}
|
||||
}
|
||||
|
||||
done:
|
||||
/* Since 5.0.13 */
|
||||
if (fShow) {
|
||||
GAL_UnlockSurface(cur_pdc->surface);
|
||||
}
|
||||
}
|
||||
|
||||
#else /* defined _MGSCHEMA_SHAREDFB */
|
||||
@@ -1124,6 +1136,12 @@ void kernel_ShowCursorForGDI (BOOL fShow, void* pdc)
|
||||
}
|
||||
|
||||
prc = &cur_pdc->rc_output;
|
||||
|
||||
/* Since 5.0.13 */
|
||||
if (!fShow) {
|
||||
GAL_LockSurface(cur_pdc->surface);
|
||||
}
|
||||
|
||||
if (cur_pdc->surface == __gal_screen) {
|
||||
// Under compositing schema, we never call SyncUpdate in
|
||||
// kernel_ShowCursorForGDI for __gal_screen.
|
||||
@@ -1150,6 +1168,12 @@ void kernel_ShowCursorForGDI (BOOL fShow, void* pdc)
|
||||
// For surface other than screen, we call SyncUpdate.
|
||||
GAL_SyncUpdate (cur_pdc->surface);
|
||||
}
|
||||
|
||||
done:
|
||||
/* Since 5.0.13 */
|
||||
if (fShow) {
|
||||
GAL_UnlockSurface(cur_pdc->surface);
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* not defined _MGSCHEMA_SHAREDFB */
|
||||
@@ -1228,26 +1252,25 @@ void kernel_ShowCursorForGDI (BOOL fShow, void* pdc)
|
||||
PDC cur_pdc = (PDC)pdc;
|
||||
const RECT* prc = NULL;
|
||||
|
||||
prc = &cur_pdc->rc_output;
|
||||
|
||||
/* houhh20080827, if --disable-cursor, mginit can not update auto(qvfb). */
|
||||
#if 0
|
||||
if (cur_pdc->surface == __gal_screen
|
||||
&& mgIsServer && (SHAREDRES_TOPMOST_LAYER != __mg_layer))
|
||||
return;
|
||||
|
||||
if (fShow)
|
||||
GAL_UpdateRect (cur_pdc->surface,
|
||||
prc->left, prc->top, RECTWP(prc), RECTHP(prc));
|
||||
#else
|
||||
if (!mgIsServer && (SHAREDRES_TOPMOST_LAYER != __mg_layer)) {
|
||||
return;
|
||||
}
|
||||
|
||||
prc = &cur_pdc->rc_output;
|
||||
|
||||
/* Since 5.0.13 */
|
||||
if (!fShow) {
|
||||
GAL_LockSurface(cur_pdc->surface);
|
||||
}
|
||||
|
||||
if (fShow)
|
||||
GAL_UpdateRect (cur_pdc->surface,
|
||||
prc->left, prc->top, RECTWP(prc), RECTHP(prc));
|
||||
#endif
|
||||
|
||||
/* Since 5.0.13 */
|
||||
if (fShow) {
|
||||
GAL_UnlockSurface(cur_pdc->surface);
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* _MGHAVE_CURSOR */
|
||||
|
||||
+20
-2
@@ -448,6 +448,11 @@ void kernel_ShowCursorForGDI (BOOL fShow, void* pdc)
|
||||
|
||||
prc = &cur_pdc->rc_output;
|
||||
|
||||
/* Since 5.0.13 */
|
||||
if (!fShow) {
|
||||
GAL_LockSurface(cur_pdc->surface);
|
||||
}
|
||||
|
||||
if (cur_pdc->surface != __gal_screen) {
|
||||
if (fShow) {
|
||||
GAL_UpdateRect (cur_pdc->surface,
|
||||
@@ -472,7 +477,7 @@ void kernel_ShowCursorForGDI (BOOL fShow, void* pdc)
|
||||
prc->left, prc->top, RECTWP(prc), RECTHP(prc));
|
||||
//GAL_SyncUpdate (cur_pdc->surface);
|
||||
}
|
||||
return;
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (fShow && nShowCount >= 0 && pCurCsr) {
|
||||
@@ -488,6 +493,12 @@ void kernel_ShowCursorForGDI (BOOL fShow, void* pdc)
|
||||
//GAL_SyncUpdate (cur_pdc->surface);
|
||||
}
|
||||
}
|
||||
|
||||
done:
|
||||
/* Since 5.0.13 */
|
||||
if (fShow) {
|
||||
GAL_UnlockSurface(cur_pdc->surface);
|
||||
}
|
||||
}
|
||||
|
||||
int GUIAPI ShowCursor (BOOL fShow)
|
||||
@@ -516,9 +527,16 @@ void kernel_ShowCursorForGDI(BOOL fShow, void* pdc)
|
||||
|
||||
prc = &cur_pdc->rc_output;
|
||||
|
||||
if (fShow)
|
||||
/* Since 5.0.13 */
|
||||
if (!fShow) {
|
||||
GAL_LockSurface(cur_pdc->surface);
|
||||
}
|
||||
else {
|
||||
GAL_UpdateRect (cur_pdc->surface,
|
||||
prc->left, prc->top, RECTWP(prc), RECTHP(prc));
|
||||
/* Since 5.0.13 */
|
||||
GAL_UnlockSurface(cur_pdc->surface);
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* _MGHAVE_CURSOR */
|
||||
|
||||
+4
-5
@@ -566,19 +566,18 @@ void kernel_ShowCursorForGDI (BOOL fShow, void* pdc)
|
||||
PDC cur_pdc = (PDC)pdc;
|
||||
const RECT* prc = NULL;
|
||||
|
||||
prc = &cur_pdc->rc_output;
|
||||
|
||||
/* Since 5.0.13 */
|
||||
if (!fShow) {
|
||||
GAL_LockSurface(cur_pdc->surface);
|
||||
}
|
||||
|
||||
prc = &cur_pdc->rc_output;
|
||||
|
||||
if (fShow) {
|
||||
else {
|
||||
GAL_UpdateRect (cur_pdc->surface,
|
||||
prc->left, prc->top, RECTWP(prc), RECTHP(prc));
|
||||
|
||||
/* Since 5.0.13 */
|
||||
GAL_UnLockSurface(cur_pdc->surface);
|
||||
GAL_UnlockSurface(cur_pdc->surface);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user