зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1721707 [Wayland] Build fix for X11 only environment r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D121460
This commit is contained in:
Родитель
34b41372f7
Коммит
a5fd2eb635
|
@ -197,6 +197,7 @@ void ScreenGetterGtk::RefreshScreens() {
|
||||||
screenManager.Refresh(std::move(screenList));
|
screenManager.Refresh(std::move(screenList));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef MOZ_WAYLAND
|
||||||
static void output_handle_geometry(void* data, struct wl_output* wl_output,
|
static void output_handle_geometry(void* data, struct wl_output* wl_output,
|
||||||
int x, int y, int physical_width,
|
int x, int y, int physical_width,
|
||||||
int physical_height, int subpixel,
|
int physical_height, int subpixel,
|
||||||
|
@ -410,6 +411,7 @@ void ScreenGetterWayland::GetScreenRectForWindow(nsWindow* aWindow,
|
||||||
aRect->width = mMonitors[monitor].width;
|
aRect->width = mMonitors[monitor].width;
|
||||||
aRect->height = mMonitors[monitor].height;
|
aRect->height = mMonitors[monitor].height;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
RefPtr<nsIScreen> ScreenHelperGTK::GetScreenForWindow(nsWindow* aWindow) {
|
RefPtr<nsIScreen> ScreenHelperGTK::GetScreenForWindow(nsWindow* aWindow) {
|
||||||
return gScreenGetter->GetScreenForWindow(aWindow);
|
return gScreenGetter->GetScreenForWindow(aWindow);
|
||||||
|
@ -426,9 +428,12 @@ gint ScreenHelperGTK::GetGTKMonitorScaleFactor(gint aMonitorNum) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ScreenHelperGTK::ScreenHelperGTK() {
|
ScreenHelperGTK::ScreenHelperGTK() {
|
||||||
|
#ifdef MOZ_WAYLAND
|
||||||
if (GdkIsWaylandDisplay()) {
|
if (GdkIsWaylandDisplay()) {
|
||||||
gScreenGetter = mozilla::MakeUnique<ScreenGetterWayland>();
|
gScreenGetter = mozilla::MakeUnique<ScreenGetterWayland>();
|
||||||
} else {
|
}
|
||||||
|
#endif
|
||||||
|
if (!gScreenGetter) {
|
||||||
gScreenGetter = mozilla::MakeUnique<ScreenGetterGtk>();
|
gScreenGetter = mozilla::MakeUnique<ScreenGetterGtk>();
|
||||||
}
|
}
|
||||||
gScreenGetter->Init();
|
gScreenGetter->Init();
|
||||||
|
|
|
@ -71,6 +71,7 @@ struct MonitorConfig {
|
||||||
explicit MonitorConfig(int aId) : id(aId){};
|
explicit MonitorConfig(int aId) : id(aId){};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef MOZ_WAYLAND
|
||||||
class ScreenGetterWayland : public ScreenGetter {
|
class ScreenGetterWayland : public ScreenGetter {
|
||||||
public:
|
public:
|
||||||
ScreenGetterWayland() : mRegistry() {};
|
ScreenGetterWayland() : mRegistry() {};
|
||||||
|
@ -96,6 +97,7 @@ class ScreenGetterWayland : public ScreenGetter {
|
||||||
AutoTArray<MonitorConfig, 4> mMonitors;
|
AutoTArray<MonitorConfig, 4> mMonitors;
|
||||||
AutoTArray<RefPtr<Screen>, 4> mScreenList;
|
AutoTArray<RefPtr<Screen>, 4> mScreenList;
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
class ScreenHelperGTK final : public ScreenManager::Helper {
|
class ScreenHelperGTK final : public ScreenManager::Helper {
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -14,7 +14,12 @@
|
||||||
|
|
||||||
class nsICookieJarSettings;
|
class nsICookieJarSettings;
|
||||||
class nsWindow;
|
class nsWindow;
|
||||||
|
|
||||||
|
#ifdef MOZ_WAYLAND
|
||||||
class DataOffer;
|
class DataOffer;
|
||||||
|
#else
|
||||||
|
typedef nsISupports DataOffer;
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
namespace gfx {
|
namespace gfx {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче