From 1b120ea94a183163116326c5243719ba2c6798de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Fri, 18 Nov 2005 11:50:34 +0000 Subject: [PATCH] Turns out there were a couple of problems: * RootLayer still set the mouse cursor... * mixed up "x" and "y" in the cursor thread * but that didn't get noticed, as B_RELEASE_ALL doesn't seem to work (will look into that next)! The cursor finally works as good as expected in Qemu :-) git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15013 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/EventStream.cpp | 4 ++-- src/servers/app/RootLayer.cpp | 21 ++------------------- src/servers/input/InputServer.cpp | 7 +++++-- 3 files changed, 9 insertions(+), 23 deletions(-) diff --git a/src/servers/app/EventStream.cpp b/src/servers/app/EventStream.cpp index 20819e1eee..e93e0e7a33 100644 --- a/src/servers/app/EventStream.cpp +++ b/src/servers/app/EventStream.cpp @@ -156,8 +156,8 @@ InputServerStream::GetNextCursorPosition(BPoint &where) uint32 pos = fCursorBuffer->pos; #endif - where.x = pos & 0xffff; - where.y = pos >> 16L; + where.x = pos >> 16UL; + where.y = pos & 0xffff; atomic_and(&fCursorBuffer->read, 0); // this tells the input_server that we've read the diff --git a/src/servers/app/RootLayer.cpp b/src/servers/app/RootLayer.cpp index 9299efaa5c..1915c3483f 100644 --- a/src/servers/app/RootLayer.cpp +++ b/src/servers/app/RootLayer.cpp @@ -934,9 +934,6 @@ RootLayer::MouseEventHandler(BMessage *msg) where.ConstrainTo(Frame()); if (fLastMousePosition != where) { - // move cursor on screen - GetHWInterface()->MoveCursorTo(where.x, where.y); - // If this happens, it's input server's fault. // There might be additional fields an application expects in B_MOUSE_MOVED // message, and in this way it won't get them. @@ -988,9 +985,6 @@ RootLayer::MouseEventHandler(BMessage *msg) where.ConstrainTo(fFrame); if (fLastMousePosition != where) { - // move cursor on screen - GetHWInterface()->MoveCursorTo(where.x, where.y); - // If this happens, it's input server's fault. // There might be additional fields an application expects in B_MOUSE_MOVED // message, and in this way it won't get them. @@ -1032,21 +1026,10 @@ RootLayer::MouseEventHandler(BMessage *msg) break; } - case B_MOUSE_MOVED: { - //printf("RootLayer::MouseEventHandler(B_MOUSE_MOVED)\n"); - - BPoint where(0,0); - - msg->FindPoint("where", &where); - - where.ConstrainTo(fFrame); - // move cursor on screen - GetHWInterface()->MoveCursorTo(where.x, where.y); - + case B_MOUSE_MOVED: _ProcessMouseMovedEvent(msg); - break; - } + case B_MOUSE_WHEEL_CHANGED: { //printf("RootLayer::MouseEventHandler(B_MOUSE_WHEEL_CHANGED)\n"); // FEATURE: This is a tentative change: mouse wheel messages are always sent to the window diff --git a/src/servers/input/InputServer.cpp b/src/servers/input/InputServer.cpp index 3960748be1..3576c630f2 100644 --- a/src/servers/input/InputServer.cpp +++ b/src/servers/input/InputServer.cpp @@ -1599,8 +1599,11 @@ InputServer::_DispatchEvent(BMessage* event) #else atomic_set((int32*)&fCursorBuffer->pos, (uint32)fMousePos.x << 16UL | ((uint32)fMousePos.y & 0xffff)); - if (atomic_or(&fCursorBuffer->read, 1) == 0) - release_sem_etc(fCursorSem, 0, B_RELEASE_ALL); + if (atomic_or(&fCursorBuffer->read, 1) == 0) { + release_sem(fCursorSem); + // TODO: this doesn't work for some reason... +// release_sem_etc(fCursorSem, 0, B_RELEASE_ALL); + } #endif } break;