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
This commit is contained in:
@@ -156,8 +156,8 @@ InputServerStream::GetNextCursorPosition(BPoint &where)
|
|||||||
uint32 pos = fCursorBuffer->pos;
|
uint32 pos = fCursorBuffer->pos;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
where.x = pos & 0xffff;
|
where.x = pos >> 16UL;
|
||||||
where.y = pos >> 16L;
|
where.y = pos & 0xffff;
|
||||||
|
|
||||||
atomic_and(&fCursorBuffer->read, 0);
|
atomic_and(&fCursorBuffer->read, 0);
|
||||||
// this tells the input_server that we've read the
|
// this tells the input_server that we've read the
|
||||||
|
|||||||
@@ -934,9 +934,6 @@ RootLayer::MouseEventHandler(BMessage *msg)
|
|||||||
where.ConstrainTo(Frame());
|
where.ConstrainTo(Frame());
|
||||||
|
|
||||||
if (fLastMousePosition != where) {
|
if (fLastMousePosition != where) {
|
||||||
// move cursor on screen
|
|
||||||
GetHWInterface()->MoveCursorTo(where.x, where.y);
|
|
||||||
|
|
||||||
// If this happens, it's input server's fault.
|
// If this happens, it's input server's fault.
|
||||||
// There might be additional fields an application expects in B_MOUSE_MOVED
|
// There might be additional fields an application expects in B_MOUSE_MOVED
|
||||||
// message, and in this way it won't get them.
|
// message, and in this way it won't get them.
|
||||||
@@ -988,9 +985,6 @@ RootLayer::MouseEventHandler(BMessage *msg)
|
|||||||
where.ConstrainTo(fFrame);
|
where.ConstrainTo(fFrame);
|
||||||
|
|
||||||
if (fLastMousePosition != where) {
|
if (fLastMousePosition != where) {
|
||||||
// move cursor on screen
|
|
||||||
GetHWInterface()->MoveCursorTo(where.x, where.y);
|
|
||||||
|
|
||||||
// If this happens, it's input server's fault.
|
// If this happens, it's input server's fault.
|
||||||
// There might be additional fields an application expects in B_MOUSE_MOVED
|
// There might be additional fields an application expects in B_MOUSE_MOVED
|
||||||
// message, and in this way it won't get them.
|
// message, and in this way it won't get them.
|
||||||
@@ -1032,21 +1026,10 @@ RootLayer::MouseEventHandler(BMessage *msg)
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case B_MOUSE_MOVED: {
|
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);
|
|
||||||
|
|
||||||
_ProcessMouseMovedEvent(msg);
|
_ProcessMouseMovedEvent(msg);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
case B_MOUSE_WHEEL_CHANGED: {
|
case B_MOUSE_WHEEL_CHANGED: {
|
||||||
//printf("RootLayer::MouseEventHandler(B_MOUSE_WHEEL_CHANGED)\n");
|
//printf("RootLayer::MouseEventHandler(B_MOUSE_WHEEL_CHANGED)\n");
|
||||||
// FEATURE: This is a tentative change: mouse wheel messages are always sent to the window
|
// FEATURE: This is a tentative change: mouse wheel messages are always sent to the window
|
||||||
|
|||||||
@@ -1599,8 +1599,11 @@ InputServer::_DispatchEvent(BMessage* event)
|
|||||||
#else
|
#else
|
||||||
atomic_set((int32*)&fCursorBuffer->pos, (uint32)fMousePos.x << 16UL
|
atomic_set((int32*)&fCursorBuffer->pos, (uint32)fMousePos.x << 16UL
|
||||||
| ((uint32)fMousePos.y & 0xffff));
|
| ((uint32)fMousePos.y & 0xffff));
|
||||||
if (atomic_or(&fCursorBuffer->read, 1) == 0)
|
if (atomic_or(&fCursorBuffer->read, 1) == 0) {
|
||||||
release_sem_etc(fCursorSem, 0, B_RELEASE_ALL);
|
release_sem(fCursorSem);
|
||||||
|
// TODO: this doesn't work for some reason...
|
||||||
|
// release_sem_etc(fCursorSem, 0, B_RELEASE_ALL);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user