Implement nsIWidget::HideWindowChrome() for gtk (bug 157371). r=blizzard, sr=jag, a=asa.

This commit is contained in:
bryner%netscape.com 2002-07-16 22:49:33 +00:00
Родитель c5b0a4280a
Коммит 83d38b8f5f
2 изменённых файлов: 37 добавлений и 0 удалений

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

@ -4040,3 +4040,39 @@ NS_IMETHODIMP nsWindow::ResetInputState()
#endif // USE_XIM #endif // USE_XIM
return NS_OK; return NS_OK;
} }
NS_IMETHODIMP
nsWindow::HideWindowChrome(PRBool aShouldHide)
{
if (!mShell) {
// This is not a top-level window widget.
return NS_ERROR_FAILURE;
}
// Sawfish, metacity, and presumably other window managers get
// confused if we change the window decorations while the window
// is visible.
if (mShown)
gdk_window_hide(mShell->window);
gint wmd;
if (aShouldHide)
wmd = 0;
else
wmd = ConvertBorderStyles(mBorderStyle);
gdk_window_set_decorations(mShell->window, (GdkWMDecoration) wmd);
if (mShown)
gdk_window_show(mShell->window);
// For some window managers, adding or removing window decorations
// requires unmapping and remapping our toplevel window. Go ahead
// and flush the queue here so that we don't end up with a BadWindow
// error later when this happens (when the persistence timer fires
// and GetWindowPos is called).
XSync(GDK_DISPLAY(), False);
return NS_OK;
}

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

@ -113,6 +113,7 @@ public:
NS_IMETHOD SetFocus(PRBool aRaise); NS_IMETHOD SetFocus(PRBool aRaise);
NS_IMETHOD GetAttention(void); NS_IMETHOD GetAttention(void);
NS_IMETHOD Destroy(); NS_IMETHOD Destroy();
NS_IMETHOD HideWindowChrome(PRBool aShouldHide);
GdkCursor *GtkCreateCursor(nsCursor aCursorType); GdkCursor *GtkCreateCursor(nsCursor aCursorType);
virtual void LoseFocus(void); virtual void LoseFocus(void);