moving and resizing windows works very well now.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14202 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1077,8 +1077,6 @@ RootLayer::_ProcessMouseMovedEvent(PointerEvent &evt)
|
|||||||
else
|
else
|
||||||
fViewAction = B_OUTSIDE_VIEW;
|
fViewAction = B_OUTSIDE_VIEW;
|
||||||
|
|
||||||
// NOTE: testing under R5 shows that it doesn't matter if a window is created
|
|
||||||
// with B_ASYNCHRONOUS_CONTROLS flag or not. B_MOUSE_DOWN is always transmited.
|
|
||||||
lay->MouseMoved(evt, fViewAction);
|
lay->MouseMoved(evt, fViewAction);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1147,6 +1145,16 @@ RootLayer::MouseEventHandler(int32 code, BPrivate::PortLink& msg)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
#ifdef NEW_INPUT_HANDLING
|
#ifdef NEW_INPUT_HANDLING
|
||||||
|
int32 count = fMouseNotificationList.CountItems();
|
||||||
|
Layer *lay;
|
||||||
|
for (int32 i = 0; i <= count; i++) {
|
||||||
|
lay = static_cast<Layer*>(fMouseNotificationList.ItemAt(i));
|
||||||
|
if (lay)
|
||||||
|
// NOTE: testing under R5 shows that it doesn't matter if a window is created
|
||||||
|
// with B_ASYNCHRONOUS_CONTROLS flag or not. B_MOUSE_DOWN is always transmited.
|
||||||
|
lay->MouseDown(evt);
|
||||||
|
}
|
||||||
|
|
||||||
// get the pointer for one of the first RootLayer's descendants
|
// get the pointer for one of the first RootLayer's descendants
|
||||||
Layer *primaryTarget = LayerAt(evt.where, false);
|
Layer *primaryTarget = LayerAt(evt.where, false);
|
||||||
primaryTarget->MouseDown(evt);
|
primaryTarget->MouseDown(evt);
|
||||||
@@ -1256,11 +1264,22 @@ fprintf(stderr, "mouse position changed in B_MOUSE_UP (%.1f, %.1f) from last B_M
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef NEW_INPUT_HANDLING
|
#ifdef NEW_INPUT_HANDLING
|
||||||
ClearNotifyLayer();
|
|
||||||
if (fLastLayerUnderMouse == NULL) {
|
if (fLastLayerUnderMouse == NULL) {
|
||||||
CRITICAL("RootLayer::MouseEventHandler(B_MOUSE_UP) fLastLayerUnderMouse is null!\n");
|
CRITICAL("RootLayer::MouseEventHandler(B_MOUSE_UP) fLastLayerUnderMouse is null!\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool foundCurrent = fMouseNotificationList.HasItem(fLastLayerUnderMouse);
|
||||||
|
int32 count = fMouseNotificationList.CountItems();
|
||||||
|
Layer *lay;
|
||||||
|
for (int32 i = 0; i <= count; i++) {
|
||||||
|
lay = static_cast<Layer*>(fMouseNotificationList.ItemAt(i));
|
||||||
|
if (lay)
|
||||||
|
lay->MouseUp(evt);
|
||||||
|
}
|
||||||
|
ClearNotifyLayer();
|
||||||
|
|
||||||
|
if (!foundCurrent)
|
||||||
fLastLayerUnderMouse->MouseUp(evt);
|
fLastLayerUnderMouse->MouseUp(evt);
|
||||||
#else
|
#else
|
||||||
if (fLastLayerUnderMouse == NULL) {
|
if (fLastLayerUnderMouse == NULL) {
|
||||||
@@ -1917,12 +1936,12 @@ RootLayer::ClearNotifyLayer()
|
|||||||
{
|
{
|
||||||
if (fNotifyLayer) {
|
if (fNotifyLayer) {
|
||||||
Lock();
|
Lock();
|
||||||
|
// remove from notification list.
|
||||||
AddToInputNotificationLists(fNotifyLayer, 0UL, 0UL);
|
AddToInputNotificationLists(fNotifyLayer, 0UL, 0UL);
|
||||||
|
// set event masks
|
||||||
fNotifyLayer->QuietlySetEventMask(fSavedEventMask);
|
fNotifyLayer->QuietlySetEventMask(fSavedEventMask);
|
||||||
fNotifyLayer->QuietlySetEventOptions(fSavedEventOptions);
|
fNotifyLayer->QuietlySetEventOptions(fSavedEventOptions);
|
||||||
|
// add to notification list with event masks set my BView::SetEventMask()
|
||||||
AddToInputNotificationLists(fNotifyLayer, fSavedEventMask, fSavedEventOptions);
|
AddToInputNotificationLists(fNotifyLayer, fSavedEventMask, fSavedEventOptions);
|
||||||
|
|
||||||
fNotifyLayer = NULL;
|
fNotifyLayer = NULL;
|
||||||
|
|||||||
@@ -109,7 +109,6 @@ WinBorder::WinBorder(const BRect &frame,
|
|||||||
fClassID = AS_WINBORDER_CLASS;
|
fClassID = AS_WINBORDER_CLASS;
|
||||||
fAdFlags = fAdFlags | B_LAYER_CHILDREN_DEPENDANT;
|
fAdFlags = fAdFlags | B_LAYER_CHILDREN_DEPENDANT;
|
||||||
fFlags = B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE;
|
fFlags = B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE;
|
||||||
fEventMask = B_POINTER_EVENTS;
|
|
||||||
#ifdef NEW_CLIPPING
|
#ifdef NEW_CLIPPING
|
||||||
fRebuildDecRegion = true;
|
fRebuildDecRegion = true;
|
||||||
#endif
|
#endif
|
||||||
@@ -471,7 +470,6 @@ WinBorder::MouseDown(const PointerEvent& evt)
|
|||||||
else
|
else
|
||||||
goto activateWindow;
|
goto activateWindow;
|
||||||
}
|
}
|
||||||
// TODO: send mouse down to event registered BViews!!!
|
|
||||||
}
|
}
|
||||||
// clicking WinBorder visible area
|
// clicking WinBorder visible area
|
||||||
else {
|
else {
|
||||||
@@ -526,30 +524,30 @@ WinBorder::MouseDown(const PointerEvent& evt)
|
|||||||
if (action == DEC_MOVETOBACK) {
|
if (action == DEC_MOVETOBACK) {
|
||||||
GetRootLayer()->ActiveWorkspace()->MoveToBack(this);
|
GetRootLayer()->ActiveWorkspace()->MoveToBack(this);
|
||||||
}
|
}
|
||||||
else if (action == DEC_DRAG) {
|
else {
|
||||||
|
if (action == DEC_DRAG || action == DEC_RESIZE || action == DEC_SLIDETAB)
|
||||||
GetRootLayer()->SetNotifyLayer(this, B_POINTER_EVENTS, 0UL);
|
GetRootLayer()->SetNotifyLayer(this, B_POINTER_EVENTS, 0UL);
|
||||||
|
|
||||||
activateWindow:
|
activateWindow:
|
||||||
GetRootLayer()->ActiveWorkspace()->AttemptToActivate(this);
|
GetRootLayer()->ActiveWorkspace()->AttemptToActivate(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
GetRootLayer()->ActiveWorkspace()->GetState(&newState);
|
GetRootLayer()->ActiveWorkspace()->GetState(&newState);
|
||||||
//--------------------------
|
|
||||||
// BOOKMARK!
|
|
||||||
// send window activation messages
|
|
||||||
|
|
||||||
// NOTE !!! ATM we're sending B_WINDOW_ACTIVATED to front windows only!
|
// BOOKMARK!
|
||||||
// This means floating windows do not have their BWindow::WindowActivated()
|
// TODO: there can be more than one window active at a time! ex: a normal + floating_app, with
|
||||||
// hook function called.
|
// floating window having focus.
|
||||||
if (oldState.Front != newState.Front) {
|
// send window activation messages
|
||||||
if (oldState.Front && oldState.Front->Window()) {
|
if (oldState.Active != newState.Active) {
|
||||||
|
if (oldState.Active && oldState.Active->Window()) {
|
||||||
BMessage msg(B_WINDOW_ACTIVATED);
|
BMessage msg(B_WINDOW_ACTIVATED);
|
||||||
msg.AddBool("active", false);
|
msg.AddBool("active", false);
|
||||||
oldState.Front->Window()->SendMessageToClient(&msg, B_NULL_TOKEN, false);
|
oldState.Active->Window()->SendMessageToClient(&msg, B_NULL_TOKEN, false);
|
||||||
}
|
}
|
||||||
if (newState.Front && newState.Front->Window()) {
|
if (newState.Active && newState.Active->Window()) {
|
||||||
BMessage msg(B_WINDOW_ACTIVATED);
|
BMessage msg(B_WINDOW_ACTIVATED);
|
||||||
msg.AddBool("active", true);
|
msg.AddBool("active", true);
|
||||||
newState.Front->Window()->SendMessageToClient(&msg, B_NULL_TOKEN, false);
|
newState.Active->Window()->SendMessageToClient(&msg, B_NULL_TOKEN, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -567,14 +565,12 @@ WinBorder::MouseDown(const PointerEvent& evt)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// trigger region rebuilding and redraw
|
||||||
#ifndef NEW_CLIPPING
|
#ifndef NEW_CLIPPING
|
||||||
GetRootLayer()->invalidate_layer(this, fFull);
|
GetRootLayer()->invalidate_layer(this, fFull);
|
||||||
#else
|
#else
|
||||||
GetRootLayer()->do_Invalidate(Bounds());
|
GetRootLayer()->do_Invalidate(Bounds());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// TODO: FINISH ABOVE.
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// in FFM mode
|
// in FFM mode
|
||||||
|
|||||||
@@ -231,6 +231,7 @@ Workspace::GetState(Workspace::State *state) const
|
|||||||
{
|
{
|
||||||
state->Front = Front();
|
state->Front = Front();
|
||||||
state->Focus = Focus();
|
state->Focus = Focus();
|
||||||
|
state->Active = Active();
|
||||||
|
|
||||||
ListData *cursor = fBottomItem;
|
ListData *cursor = fBottomItem;
|
||||||
while (cursor) {
|
while (cursor) {
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ class Workspace {
|
|||||||
State() : Front(NULL), Focus(NULL), WindowList(40) { }
|
State() : Front(NULL), Focus(NULL), WindowList(40) { }
|
||||||
WinBorder* Front;
|
WinBorder* Front;
|
||||||
WinBorder* Focus;
|
WinBorder* Focus;
|
||||||
|
WinBorder* Active;
|
||||||
BList WindowList;
|
BList WindowList;
|
||||||
};
|
};
|
||||||
Workspace( const int32 ID,
|
Workspace( const int32 ID,
|
||||||
|
|||||||
Reference in New Issue
Block a user