Windows properly displayed. I mean, both, its border and top_layer are
shown. Some redrawing problems remain while resizing... They will be fixed soon. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8039 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -14,7 +14,7 @@
|
|||||||
#include "LayerData.h"
|
#include "LayerData.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#define DEBUG_LAYER
|
//#define DEBUG_LAYER
|
||||||
#ifdef DEBUG_LAYER
|
#ifdef DEBUG_LAYER
|
||||||
# define STRACE(x) printf x
|
# define STRACE(x) printf x
|
||||||
#else
|
#else
|
||||||
@@ -439,7 +439,7 @@ void Layer::RequestDraw(const BRegion ®, Layer *startFrom)
|
|||||||
Draw(fUpdateReg.Frame());
|
Draw(fUpdateReg.Frame());
|
||||||
fDriver->ConstrainClippingRegion(NULL);
|
fDriver->ConstrainClippingRegion(NULL);
|
||||||
|
|
||||||
// TODO: (WARNING!): For the Update code is MUST not be emptied!!!
|
// TODO: (WARNING!): For the Update code is MUST NOT be emptied!!!
|
||||||
fUpdateReg.MakeEmpty();
|
fUpdateReg.MakeEmpty();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -677,31 +677,69 @@ void Layer::RebuildRegions( const BRegion& reg, uint32 action, BPoint pt, BPoint
|
|||||||
{
|
{
|
||||||
fFullVisible.MakeEmpty();
|
fFullVisible.MakeEmpty();
|
||||||
fVisible = fFull;
|
fVisible = fFull;
|
||||||
if (fParent && fVisible.CountRects() >0){
|
#ifdef DEBUG_LAYER_REBUILD
|
||||||
|
printf("\n ======= Layer(%s):: RR ****** ======\n", GetName());
|
||||||
|
fFull.PrintToStream();
|
||||||
|
fVisible.PrintToStream();
|
||||||
|
printf("\n ======= Layer(%s):: RR ****** END ======\n", GetName());
|
||||||
|
|
||||||
|
if (!fParent)
|
||||||
|
printf("\t NO parent\n");
|
||||||
|
else
|
||||||
|
printf("\t VALID Parent: %s.\n", fParent->GetName());
|
||||||
|
if (!(fVisible.CountRects() > 0))
|
||||||
|
printf("\t NO visible area!\n");
|
||||||
|
else
|
||||||
|
printf("\t VALID visble area\n");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (fParent && fVisible.CountRects() > 0){
|
||||||
// not the usual case, but support fot this is needed.
|
// not the usual case, but support fot this is needed.
|
||||||
if (fParent->fAdFlags & B_LAYER_CHILDREN_DEPENDANT){
|
if (fParent->fAdFlags & B_LAYER_CHILDREN_DEPENDANT){
|
||||||
|
#ifdef DEBUG_LAYER_REBUILD
|
||||||
|
printf("\n ======= Layer(%s)::B_LAYER_CHILDREN_DEPENDANT Parent ======\n", GetName());
|
||||||
|
fFull.PrintToStream();
|
||||||
|
fVisible.PrintToStream();
|
||||||
|
#endif
|
||||||
|
|
||||||
// because we're skipping one level, we need to do out
|
// because we're skipping one level, we need to do out
|
||||||
// parent business as well.
|
// parent business as well.
|
||||||
|
|
||||||
// our visible area is relative to our parent's parent.
|
// our visible area is relative to our parent's parent.
|
||||||
if (fParent->fParent)
|
if (fParent->fParent)
|
||||||
fVisible.IntersectWith(&(fParent->fParent->fVisible));
|
fVisible.IntersectWith(&(fParent->fParent->fVisible));
|
||||||
|
#ifdef DEBUG_LAYER_REBUILD
|
||||||
|
fVisible.PrintToStream();
|
||||||
|
#endif
|
||||||
// exclude parent's visible area which could be composed by
|
// exclude parent's visible area which could be composed by
|
||||||
// prior siblings' visible areas.
|
// prior siblings' visible areas.
|
||||||
if (fVisible.CountRects() > 0)
|
if (fVisible.CountRects() > 0)
|
||||||
fVisible.Exclude(&(fParent->fVisible));
|
fVisible.Exclude(&(fParent->fVisible));
|
||||||
|
#ifdef DEBUG_LAYER_REBUILD
|
||||||
|
fVisible.PrintToStream();
|
||||||
|
#endif
|
||||||
// we have a final visible area. Include it to our parent's one,
|
// we have a final visible area. Include it to our parent's one,
|
||||||
// exclude from parent's parent.
|
// exclude from parent's parent.
|
||||||
if (fVisible.CountRects() > 0){
|
if (fVisible.CountRects() > 0){
|
||||||
fParent->fFullVisible.Include(&fVisible);
|
fParent->fFullVisible.Include(&fVisible);
|
||||||
|
#ifdef DEBUG_LAYER_REBUILD
|
||||||
|
fParent->fFullVisible.PrintToStream();
|
||||||
|
#endif
|
||||||
if (fParent->fParent)
|
if (fParent->fParent)
|
||||||
fParent->fParent->fVisible.Exclude(&fVisible);
|
fParent->fParent->fVisible.Exclude(&fVisible);
|
||||||
|
#ifdef DEBUG_LAYER_REBUILD
|
||||||
|
fParent->fParent->fVisible.PrintToStream();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
#ifdef DEBUG_LAYER_REBUILD
|
||||||
|
printf("\n ======= Layer(%s)::B_LAYER_CHILDREN_DEPENDANT Parent END ======\n", GetName());
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
// for 95+% of cases
|
// for 95+% of cases
|
||||||
else{
|
else{
|
||||||
|
#ifdef DEBUG_LAYER_REBUILD
|
||||||
|
printf("\n ======= Layer(%s):: (!)B_LAYER_CHILDREN_DEPENDANT Parent ======\n", GetName());
|
||||||
|
#endif
|
||||||
// the visible area is the one common with parent's one.
|
// the visible area is the one common with parent's one.
|
||||||
fVisible.IntersectWith(&(fParent->fVisible));
|
fVisible.IntersectWith(&(fParent->fVisible));
|
||||||
// exclude from parent's visible area. we're the owners now.
|
// exclude from parent's visible area. we're the owners now.
|
||||||
|
|||||||
@@ -17,8 +17,11 @@ enum
|
|||||||
B_LAYER_SIMPLE_MOVE = 0x00004000UL,
|
B_LAYER_SIMPLE_MOVE = 0x00004000UL,
|
||||||
B_LAYER_RESIZE = 0x00008000UL,
|
B_LAYER_RESIZE = 0x00008000UL,
|
||||||
B_LAYER_MASK_RESIZE = 0x00010000UL,
|
B_LAYER_MASK_RESIZE = 0x00010000UL,
|
||||||
|
};
|
||||||
|
|
||||||
B_LAYER_CHILDREN_DEPENDANT = 0x10000000UL,
|
enum
|
||||||
|
{
|
||||||
|
B_LAYER_CHILDREN_DEPENDANT = 0x1000U,
|
||||||
};
|
};
|
||||||
|
|
||||||
class ServerWindow;
|
class ServerWindow;
|
||||||
|
|||||||
@@ -49,7 +49,7 @@
|
|||||||
#include "CursorManager.h"
|
#include "CursorManager.h"
|
||||||
#include "Workspace.h"
|
#include "Workspace.h"
|
||||||
|
|
||||||
#define DEBUG_SERVERWINDOW
|
//#define DEBUG_SERVERWINDOW
|
||||||
//#define DEBUG_SERVERWINDOW_MOUSE
|
//#define DEBUG_SERVERWINDOW_MOUSE
|
||||||
//#define DEBUG_SERVERWINDOW_KEYBOARD
|
//#define DEBUG_SERVERWINDOW_KEYBOARD
|
||||||
|
|
||||||
@@ -309,6 +309,15 @@ void ServerWindow::Show(void)
|
|||||||
ws->BringToFrontANormalWindow(fWinBorder);
|
ws->BringToFrontANormalWindow(fWinBorder);
|
||||||
ws->SearchAndSetNewFront(fWinBorder);
|
ws->SearchAndSetNewFront(fWinBorder);
|
||||||
ws->SetFocusLayer(fWinBorder);
|
ws->SetFocusLayer(fWinBorder);
|
||||||
|
// TODO: this is UGLY.
|
||||||
|
// Normaly you have to easy pass a "FullInvalidate". But in this case, WinBorder
|
||||||
|
// is children dependant, so we CANOT rely on ANY region (full, fullVisible, visible)
|
||||||
|
// You have to figure out a way to do this 'internaly', I mean add support in
|
||||||
|
// Layer::FullInvalidate or Layer::[Start]RebuildRegions()
|
||||||
|
|
||||||
|
// What we are doinf here is BAD. We pass a rectangle instead of a region. Some areas may
|
||||||
|
// ger redrawed while there is no need for that!!!
|
||||||
|
fWinBorder->fParent->FullInvalidate(fWinBorder->fFull.Frame());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -722,7 +731,8 @@ Layer * ServerWindow::CreateLayerTree(Layer *localRoot)
|
|||||||
delete name;
|
delete name;
|
||||||
|
|
||||||
// there is no way of setting this, other than manually :-)
|
// there is no way of setting this, other than manually :-)
|
||||||
newLayer->fHidden = hidden;
|
printf("Layer (%s) hidden : %d?\n", fTitle.String(), hidden);
|
||||||
|
newLayer->fHidden = (hidden == 0)? false: true;
|
||||||
|
|
||||||
int32 dummyMsg;
|
int32 dummyMsg;
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,7 @@
|
|||||||
// TODO: Document this file completely
|
// TODO: Document this file completely
|
||||||
|
|
||||||
// Toggle general function call output
|
// Toggle general function call output
|
||||||
#define DEBUG_WINBORDER
|
//#define DEBUG_WINBORDER
|
||||||
|
|
||||||
// toggle
|
// toggle
|
||||||
//#define DEBUG_WINBORDER_MOUSE
|
//#define DEBUG_WINBORDER_MOUSE
|
||||||
@@ -112,7 +112,7 @@ WinBorder::WinBorder(const BRect &r, const char *name, const int32 look, const i
|
|||||||
|
|
||||||
WinBorder::~WinBorder(void)
|
WinBorder::~WinBorder(void)
|
||||||
{
|
{
|
||||||
STRACE(("WinBorder(%s):~WinBorder()\n",GetName()));
|
STRACE(("WinBorder(%s)::~WinBorder()\n",GetName()));
|
||||||
if (fDecorator)
|
if (fDecorator)
|
||||||
{
|
{
|
||||||
delete fDecorator;
|
delete fDecorator;
|
||||||
@@ -122,7 +122,7 @@ WinBorder::~WinBorder(void)
|
|||||||
|
|
||||||
void WinBorder::RebuildFullRegion(void)
|
void WinBorder::RebuildFullRegion(void)
|
||||||
{
|
{
|
||||||
STRACE(("WinBorder(%s):~RebuildFullRegion()\n",GetName()));
|
STRACE(("WinBorder(%s)::RebuildFullRegion()\n",GetName()));
|
||||||
|
|
||||||
fFull.MakeEmpty();
|
fFull.MakeEmpty();
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
//
|
//
|
||||||
// File Name: Workspace.cpp
|
// File Name: Workspace.cpp
|
||||||
// Author: Adi Oanca <adioanca@myrealbox.com>
|
// Author: Adi Oanca <adioanca@mymail.ro>
|
||||||
// Description: Tracks workspaces
|
// Description: Tracks workspaces
|
||||||
//
|
//
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
@@ -251,17 +251,8 @@ STRACE(("\n@Workspace(%ld)::SetFOCUSLayer( %s )\n", ID(), layer? layer->GetName(
|
|||||||
if (FocusLayer()){
|
if (FocusLayer()){
|
||||||
FocusLayer()->HighlightDecorator(true);
|
FocusLayer()->HighlightDecorator(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: there had to be a Invalidate() vresion witch takes a BRegion parameter
|
|
||||||
STRACESTREAM();
|
|
||||||
Invalidate();
|
|
||||||
}
|
}
|
||||||
else{
|
|
||||||
// Do nothing!
|
|
||||||
}
|
|
||||||
|
|
||||||
STRACE(("\n#Workspace(%ld)::SetFOCUSLayer( %s ) ENDED\n", ID(), layer? layer->GetName(): "NULL"));
|
STRACE(("\n#Workspace(%ld)::SetFOCUSLayer( %s ) ENDED\n", ID(), layer? layer->GetName(): "NULL"));
|
||||||
|
|
||||||
return FocusLayer();
|
return FocusLayer();
|
||||||
}
|
}
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
@@ -277,7 +268,7 @@ STRACE(("\n@Workspace(%ld)::SetFrontLayer( %s )\n", ID(), layer? layer->GetName(
|
|||||||
|
|
||||||
SearchAndSetNewFront(layer);
|
SearchAndSetNewFront(layer);
|
||||||
STRACESTREAM();
|
STRACESTREAM();
|
||||||
// TODO: there had to be a Invalidate() vresion witch takes a BRegion parameter
|
// TODO: remove???
|
||||||
Invalidate();
|
Invalidate();
|
||||||
|
|
||||||
return fFrontItem? fFrontItem->layerPtr: NULL;;
|
return fFrontItem? fFrontItem->layerPtr: NULL;;
|
||||||
@@ -337,7 +328,7 @@ WinBorder* Workspace::SearchWinBorder(BPoint pt){
|
|||||||
// For the moment, take windows from front to back and see in witch one 'pt' falls
|
// For the moment, take windows from front to back and see in witch one 'pt' falls
|
||||||
WinBorder *target = NULL;
|
WinBorder *target = NULL;
|
||||||
opLock.Lock();
|
opLock.Lock();
|
||||||
STRACE(("Searching (%f,%f) in...\n", pt.x, pt.y));
|
|
||||||
for( WinBorder *wb = GoToBottomItem(); wb; wb = GoToUpperItem()){
|
for( WinBorder *wb = GoToBottomItem(); wb; wb = GoToUpperItem()){
|
||||||
// wb->PrintToStream();
|
// wb->PrintToStream();
|
||||||
if (!wb->IsHidden() && wb->HasPoint(pt)){
|
if (!wb->IsHidden() && wb->HasPoint(pt)){
|
||||||
|
|||||||
Reference in New Issue
Block a user