зеркало из https://github.com/mozilla/pjs.git
fix broken debugging messages and fix bounds condition where a window
should be mapped.
This commit is contained in:
Родитель
b0abbaff39
Коммит
c7eb463783
|
@ -256,6 +256,8 @@ void nsScrollbar::CreateNative(Window aParent, nsRect aRect)
|
||||||
attr_mask,
|
attr_mask,
|
||||||
&attr);
|
&attr);
|
||||||
AddWindowCallback(mBar, this);
|
AddWindowCallback(mBar, this);
|
||||||
|
PR_LOG(XlibScrollbarLM, PR_LOG_DEBUG, ("nsScrollbar::CreateNative created window 0x%lx with bar 0x%lx\n",
|
||||||
|
mBaseWindow, mBar));
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP nsScrollbar::Show(PRBool bState)
|
NS_IMETHODIMP nsScrollbar::Show(PRBool bState)
|
||||||
|
@ -409,3 +411,8 @@ void nsScrollbar::LayoutBar(void)
|
||||||
mBarBounds.x, mBarBounds.y,
|
mBarBounds.x, mBarBounds.y,
|
||||||
mBarBounds.width, mBarBounds.height);
|
mBarBounds.width, mBarBounds.height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NS_IMETHODIMP nsScrollbar::Move(PRInt32 aX, PRInt32 aY)
|
||||||
|
{
|
||||||
|
return nsWidget::Move(aX, aY);
|
||||||
|
}
|
||||||
|
|
|
@ -39,6 +39,7 @@ public:
|
||||||
PRBool OnResize (nsSizeEvent &event);
|
PRBool OnResize (nsSizeEvent &event);
|
||||||
PRBool DispatchMouseEvent (nsMouseEvent &aEvent);
|
PRBool DispatchMouseEvent (nsMouseEvent &aEvent);
|
||||||
NS_IMETHOD Show (PRBool bState);
|
NS_IMETHOD Show (PRBool bState);
|
||||||
|
NS_IMETHOD Move (PRInt32 aX, PRInt32 aY);
|
||||||
NS_IMETHOD Resize (PRInt32 aWidth,
|
NS_IMETHOD Resize (PRInt32 aWidth,
|
||||||
PRInt32 aHeight,
|
PRInt32 aHeight,
|
||||||
PRBool aRepaint);
|
PRBool aRepaint);
|
||||||
|
|
|
@ -872,13 +872,13 @@ void nsWidget::WidgetMove(nsWidget *aWidget)
|
||||||
aWidget->mBounds.x,
|
aWidget->mBounds.x,
|
||||||
aWidget->mBounds.y);
|
aWidget->mBounds.y);
|
||||||
if (aWidget->mIsShown == PR_TRUE) {
|
if (aWidget->mIsShown == PR_TRUE) {
|
||||||
PR_LOG(XlibScrollingLM, PR_LOG_DEBUG, ("Mapping window 0x%lx...\n", mBaseWindow));
|
PR_LOG(XlibScrollingLM, PR_LOG_DEBUG, ("Mapping window 0x%lx...\n", aWidget->mBaseWindow));
|
||||||
aWidget->Map();
|
aWidget->Map();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
PR_LOG(XlibScrollingLM, PR_LOG_DEBUG, ("Widget is not visible...\n"));
|
PR_LOG(XlibScrollingLM, PR_LOG_DEBUG, ("Widget is not visible...\n"));
|
||||||
PR_LOG(XlibScrollingLM, PR_LOG_DEBUG, ("Unmapping window 0x%lx...\n", mBaseWindow));
|
PR_LOG(XlibScrollingLM, PR_LOG_DEBUG, ("Unmapping window 0x%lx...\n", aWidget->mBaseWindow));
|
||||||
aWidget->Unmap();
|
aWidget->Unmap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -893,13 +893,13 @@ void nsWidget::WidgetResize(nsWidget *aWidget)
|
||||||
aWidget->mBounds.width,
|
aWidget->mBounds.width,
|
||||||
aWidget->mBounds.height);
|
aWidget->mBounds.height);
|
||||||
if (aWidget->mIsShown == PR_TRUE) {
|
if (aWidget->mIsShown == PR_TRUE) {
|
||||||
PR_LOG(XlibScrollingLM, PR_LOG_DEBUG, ("Mapping window 0x%lx...\n", mBaseWindow));
|
PR_LOG(XlibScrollingLM, PR_LOG_DEBUG, ("Mapping window 0x%lx...\n", aWidget->mBaseWindow));
|
||||||
aWidget->Map();
|
aWidget->Map();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
PR_LOG(XlibScrollingLM, PR_LOG_DEBUG, ("Widget is not visible...\n"));
|
PR_LOG(XlibScrollingLM, PR_LOG_DEBUG, ("Widget is not visible...\n"));
|
||||||
PR_LOG(XlibScrollingLM, PR_LOG_DEBUG, ("Unmapping window 0x%lx...\n", mBaseWindow));
|
PR_LOG(XlibScrollingLM, PR_LOG_DEBUG, ("Unmapping window 0x%lx...\n", aWidget->mBaseWindow));
|
||||||
aWidget->Unmap();
|
aWidget->Unmap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -916,13 +916,13 @@ void nsWidget::WidgetMoveResize(nsWidget *aWidget)
|
||||||
aWidget->mBounds.x,
|
aWidget->mBounds.x,
|
||||||
aWidget->mBounds.y);
|
aWidget->mBounds.y);
|
||||||
if (aWidget->mIsShown == PR_TRUE) {
|
if (aWidget->mIsShown == PR_TRUE) {
|
||||||
PR_LOG(XlibScrollingLM, PR_LOG_DEBUG, ("Mapping window 0x%lx...\n", mBaseWindow));
|
PR_LOG(XlibScrollingLM, PR_LOG_DEBUG, ("Mapping window 0x%lx...\n", aWidget->mBaseWindow));
|
||||||
aWidget->Map();
|
aWidget->Map();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
PR_LOG(XlibScrollingLM, PR_LOG_DEBUG, ("Widget is not visible...\n"));
|
PR_LOG(XlibScrollingLM, PR_LOG_DEBUG, ("Widget is not visible...\n"));
|
||||||
PR_LOG(XlibScrollingLM, PR_LOG_DEBUG, ("Unmapping window 0x%lx...\n", mBaseWindow));
|
PR_LOG(XlibScrollingLM, PR_LOG_DEBUG, ("Unmapping window 0x%lx...\n", aWidget->mBaseWindow));
|
||||||
aWidget->Unmap();
|
aWidget->Unmap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -930,8 +930,7 @@ void nsWidget::WidgetMoveResize(nsWidget *aWidget)
|
||||||
void nsWidget::WidgetShow(nsWidget *aWidget)
|
void nsWidget::WidgetShow(nsWidget *aWidget)
|
||||||
{
|
{
|
||||||
if (PR_TRUE == WidgetVisible(aWidget->mBounds)) {
|
if (PR_TRUE == WidgetVisible(aWidget->mBounds)) {
|
||||||
PR_LOG(XlibScrollingLM, PR_LOG_DEBUG, ("Mapping window...\n"));
|
PR_LOG(XlibScrollingLM, PR_LOG_DEBUG, ("Mapping window 0x%lx...\n", aWidget->mBaseWindow));
|
||||||
PR_LOG(XlibScrollingLM, PR_LOG_DEBUG, ("Mapping window 0x%lx...\n", mBaseWindow));
|
|
||||||
aWidget->Map();
|
aWidget->Map();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -944,8 +943,8 @@ PRBool nsWidget::WidgetVisible(nsRect &aBounds)
|
||||||
nsRect scrollArea;
|
nsRect scrollArea;
|
||||||
scrollArea.x = 0;
|
scrollArea.x = 0;
|
||||||
scrollArea.y = 0;
|
scrollArea.y = 0;
|
||||||
scrollArea.width = mBounds.width;
|
scrollArea.width = mBounds.width + 1;
|
||||||
scrollArea.height = mBounds.height;
|
scrollArea.height = mBounds.height + 1;
|
||||||
if (scrollArea.Intersects(aBounds)) {
|
if (scrollArea.Intersects(aBounds)) {
|
||||||
PR_LOG(XlibScrollingLM, PR_LOG_DEBUG, ("nsWidget::WidgetVisible(): widget is visible\n"));
|
PR_LOG(XlibScrollingLM, PR_LOG_DEBUG, ("nsWidget::WidgetVisible(): widget is visible\n"));
|
||||||
return PR_TRUE;
|
return PR_TRUE;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче