зеркало из https://github.com/mozilla/gecko-dev.git
Implement nsIWidget::HideWindowChrome() for gtk (bug 157371). r=blizzard, sr=jag, a=asa.
This commit is contained in:
Родитель
c5b0a4280a
Коммит
83d38b8f5f
|
@ -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);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче