Backing out bug 278353 since it causes Tdhtml to crash

This commit is contained in:
roc+%cs.cmu.edu 2005-02-17 20:22:38 +00:00
Родитель 90a1b76325
Коммит dd51e969a4
4 изменённых файлов: 58 добавлений и 93 удалений

Просмотреть файл

@ -493,44 +493,6 @@ NS_IMETHODIMP nsWidget::CaptureRollupEvents(nsIRollupListener * aListener, PRBoo
return NS_OK;
}
GdkWindow* nsWidget::GetLayeringWindow()
{
return mWidget->window;
}
void nsWidget::ResetZOrder()
{
if (!GetNextSibling()) {
GdkWindow* window = GetLayeringWindow();
if (window) {
gdk_window_raise(window);
}
} else {
// Move this widget and all the widgets above it to the top, in
// the right order
for (nsWidget* w = this; w;
w = NS_STATIC_CAST(nsWidget*, w->GetNextSibling())) {
GdkWindow* window = w->GetLayeringWindow();
if (window) {
gdk_window_raise(window);
}
}
}
}
NS_IMETHODIMP nsWidget::SetZIndex(PRInt32 aZIndex)
{
nsIWidget* oldPrev = GetPrevSibling();
nsBaseWidget::SetZIndex(aZIndex);
if (GetPrevSibling() == oldPrev) {
return NS_OK;
}
ResetZOrder();
}
NS_IMETHODIMP nsWidget::IsVisible(PRBool &aState)
{
if (mWidget)

Просмотреть файл

@ -124,8 +124,6 @@ public:
virtual PRBool OnResize(nsRect &aRect);
virtual PRBool OnMove(PRInt32 aX, PRInt32 aY);
NS_IMETHOD SetZIndex(PRInt32 aZIndex);
nsIFontMetrics *GetFont(void);
NS_IMETHOD SetFont(const nsFont &aFont);
@ -199,9 +197,6 @@ public:
// Return the Gdk window used for rendering
virtual GdkWindow * GetRenderWindow(GtkObject * aGtkWidget);
// Return the Gdk window used for positioning, raising and lowering
virtual GdkWindow* GetLayeringWindow();
// get the toplevel window for this widget
virtual GtkWindow *GetTopLevelWindow(void);
@ -324,13 +319,9 @@ public:
// This reduces problems with 16-bit coordinates wrapping.
virtual void ResetInternalVisibility();
// Reestablish the correct Z-ordering of this widget among
// its siblings
void ResetZOrder();
protected:
// override this method to do whatever you have to do to make this
// widget visible or invisibile --- i.e., the real work of Show()
// override this method to do whatever you have to do to make this widget
// visible or invisibile --- i.e., the real work of Show()
virtual void SetInternalVisibility(PRBool aVisible);
//////////////////////////////////////////////////////////////////

Просмотреть файл

@ -2498,15 +2498,7 @@ void nsWindow::SetInternalVisibility(PRBool aVisible)
{
// don't show if we are too small
if (mIsTooSmall)
{
aVisible = PR_FALSE;
}
// Bail out now if we have nothing to do
if (aVisible == mInternalShown)
{
return;
}
mInternalShown = aVisible;
@ -2534,13 +2526,6 @@ void nsWindow::SetInternalVisibility(PRBool aVisible)
if (mShell)
gtk_widget_show(mShell);
}
// We just brought ourselves to the top. If we're not supposed to
// be at the top, put us back where we belong.
if (GetNextSibling()) {
ResetZOrder();
}
// and if we've been grabbed, grab for good measure.
if (sGrabWindow == this && mLastGrabFailed && !nsWindow::DragInProgress())
NativeGrab(PR_TRUE);
@ -2647,6 +2632,8 @@ NS_IMETHODIMP nsWindow::Move(PRInt32 aX, PRInt32 aY)
mBounds.x = aX;
mBounds.y = aY;
ResetInternalVisibility();
if (mIsToplevel && mShell)
{
#ifdef DEBUG
@ -2676,14 +2663,12 @@ NS_IMETHODIMP nsWindow::Move(PRInt32 aX, PRInt32 aY)
else if (mSuperWin) {
gdk_window_move(mSuperWin->shell_window, aX, aY);
}
ResetInternalVisibility();
return NS_OK;
}
NS_IMETHODIMP nsWindow::Resize(PRInt32 aWidth, PRInt32 aHeight, PRBool aRepaint)
{
PRBool nNeedToShow = PR_FALSE;
PRInt32 sizeHeight = aHeight;
PRInt32 sizeWidth = aWidth;
@ -2699,21 +2684,61 @@ NS_IMETHODIMP nsWindow::Resize(PRInt32 aWidth, PRInt32 aHeight, PRBool aRepaint)
mBounds.width = aWidth;
mBounds.height = aHeight;
// code to keep the window from showing before it has been moved or
// resized
// if we are resized to 1x1 or less, we will hide the window.
// Show(TRUE) will be ignored until a larger resize has happened
ResetInternalVisibility();
for (nsIWidget* kid = mFirstChild; kid; kid = kid->GetNextSibling()) {
NS_STATIC_CAST(nsWidget*, kid)->ResetInternalVisibility();
}
// code to keep the window from showing before it has been moved or resized
// if we are resized to 1x1 or less, we will hide the window. Show(TRUE) will be ignored until a
// larger resize has happened
if (aWidth <= 1 || aHeight <= 1)
{
aWidth = 1;
aHeight = 1;
mIsTooSmall = PR_TRUE;
if (mMozArea)
{
aWidth = 1;
aHeight = 1;
mIsTooSmall = PR_TRUE;
if (mShell)
{
if (GTK_WIDGET_VISIBLE(mShell))
{
gtk_widget_hide(mMozArea);
gtk_widget_hide(mShell);
gtk_widget_unmap(mShell);
}
}
else
{
gtk_widget_hide(mMozArea);
}
}
else
{
aWidth = 1;
aHeight = 1;
mIsTooSmall = PR_TRUE;
NS_ASSERTION(mSuperWin,"no super window!");
if (!mSuperWin) return NS_ERROR_FAILURE;
gdk_window_hide(mSuperWin->bin_window);
gdk_window_hide(mSuperWin->shell_window);
}
mInternalShown = PR_FALSE;
}
else
{
mIsTooSmall = PR_FALSE;
if (mIsTooSmall)
{
// if we are not shown, we don't want to force a show here, so check and see if Show(TRUE) has been called
nNeedToShow = mShown;
mIsTooSmall = PR_FALSE;
}
}
if (mSuperWin) {
// toplevel window? if so, we should resize it as well.
if (mIsToplevel && mShell)
@ -2746,15 +2771,13 @@ NS_IMETHODIMP nsWindow::Resize(PRInt32 aWidth, PRInt32 aHeight, PRBool aRepaint)
//g_print("not sending resize event\n");
}
if (nNeedToShow) {
Show(PR_TRUE);
}
if (aRepaint)
Invalidate(PR_FALSE);
// Do the actual work of showing or hiding the window as necessary
ResetInternalVisibility();
for (nsIWidget* kid = mFirstChild; kid; kid = kid->GetNextSibling()) {
NS_STATIC_CAST(nsWidget*, kid)->ResetInternalVisibility();
}
return NS_OK;
}
@ -3035,12 +3058,6 @@ nsWindow::GetGdkGrabWindow(void)
}
GdkWindow *
nsWindow::GetLayeringWindow()
{
return mSuperWin->shell_window;
}
/* virtual */ GdkWindow *
nsWindow::GetRenderWindow(GtkObject * aGtkObject)
{
@ -4321,10 +4338,8 @@ nsWindow::HideWindowChrome(PRBool aShouldHide)
gdk_window_set_decorations(mShell->window, (GdkWMDecoration) wmd);
if (mShown)
if (mShown)
gdk_window_show(mShell->window);
// XXX This brought the window to the front, which maybe isn't what
// we wanted.
// For some window managers, adding or removing window decorations
// requires unmapping and remapping our toplevel window. Go ahead

Просмотреть файл

@ -189,9 +189,6 @@ public:
static nsWindow *GetGrabWindow(void);
GdkWindow *GetGdkGrabWindow(void);
// Return the Gdk window used for positioning, raising and lowering
virtual GdkWindow* GetLayeringWindow();
virtual void DispatchSetFocusEvent(void);
virtual void DispatchLostFocusEvent(void);
virtual void DispatchActivateEvent(void);