aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/Xi/xiwarppointer.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/Xi/xiwarppointer.c')
-rw-r--r--xorg-server/Xi/xiwarppointer.c69
1 files changed, 30 insertions, 39 deletions
diff --git a/xorg-server/Xi/xiwarppointer.c b/xorg-server/Xi/xiwarppointer.c
index 11ab241b5..3f051f759 100644
--- a/xorg-server/Xi/xiwarppointer.c
+++ b/xorg-server/Xi/xiwarppointer.c
@@ -33,18 +33,17 @@
#include <dix-config.h>
#endif
-#include <X11/X.h> /* for inputstr.h */
-#include <X11/Xproto.h> /* Request macro */
-#include "inputstr.h" /* DeviceIntPtr */
-#include "windowstr.h" /* window structure */
-#include "scrnintstr.h" /* screen structure */
+#include <X11/X.h> /* for inputstr.h */
+#include <X11/Xproto.h> /* Request macro */
+#include "inputstr.h" /* DeviceIntPtr */
+#include "windowstr.h" /* window structure */
+#include "scrnintstr.h" /* screen structure */
#include <X11/extensions/XI.h>
#include <X11/extensions/XI2proto.h>
#include "extnsionst.h"
#include "exevents.h"
#include "exglobals.h"
-#include "mipointer.h" /* for miPointerUpdateSprite */
-
+#include "mipointer.h" /* for miPointerUpdateSprite */
#include "xiwarppointer.h"
/***********************************************************************
@@ -89,24 +88,20 @@ ProcXIWarpPointer(ClientPtr client)
rc = dixLookupDevice(&pDev, stuff->deviceid, client, DixWriteAccess);
- if (rc != Success)
- {
+ if (rc != Success) {
client->errorValue = stuff->deviceid;
return rc;
}
if ((!IsMaster(pDev) && !IsFloating(pDev)) ||
- (IsMaster(pDev) && !IsPointerDevice(pDev)))
- {
+ (IsMaster(pDev) && !IsPointerDevice(pDev))) {
client->errorValue = stuff->deviceid;
return BadDevice;
}
- if (stuff->dst_win != None)
- {
+ if (stuff->dst_win != None) {
rc = dixLookupWindow(&dest, stuff->dst_win, client, DixGetAttrAccess);
- if (rc != Success)
- {
+ if (rc != Success) {
client->errorValue = stuff->dst_win;
return rc;
}
@@ -116,19 +111,17 @@ ProcXIWarpPointer(ClientPtr client)
x = pSprite->hotPhys.x;
y = pSprite->hotPhys.y;
- src_x = stuff->src_x / (double)(1 << 16);
- src_y = stuff->src_y / (double)(1 << 16);
- dst_x = stuff->dst_x / (double)(1 << 16);
- dst_y = stuff->dst_y / (double)(1 << 16);
+ src_x = stuff->src_x / (double) (1 << 16);
+ src_y = stuff->src_y / (double) (1 << 16);
+ dst_x = stuff->dst_x / (double) (1 << 16);
+ dst_y = stuff->dst_y / (double) (1 << 16);
- if (stuff->src_win != None)
- {
+ if (stuff->src_win != None) {
int winX, winY;
WindowPtr src;
rc = dixLookupWindow(&src, stuff->src_win, client, DixGetAttrAccess);
- if (rc != Success)
- {
+ if (rc != Success) {
client->errorValue = stuff->src_win;
return rc;
}
@@ -136,22 +129,22 @@ ProcXIWarpPointer(ClientPtr client)
winX = src->drawable.x;
winY = src->drawable.y;
if (src->drawable.pScreen != pSprite->hotPhys.pScreen ||
- x < winX + src_x ||
- y < winY + src_y ||
- (stuff->src_width != 0 &&
- winX + src_x + (int)stuff->src_width < 0) ||
- (stuff->src_height != 0 &&
- winY + src_y + (int)stuff->src_height < y) ||
- !PointInWindowIsVisible(src, x, y))
+ x < winX + src_x ||
+ y < winY + src_y ||
+ (stuff->src_width != 0 &&
+ winX + src_x + (int) stuff->src_width < 0) ||
+ (stuff->src_height != 0 &&
+ winY + src_y + (int) stuff->src_height < y) ||
+ !PointInWindowIsVisible(src, x, y))
return Success;
}
- if (dest)
- {
+ if (dest) {
x = dest->drawable.x;
y = dest->drawable.y;
newScreen = dest->drawable.pScreen;
- } else
+ }
+ else
newScreen = pSprite->hotPhys.pScreen;
x += dst_x;
@@ -167,8 +160,7 @@ ProcXIWarpPointer(ClientPtr client)
else if (y > newScreen->height)
y = newScreen->height - 1;
- if (newScreen == pSprite->hotPhys.pScreen)
- {
+ if (newScreen == pSprite->hotPhys.pScreen) {
if (x < pSprite->physLimits.x1)
x = pSprite->physLimits.x1;
else if (x >= pSprite->physLimits.x2)
@@ -181,9 +173,9 @@ ProcXIWarpPointer(ClientPtr client)
if (pSprite->hotShape)
ConfineToShape(pDev, pSprite->hotShape, &x, &y);
- (*newScreen->SetCursorPosition)(pDev, newScreen, x, y, TRUE);
- } else if (!PointerConfinedToScreen(pDev))
- {
+ (*newScreen->SetCursorPosition) (pDev, newScreen, x, y, TRUE);
+ }
+ else if (!PointerConfinedToScreen(pDev)) {
NewCurrentScreen(pDev, newScreen, x, y);
}
@@ -196,4 +188,3 @@ ProcXIWarpPointer(ClientPtr client)
here though. */
return Success;
}
-