From 0f895f0ed4b2370af37d91c0ecb7649d914ed147 Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 1 Dec 2008 22:13:03 +0000 Subject: Fixed for multi-user NX mode git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1386 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/graphics/nxmu/nxmu_mouse.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'nuttx/graphics/nxmu/nxmu_mouse.c') 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 */ -- cgit v1.2.3