mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1189622 part 3 - Return failure if fullscreen support is not available for the X11 desktop. r=karlt
This commit is contained in:
parent
7f582514a2
commit
b8f6b5e5bf
@ -127,6 +127,7 @@ STUB(gdk_x11_get_xatom_by_name)
|
||||
STUB(gdk_x11_get_xatom_by_name_for_display)
|
||||
STUB(gdk_x11_lookup_xdisplay)
|
||||
STUB(gdk_x11_screen_get_xscreen)
|
||||
STUB(gdk_x11_screen_supports_net_wm_hint)
|
||||
STUB(gdk_x11_visual_get_xvisual)
|
||||
STUB(gdk_x11_window_foreign_new_for_display)
|
||||
STUB(gdk_x11_window_lookup_for_display)
|
||||
|
@ -4977,12 +4977,29 @@ nsWindow::PerformFullscreenTransition(FullscreenTransitionStage aStage,
|
||||
transitionData, nullptr);
|
||||
}
|
||||
|
||||
static bool
|
||||
IsFullscreenSupported(GtkWidget* aShell)
|
||||
{
|
||||
#ifdef MOZ_X11
|
||||
GdkScreen* screen = gtk_widget_get_screen(aShell);
|
||||
GdkAtom atom = gdk_atom_intern("_NET_WM_STATE_FULLSCREEN", FALSE);
|
||||
if (!gdk_x11_screen_supports_net_wm_hint(screen, atom)) {
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWindow::MakeFullScreen(bool aFullScreen, nsIScreen* aTargetScreen)
|
||||
{
|
||||
LOG(("nsWindow::MakeFullScreen [%p] aFullScreen %d\n",
|
||||
(void *)this, aFullScreen));
|
||||
|
||||
if (!IsFullscreenSupported(mShell)) {
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
}
|
||||
|
||||
if (aFullScreen) {
|
||||
if (mSizeMode != nsSizeMode_Fullscreen)
|
||||
mLastSizeMode = mSizeMode;
|
||||
|
Loading…
Reference in New Issue
Block a user