void WorkspacesView::MouseMoved(BPoint where, uint32 transit, const BMessage* dragMessage) { WorkspacesWindow* window = dynamic_cast<WorkspacesWindow*>(Window()); if (window == NULL || !window->IsAutoRaising()) return; // Auto-Raise where = ConvertToScreen(where); BScreen screen(window); BRect screenFrame = screen.Frame(); BRect windowFrame = window->Frame(); float tabHeight = window->GetTabHeight(); float borderWidth = window->GetBorderWidth(); if (where.x == screenFrame.left || where.x == screenFrame.right || where.y == screenFrame.top || where.y == screenFrame.bottom) { // cursor is on screen edge // Stretch frame to also accept mouse moves over the window borders windowFrame.InsetBy(-borderWidth, -(tabHeight + borderWidth)); if (windowFrame.Contains(where)) window->Activate(); } }
void WorkspacesView::MouseMoved(BPoint where, uint32 transit, const BMessage* dragMessage) { WorkspacesWindow* window = dynamic_cast<WorkspacesWindow*>(Window()); if (window == NULL || !window->IsAutoRaising()) return; // Auto-Raise where = ConvertToScreen(where); BScreen screen(window); BRect frame = screen.Frame(); if (where.x == frame.left || where.x == frame.right || where.y == frame.top || where.y == frame.bottom) { // cursor is on screen edge if (window->Frame().Contains(where)) window->Activate(); } }