зеркало из https://github.com/mozilla/pjs.git
Bug 301402. HideWindowChrome should do that, not make the window fullscreen in GTK2. r+sr=blizzard,a=shaver
This commit is contained in:
Родитель
070fd5413e
Коммит
e81dc32b6b
|
@ -3192,6 +3192,20 @@ nsWindow::ConvertBorderStyles(nsBorderStyle aStyle)
|
|||
return w;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWindow::MakeFullScreen(PRBool aFullScreen)
|
||||
{
|
||||
#if GTK_CHECK_VERSION(2,2,0)
|
||||
if (aFullScreen)
|
||||
gdk_window_fullscreen (mShell->window);
|
||||
else
|
||||
gdk_window_unfullscreen (mShell->window);
|
||||
#else
|
||||
HideWindowChrome(aFullScreen);
|
||||
#endif
|
||||
return MakeFullScreenInternal(aFullScreen);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWindow::HideWindowChrome(PRBool aShouldHide)
|
||||
{
|
||||
|
@ -3206,12 +3220,6 @@ nsWindow::HideWindowChrome(PRBool aShouldHide)
|
|||
// Sawfish, metacity, and presumably other window managers get
|
||||
// confused if we change the window decorations while the window
|
||||
// is visible.
|
||||
#if GTK_CHECK_VERSION(2,2,0)
|
||||
if (aShouldHide)
|
||||
gdk_window_fullscreen (mShell->window);
|
||||
else
|
||||
gdk_window_unfullscreen (mShell->window);
|
||||
#else
|
||||
gdk_window_hide(mShell->window);
|
||||
|
||||
gint wmd;
|
||||
|
@ -3223,7 +3231,6 @@ nsWindow::HideWindowChrome(PRBool aShouldHide)
|
|||
gdk_window_set_decorations(mShell->window, (GdkWMDecoration) wmd);
|
||||
|
||||
gdk_window_show(mShell->window);
|
||||
#endif
|
||||
|
||||
// For some window managers, adding or removing window decorations
|
||||
// requires unmapping and remapping our toplevel window. Go ahead
|
||||
|
|
|
@ -146,6 +146,7 @@ public:
|
|||
PRBool aDoCapture,
|
||||
PRBool aConsumeRollupEvent);
|
||||
NS_IMETHOD GetAttention(PRInt32 aCycleCount);
|
||||
NS_IMETHOD MakeFullScreen(PRBool aFullScreen);
|
||||
NS_IMETHOD HideWindowChrome(PRBool aShouldHide);
|
||||
|
||||
// utility methods
|
||||
|
|
|
@ -551,6 +551,11 @@ NS_IMETHODIMP nsBaseWidget::HideWindowChrome(PRBool aShouldHide)
|
|||
NS_IMETHODIMP nsBaseWidget::MakeFullScreen(PRBool aFullScreen)
|
||||
{
|
||||
HideWindowChrome(aFullScreen);
|
||||
return MakeFullScreenInternal(aFullScreen);
|
||||
}
|
||||
|
||||
nsresult nsBaseWidget::MakeFullScreenInternal(PRBool aFullScreen)
|
||||
{
|
||||
nsCOMPtr<nsIFullScreen> fullScreen = do_GetService("@mozilla.org/browser/fullscreen;1");
|
||||
|
||||
if (aFullScreen) {
|
||||
|
|
|
@ -105,6 +105,7 @@ public:
|
|||
NS_IMETHOD UpdateTranslucentWindowAlpha(const nsRect& aRect, PRUint8* aAlphas);
|
||||
NS_IMETHOD HideWindowChrome(PRBool aShouldHide);
|
||||
NS_IMETHOD MakeFullScreen(PRBool aFullScreen);
|
||||
nsresult MakeFullScreenInternal(PRBool aFullScreen);
|
||||
virtual nsIRenderingContext* GetRenderingContext();
|
||||
virtual nsIDeviceContext* GetDeviceContext();
|
||||
virtual nsIAppShell * GetAppShell();
|
||||
|
|
Загрузка…
Ссылка в новой задаче