* Modal windows are now correctly taken into account: no click go through to a
window with a modal window. This also completes the fix for bug #439. * Made some methods const that should have been const in the first place. * Note, there is now a Desktop::_WindowHasModal() and WindowLayer::HasModal() - the latter only works in the current workspace. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17121 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -532,14 +532,14 @@ WindowLayer::Anchor(int32 index)
|
|||||||
|
|
||||||
|
|
||||||
WindowLayer*
|
WindowLayer*
|
||||||
WindowLayer::NextWindow(int32 index)
|
WindowLayer::NextWindow(int32 index) const
|
||||||
{
|
{
|
||||||
return fAnchor[index].next;
|
return fAnchor[index].next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
WindowLayer*
|
WindowLayer*
|
||||||
WindowLayer::PreviousWindow(int32 index)
|
WindowLayer::PreviousWindow(int32 index) const
|
||||||
{
|
{
|
||||||
return fAnchor[index].previous;
|
return fAnchor[index].previous;
|
||||||
}
|
}
|
||||||
@@ -793,6 +793,9 @@ WindowLayer::MouseDown(BMessage* message, BPoint where, int32* _viewToken)
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (ViewLayer* view = ViewAt(where)) {
|
if (ViewLayer* view = ViewAt(where)) {
|
||||||
|
if (HasModal())
|
||||||
|
return;
|
||||||
|
|
||||||
// clicking a simple ViewLayer
|
// clicking a simple ViewLayer
|
||||||
if (!IsFocus()) {
|
if (!IsFocus()) {
|
||||||
DesktopSettings desktopSettings(fDesktop);
|
DesktopSettings desktopSettings(fDesktop);
|
||||||
@@ -865,6 +868,9 @@ WindowLayer::MouseUp(BMessage* message, BPoint where, int32* _viewToken)
|
|||||||
fIsSlidingTab = false;
|
fIsSlidingTab = false;
|
||||||
|
|
||||||
if (ViewLayer* view = ViewAt(where)) {
|
if (ViewLayer* view = ViewAt(where)) {
|
||||||
|
if (HasModal())
|
||||||
|
return;
|
||||||
|
|
||||||
*_viewToken = view->Token();
|
*_viewToken = view->Token();
|
||||||
view->MouseUp(message, where);
|
view->MouseUp(message, where);
|
||||||
}
|
}
|
||||||
@@ -1316,6 +1322,22 @@ WindowLayer::IsNormal() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
WindowLayer::HasModal() const
|
||||||
|
{
|
||||||
|
for (WindowLayer* window = NextWindow(fCurrentWorkspace); window != NULL;
|
||||||
|
window = window->NextWindow(fCurrentWorkspace)) {
|
||||||
|
if (window->IsHidden() || !window->IsModal())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (window->HasInSubset(this))
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Returns the windows that's in behind of the backmost position
|
\brief Returns the windows that's in behind of the backmost position
|
||||||
this window can get.
|
this window can get.
|
||||||
@@ -1399,7 +1421,7 @@ WindowLayer::RemoveFromSubset(WindowLayer* window)
|
|||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
WindowLayer::HasInSubset(WindowLayer* window)
|
WindowLayer::HasInSubset(const WindowLayer* window) const
|
||||||
{
|
{
|
||||||
if (fFeel == window->Feel() || fFeel == B_NORMAL_WINDOW_FEEL)
|
if (fFeel == window->Feel() || fFeel == B_NORMAL_WINDOW_FEEL)
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -49,8 +49,8 @@ class WindowLayer {
|
|||||||
const char* Title() const { return fTitle.String(); }
|
const char* Title() const { return fTitle.String(); }
|
||||||
|
|
||||||
window_anchor& Anchor(int32 index);
|
window_anchor& Anchor(int32 index);
|
||||||
WindowLayer* NextWindow(int32 index);
|
WindowLayer* NextWindow(int32 index) const;
|
||||||
WindowLayer* PreviousWindow(int32 index);
|
WindowLayer* PreviousWindow(int32 index) const;
|
||||||
|
|
||||||
::Desktop* Desktop() const { return fDesktop; }
|
::Desktop* Desktop() const { return fDesktop; }
|
||||||
::Decorator* Decorator() const { return fDecorator; }
|
::Decorator* Decorator() const { return fDecorator; }
|
||||||
@@ -188,12 +188,14 @@ class WindowLayer {
|
|||||||
bool IsFloating() const;
|
bool IsFloating() const;
|
||||||
bool IsNormal() const;
|
bool IsNormal() const;
|
||||||
|
|
||||||
|
bool HasModal() const;
|
||||||
|
|
||||||
WindowLayer* Frontmost(WindowLayer* first = NULL, int32 workspace = -1);
|
WindowLayer* Frontmost(WindowLayer* first = NULL, int32 workspace = -1);
|
||||||
WindowLayer* Backmost(WindowLayer* first = NULL, int32 workspace = -1);
|
WindowLayer* Backmost(WindowLayer* first = NULL, int32 workspace = -1);
|
||||||
|
|
||||||
bool AddToSubset(WindowLayer* window);
|
bool AddToSubset(WindowLayer* window);
|
||||||
void RemoveFromSubset(WindowLayer* window);
|
void RemoveFromSubset(WindowLayer* window);
|
||||||
bool HasInSubset(WindowLayer* window);
|
bool HasInSubset(const WindowLayer* window) const;
|
||||||
bool SameSubset(WindowLayer* window);
|
bool SameSubset(WindowLayer* window);
|
||||||
uint32 SubsetWorkspaces() const;
|
uint32 SubsetWorkspaces() const;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user