* closing a window no longer takes you to debugger
* send mouse_[move/up/weel] only if the cursor is inside a window(not above decorator) * added WinBorder::MouseWheel() git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10912 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
a829700f98
commit
84b62fccc0
@ -941,15 +941,10 @@ void RootLayer::MouseEventHandler(int32 code, BPortLink& msg)
|
||||
|
||||
fMouseTarget->Window()->Lock();
|
||||
fMouseTarget->MouseUp(evt);
|
||||
|
||||
BMessage upmsg(B_MOUSE_UP);
|
||||
upmsg.AddInt64("when",evt.when);
|
||||
upmsg.AddPoint("where",evt.where);
|
||||
upmsg.AddInt32("modifiers",evt.modifiers);
|
||||
|
||||
fMouseTarget->Window()->SendMessageToClient(&upmsg);
|
||||
fMouseTarget->Window()->Unlock();
|
||||
|
||||
fMouseTarget=NULL;
|
||||
|
||||
STRACE(("MOUSE UP: at (%f, %f)\n", evt.where.x, evt.where.y));
|
||||
|
||||
break;
|
||||
@ -981,13 +976,6 @@ void RootLayer::MouseEventHandler(int32 code, BPortLink& msg)
|
||||
|
||||
fMouseTarget->Window()->Lock();
|
||||
fMouseTarget->MouseMoved(evt);
|
||||
|
||||
BMessage movemsg(B_MOUSE_MOVED);
|
||||
movemsg.AddInt64("when",evt.when);
|
||||
movemsg.AddPoint("where",evt.where);
|
||||
movemsg.AddInt32("buttons",evt.buttons);
|
||||
|
||||
fMouseTarget->Window()->SendMessageToClient(&movemsg);
|
||||
fMouseTarget->Window()->Unlock();
|
||||
|
||||
break;
|
||||
@ -1003,24 +991,11 @@ void RootLayer::MouseEventHandler(int32 code, BPortLink& msg)
|
||||
msg.Read<int64>(&evt.when);
|
||||
msg.Read<float>(&evt.wheel_delta_x);
|
||||
msg.Read<float>(&evt.wheel_delta_y);
|
||||
|
||||
BMessage wheelmsg(B_MOUSE_WHEEL_CHANGED);
|
||||
wheelmsg.AddInt64("when",evt.when);
|
||||
wheelmsg.AddFloat("be:wheel_delta_x",evt.wheel_delta_x);
|
||||
wheelmsg.AddFloat("be:wheel_delta_y",evt.wheel_delta_y);
|
||||
|
||||
if(!fMouseTarget)
|
||||
{
|
||||
fMouseTarget = WinBorderAt(GetDisplayDriver()->GetCursorPosition());
|
||||
|
||||
// We do nothing because there ain't a window to receive the message
|
||||
if(!fMouseTarget)
|
||||
break;
|
||||
}
|
||||
|
||||
fMouseTarget->Window()->Lock();
|
||||
fMouseTarget->Window()->SendMessageToClient(&wheelmsg);
|
||||
fMouseTarget->Window()->Unlock();
|
||||
|
||||
WinBorder *target;
|
||||
BPoint cursorPos = GetDisplayDriver()->GetCursorPosition();
|
||||
if ((target = WinBorderAt(cursorPos)))
|
||||
target->MouseWheel(evt, cursorPos);
|
||||
|
||||
break;
|
||||
}
|
||||
|
@ -287,7 +287,17 @@ void WinBorder::MouseMoved(PointerEvent& evt)
|
||||
fDecorator->DrawMinimize();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (fTopLayer->fFullVisible.Contains(evt.where))
|
||||
{
|
||||
BMessage movemsg(B_MOUSE_MOVED);
|
||||
movemsg.AddInt64("when",evt.when);
|
||||
movemsg.AddPoint("where",evt.where);
|
||||
movemsg.AddInt32("buttons",evt.buttons);
|
||||
|
||||
Window()->SendMessageToClient(&movemsg);
|
||||
}
|
||||
|
||||
fLastMousePosition = evt.where;
|
||||
}
|
||||
|
||||
@ -349,6 +359,31 @@ void WinBorder::MouseUp(PointerEvent& evt)
|
||||
Window()->Minimize(true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (fTopLayer->fFullVisible.Contains(evt.where))
|
||||
{
|
||||
BMessage upmsg(B_MOUSE_UP);
|
||||
upmsg.AddInt64("when",evt.when);
|
||||
upmsg.AddPoint("where",evt.where);
|
||||
upmsg.AddInt32("modifiers",evt.modifiers);
|
||||
|
||||
Window()->SendMessageToClient(&upmsg);
|
||||
}
|
||||
}
|
||||
|
||||
void WinBorder::MouseWheel(PointerEvent& evt, BPoint& ptWhere)
|
||||
{
|
||||
if (fTopLayer->fFullVisible.Contains(ptWhere))
|
||||
{
|
||||
BMessage wheelmsg(B_MOUSE_WHEEL_CHANGED);
|
||||
wheelmsg.AddInt64("when",evt.when);
|
||||
wheelmsg.AddFloat("be:wheel_delta_x",evt.wheel_delta_x);
|
||||
wheelmsg.AddFloat("be:wheel_delta_y",evt.wheel_delta_y);
|
||||
|
||||
Window()->Lock();
|
||||
Window()->SendMessageToClient(&wheelmsg);
|
||||
Window()->Unlock();
|
||||
}
|
||||
}
|
||||
|
||||
//! Sets the decorator focus to active or inactive colors
|
||||
|
@ -75,6 +75,7 @@ public:
|
||||
void MouseDown(PointerEvent& evt, bool sendMessage);
|
||||
void MouseMoved(PointerEvent& evt);
|
||||
void MouseUp(PointerEvent& evt);
|
||||
void MouseWheel(PointerEvent& evt, BPoint& ptWhere);
|
||||
|
||||
void UpdateColors(void);
|
||||
void UpdateDecorator(void);
|
||||
|
Loading…
Reference in New Issue
Block a user