summaryrefslogtreecommitdiff
path: root/nuttx/graphics/nxmu/nxmu_mouse.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-12-01 22:13:03 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-12-01 22:13:03 +0000
commit0f895f0ed4b2370af37d91c0ecb7649d914ed147 (patch)
tree0aed3e4de0338044be420062103f72c88a430fa3 /nuttx/graphics/nxmu/nxmu_mouse.c
parent2e5d80f7a34c92e7182b549bd35e0b218fd100a4 (diff)
downloadpx4-nuttx-0f895f0ed4b2370af37d91c0ecb7649d914ed147.tar.gz
px4-nuttx-0f895f0ed4b2370af37d91c0ecb7649d914ed147.tar.bz2
px4-nuttx-0f895f0ed4b2370af37d91c0ecb7649d914ed147.zip
Fixed for multi-user NX mode
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1386 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/graphics/nxmu/nxmu_mouse.c')
-rw-r--r--nuttx/graphics/nxmu/nxmu_mouse.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/nuttx/graphics/nxmu/nxmu_mouse.c b/nuttx/graphics/nxmu/nxmu_mouse.c
index c18fb98eb..80ab60cb7 100644
--- a/nuttx/graphics/nxmu/nxmu_mouse.c
+++ b/nuttx/graphics/nxmu/nxmu_mouse.c
@@ -130,7 +130,7 @@ int nxmu_mousereport(struct nxbe_window_s *wnd)
outmsg.buttons = g_mbutton;
nxgl_vectsubtract(&outmsg.pos, &g_mpos, &wnd->origin);
- ret = mq_send(wnd->conn->swrmq, outmsg,
+ ret = mq_send(wnd->conn->swrmq, &outmsg,
sizeof(struct nxclimsg_mousein_s), NX_SVRMSG_PRIO);
if (ret < 0)
{
@@ -155,8 +155,8 @@ int nxmu_mousereport(struct nxbe_window_s *wnd)
*
****************************************************************************/
-void nxmu_mousein(FAR struct nxfe_state_s *fe,
- FAR const struct nxgl_point_s *pos, int buttons)
+int nxmu_mousein(FAR struct nxfe_state_s *fe,
+ FAR const struct nxgl_point_s *pos, int buttons)
{
struct nxbe_window_s *wnd;
nxgl_coord_t x = pos->x;
@@ -193,7 +193,6 @@ void nxmu_mousein(FAR struct nxfe_state_s *fe,
g_mpos.y = y;
g_mbutton = buttons;
-
/* Pick the window to receive the mouse event. Start with
* the top window and go down. Step with the first window
* that gets the mouse report
@@ -201,13 +200,23 @@ void nxmu_mousein(FAR struct nxfe_state_s *fe,
for (wnd = fe->be.topwnd; wnd; wnd = wnd->below)
{
- ret = nxsu_mousereport(wnd);
- if (ret == 0)
+ /* The background window normally has no callback structure
+ * (unless a client has taken control of the background via
+ * nx_requestbkgd()).
+ */
+
+ if (wnd->cb)
{
- break;
+ ret = nxmu_mousereport(wnd);
+ if (ret == 0)
+ {
+ break;
+ }
}
}
}
+
+ return OK;
}
#endif /* CONFIG_NX_MOUSE */