Bug 1414204 Part4: Check headless mode before calling GDK_ROOT_WINDOW. f=bdahl. r=jimm.

This commit is contained in:
Stone Shih 2017-12-06 16:54:44 +08:00
Родитель 1a9d2b9639
Коммит ff844cca1d
1 изменённых файлов: 2 добавлений и 2 удалений

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

@ -2300,7 +2300,7 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
rootPoint = anEvent.mRefPoint + widget->WidgetToScreenOffset();
}
#ifdef MOZ_WIDGET_GTK
Window root = GDK_ROOT_WINDOW();
Window root = gfxPlatform::IsHeadless() ? X11None : GDK_ROOT_WINDOW();
#else
Window root = X11None; // Could XQueryTree, but this is not important.
#endif
@ -2387,7 +2387,7 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
{
XKeyEvent &event = pluginEvent.xkey;
#ifdef MOZ_WIDGET_GTK
event.root = GDK_ROOT_WINDOW();
event.root = gfxPlatform::IsHeadless() ? X11None : GDK_ROOT_WINDOW();
event.time = anEvent.mTime;
const GdkEventKey* gdkEvent =
static_cast<const GdkEventKey*>(anEvent.mPluginEvent);