зеркало из 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));
|
||||
}
|
||||
|
||||
#ifdef MOZ_WAYLAND
|
||||
static void output_handle_geometry(void* data, struct wl_output* wl_output,
|
||||
int x, int y, int physical_width,
|
||||
int physical_height, int subpixel,
|
||||
|
@ -410,6 +411,7 @@ void ScreenGetterWayland::GetScreenRectForWindow(nsWindow* aWindow,
|
|||
aRect->width = mMonitors[monitor].width;
|
||||
aRect->height = mMonitors[monitor].height;
|
||||
}
|
||||
#endif
|
||||
|
||||
RefPtr<nsIScreen> ScreenHelperGTK::GetScreenForWindow(nsWindow* aWindow) {
|
||||
return gScreenGetter->GetScreenForWindow(aWindow);
|
||||
|
@ -426,9 +428,12 @@ gint ScreenHelperGTK::GetGTKMonitorScaleFactor(gint aMonitorNum) {
|
|||
}
|
||||
|
||||
ScreenHelperGTK::ScreenHelperGTK() {
|
||||
#ifdef MOZ_WAYLAND
|
||||
if (GdkIsWaylandDisplay()) {
|
||||
gScreenGetter = mozilla::MakeUnique<ScreenGetterWayland>();
|
||||
} else {
|
||||
}
|
||||
#endif
|
||||
if (!gScreenGetter) {
|
||||
gScreenGetter = mozilla::MakeUnique<ScreenGetterGtk>();
|
||||
}
|
||||
gScreenGetter->Init();
|
||||
|
|
|
@ -71,6 +71,7 @@ struct MonitorConfig {
|
|||
explicit MonitorConfig(int aId) : id(aId){};
|
||||
};
|
||||
|
||||
#ifdef MOZ_WAYLAND
|
||||
class ScreenGetterWayland : public ScreenGetter {
|
||||
public:
|
||||
ScreenGetterWayland() : mRegistry() {};
|
||||
|
@ -96,6 +97,7 @@ class ScreenGetterWayland : public ScreenGetter {
|
|||
AutoTArray<MonitorConfig, 4> mMonitors;
|
||||
AutoTArray<RefPtr<Screen>, 4> mScreenList;
|
||||
};
|
||||
#endif
|
||||
|
||||
class ScreenHelperGTK final : public ScreenManager::Helper {
|
||||
public:
|
||||
|
|
|
@ -14,7 +14,12 @@
|
|||
|
||||
class nsICookieJarSettings;
|
||||
class nsWindow;
|
||||
|
||||
#ifdef MOZ_WAYLAND
|
||||
class DataOffer;
|
||||
#else
|
||||
typedef nsISupports DataOffer;
|
||||
#endif
|
||||
|
||||
namespace mozilla {
|
||||
namespace gfx {
|
||||
|
|
Загрузка…
Ссылка в новой задаче