AW: [PATCH] mi: sprite: SaveUnderCursor2
Walter Harms
wharms at bfs.de
Tue Mar 9 18:12:02 UTC 2021
hi Madhurkiran Harikrishnan,
my experience is that readability reduced rapidly with indent-level.
I would suggest:
if ( ! DevHasCursor(pDev) continue;
pCursorInfo = GetSprite(pDev);
if (!pCursorInfo) continue; // just to shrink the if ()
// no braces needed
if ( pCursorInfo->isUp &&
pCursorInfo->pScreen == pScreen)
miSpriteSaveUnderCursor(pDev, pScreen);
jm2c
re,
wh
________________________________________
Von: xorg-devel <xorg-devel-bounces at lists.x.org> im Auftrag von Madhurkiran Harikrishnan <madhurkiran.harikrishnan at xilinx.com>
Gesendet: Montag, 8. März 2021 23:09
An: xorg-devel at lists.x.org
Cc: Madhurkiran Harikrishnan; Hyun Kwon
Betreff: [PATCH] mi: sprite: SaveUnderCursor2
From: Hyun Kwon <hyun.kwon at xilinx.com>
Signed-off-by: Hyun Kwon <hyun.kwon at xilinx.com>
Signed-off-by: Madhurkiran Harikrishnan <madhurkiran.harikrishnan at xilinx.com>
---
mi/mipointer.h | 2 ++
mi/misprite.c | 17 +++++++++++++++++
2 files changed, 19 insertions(+)
diff --git a/mi/mipointer.h b/mi/mipointer.h
index 7ce6409..107b24f 100644
--- a/mi/mipointer.h
+++ b/mi/mipointer.h
@@ -127,4 +127,6 @@ extern _X_EXPORT DevPrivateKeyRec miPointerScreenKeyRec;
#define miPointerScreenKey (&miPointerScreenKeyRec)
+extern _X_EXPORT void miDCSaveUnderCursor2(ScreenPtr pScreen);
+
#endif /* MIPOINTER_H */
diff --git a/mi/misprite.c b/mi/misprite.c
index add2c55..46ce9f0 100644
--- a/mi/misprite.c
+++ b/mi/misprite.c
@@ -955,3 +955,20 @@ miSpriteComputeSaved(DeviceIntPtr pDev, ScreenPtr pScreen)
pCursorInfo->saved.x2 = pCursorInfo->saved.x1 + w + wpad * 2;
pCursorInfo->saved.y2 = pCursorInfo->saved.y1 + h + hpad * 2;
}
+
+void
+miDCSaveUnderCursor2(ScreenPtr pScreen)
+{
+ DeviceIntPtr pDev;
+ miCursorInfoPtr pCursorInfo;
+
+ for (pDev = inputInfo.devices; pDev; pDev = pDev->next) {
+ if (DevHasCursor(pDev)) {
+ pCursorInfo = GetSprite(pDev);
+ if (pCursorInfo && pCursorInfo->isUp
+ && pCursorInfo->pScreen == pScreen) {
+ miSpriteSaveUnderCursor(pDev, pScreen);
+ }
+ }
+ }
+}
--
2.7.4
_______________________________________________
xorg-devel at lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel
More information about the xorg-devel
mailing list