Floating windows no longer flicker when moving a window to another workspace
using the shortcut keys (Alt-Fn). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18593 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
6474795008
commit
d479fa7ae4
@ -739,6 +739,7 @@ Desktop::SetWorkspace(int32 index)
|
|||||||
|
|
||||||
int32 previousIndex = fCurrentWorkspace;
|
int32 previousIndex = fCurrentWorkspace;
|
||||||
RGBColor previousColor = fWorkspaces[fCurrentWorkspace].Color();
|
RGBColor previousColor = fWorkspaces[fCurrentWorkspace].Color();
|
||||||
|
bool movedMouseEventWindow = false;
|
||||||
|
|
||||||
if (fMouseEventWindow != NULL) {
|
if (fMouseEventWindow != NULL) {
|
||||||
if (fMouseEventWindow->IsNormal()) {
|
if (fMouseEventWindow->IsNormal()) {
|
||||||
@ -752,6 +753,7 @@ Desktop::SetWorkspace(int32 index)
|
|||||||
_Windows(previousIndex).RemoveWindow(fMouseEventWindow);
|
_Windows(previousIndex).RemoveWindow(fMouseEventWindow);
|
||||||
|
|
||||||
_UpdateSubsetWorkspaces(fMouseEventWindow, previousIndex, index);
|
_UpdateSubsetWorkspaces(fMouseEventWindow, previousIndex, index);
|
||||||
|
movedMouseEventWindow = true;
|
||||||
|
|
||||||
// send B_WORKSPACES_CHANGED message
|
// send B_WORKSPACES_CHANGED message
|
||||||
fMouseEventWindow->WorkspacesChanged(oldWorkspaces,
|
fMouseEventWindow->WorkspacesChanged(oldWorkspaces,
|
||||||
@ -829,6 +831,10 @@ Desktop::SetWorkspace(int32 index)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_UpdateFronts(false);
|
||||||
|
_UpdateFloating(previousIndex, index,
|
||||||
|
movedMouseEventWindow ? fMouseEventWindow : NULL);
|
||||||
|
|
||||||
BRegion stillAvailableOnScreen;
|
BRegion stillAvailableOnScreen;
|
||||||
_RebuildClippingForAllWindows(stillAvailableOnScreen);
|
_RebuildClippingForAllWindows(stillAvailableOnScreen);
|
||||||
_SetBackground(stillAvailableOnScreen);
|
_SetBackground(stillAvailableOnScreen);
|
||||||
@ -840,7 +846,7 @@ Desktop::SetWorkspace(int32 index)
|
|||||||
|
|
||||||
if (window->InWorkspace(previousIndex)
|
if (window->InWorkspace(previousIndex)
|
||||||
|| (window == fMouseEventWindow && fMouseEventWindow->IsNormal())
|
|| (window == fMouseEventWindow && fMouseEventWindow->IsNormal())
|
||||||
|| (!window->IsFloating() && !window->IsNormal() && window->HasInSubset(fMouseEventWindow))) {
|
|| (!window->IsNormal() && window->HasInSubset(fMouseEventWindow))) {
|
||||||
// this window was visible before, and is already handled in the above loop
|
// this window was visible before, and is already handled in the above loop
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -848,9 +854,6 @@ Desktop::SetWorkspace(int32 index)
|
|||||||
dirty.Include(&window->VisibleRegion());
|
dirty.Include(&window->VisibleRegion());
|
||||||
}
|
}
|
||||||
|
|
||||||
_UpdateFronts(false);
|
|
||||||
_UpdateFloating(previousIndex, index);
|
|
||||||
|
|
||||||
// Set new focus to the front window, but keep focus to a floating
|
// Set new focus to the front window, but keep focus to a floating
|
||||||
// window if still visible
|
// window if still visible
|
||||||
if (!_Windows(index).HasWindow(FocusWindow()) || !FocusWindow()->IsFloating())
|
if (!_Windows(index).HasWindow(FocusWindow()) || !FocusWindow()->IsFloating())
|
||||||
@ -933,7 +936,8 @@ Desktop::_Windows(int32 index)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Desktop::_UpdateFloating(int32 previousWorkspace, int32 nextWorkspace)
|
Desktop::_UpdateFloating(int32 previousWorkspace, int32 nextWorkspace,
|
||||||
|
WindowLayer* mouseEventWindow)
|
||||||
{
|
{
|
||||||
if (previousWorkspace == -1)
|
if (previousWorkspace == -1)
|
||||||
previousWorkspace = fCurrentWorkspace;
|
previousWorkspace = fCurrentWorkspace;
|
||||||
@ -960,7 +964,8 @@ Desktop::_UpdateFloating(int32 previousWorkspace, int32 nextWorkspace)
|
|||||||
_Windows(nextWorkspace).AddWindow(floating,
|
_Windows(nextWorkspace).AddWindow(floating,
|
||||||
floating->Frontmost(_Windows(nextWorkspace).FirstWindow(), nextWorkspace));
|
floating->Frontmost(_Windows(nextWorkspace).FirstWindow(), nextWorkspace));
|
||||||
floating->SetCurrentWorkspace(nextWorkspace);
|
floating->SetCurrentWorkspace(nextWorkspace);
|
||||||
_ShowWindow(floating);
|
if (mouseEventWindow != fFront)
|
||||||
|
_ShowWindow(floating);
|
||||||
|
|
||||||
// TODO:
|
// TODO:
|
||||||
// put the floating last in the floating window list to preserve
|
// put the floating last in the floating window list to preserve
|
||||||
|
@ -199,7 +199,8 @@ class Desktop : public MessageLooper, public ScreenOwner {
|
|||||||
void _SetBackground(BRegion& background);
|
void _SetBackground(BRegion& background);
|
||||||
|
|
||||||
void _UpdateFloating(int32 previousWorkspace = -1,
|
void _UpdateFloating(int32 previousWorkspace = -1,
|
||||||
int32 nextWorkspace = -1);
|
int32 nextWorkspace = -1,
|
||||||
|
WindowLayer* mouseEventWindow = NULL);
|
||||||
void _UpdateBack();
|
void _UpdateBack();
|
||||||
void _UpdateFront(bool updateFloating = true);
|
void _UpdateFront(bool updateFloating = true);
|
||||||
void _UpdateFronts(bool updateFloating = true);
|
void _UpdateFronts(bool updateFloating = true);
|
||||||
|
Loading…
Reference in New Issue
Block a user