diff options
author | Jamey Sharp <jamey@minilop.net> | 2010-05-23 10:11:47 -0700 |
---|---|---|
committer | Jamey Sharp <jamey@minilop.net> | 2010-06-03 14:03:23 -0700 |
commit | a83cff9f4d622b069c96a68b4e87a669bf1f6446 (patch) | |
tree | b29de5e363feb6b7546ce69dfa0685316bf0b234 /hw/dmx/input/dmxcommon.c | |
parent | 217ccaa5a341018457f468a774c035c0df47d918 (diff) |
Move each screen's x/y origin into ScreenRec.
Many references to the dixScreenOrigins array already had the
corresponding screen pointer handy, which meant they usually looked like
"dixScreenOrigins[pScreen->myNum]". Adding a field to ScreenRec instead
of keeping this information in a parallel array simplifies those
expressions, and eliminates a MAXSCREENS-sized array.
Since dix declared the dixScreenOrigins array, I figure allocating a
screen private for these values is overkill.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com> (i686 GNU/Linux)
Diffstat (limited to 'hw/dmx/input/dmxcommon.c')
-rw-r--r-- | hw/dmx/input/dmxcommon.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/hw/dmx/input/dmxcommon.c b/hw/dmx/input/dmxcommon.c index 2f23d1c9b..c665dad90 100644 --- a/hw/dmx/input/dmxcommon.c +++ b/hw/dmx/input/dmxcommon.c @@ -526,10 +526,9 @@ int dmxFindPointerScreen(int x, int y) int i; for (i = 0; i < dmxNumScreens; i++) { - if (x >= dixScreenOrigins[i].x - && x < dixScreenOrigins[i].x + screenInfo.screens[i]->width - && y >= dixScreenOrigins[i].y - && y < dixScreenOrigins[i].y + screenInfo.screens[i]->height) + ScreenPtr pScreen = screenInfo.screens[i]; + if (x >= pScreen->x && x < pScreen->x + pScreen->width && + y >= pScreen->y && y < pScreen->y + pScreen->height) return i; } return -1; |