Files
Marshall Greenblatt f922057255 linux: cefclient: Fix GTK windows with Wayland (see #3687)
- Fail at startup when --use-native is used with Wayland
  (unsupported, see #2804).
- Remove X11 runtime dependencies from the OSR path.
- Match the GDK backend to the Ozone platform.
- Keep GDK OpenGL enabled with OSR by presetting GDK_GL (see
  https://crrev.com/7c29ce9003d87).
- Share IsRunningOnWayland() between cefclient and ceftests and
  match Chromium detection logic.
2026-10-09 15:46:19 -04:00

25 lines
761 B
C++

// Copyright (c) 2026 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
#include "tests/shared/browser/util_linux.h"
#include <cstdlib>
#include <cstring>
#include "tests/shared/common/client_switches.h"
namespace client {
bool IsRunningOnWayland(CefRefPtr<CefCommandLine> command_line) {
if (command_line->HasSwitch(switches::kOzonePlatform)) {
return command_line->GetSwitchValue(switches::kOzonePlatform) == "wayland";
}
// Same default as ui::SetOzonePlatformForLinuxIfNeeded().
const char* session_type = getenv("XDG_SESSION_TYPE");
return session_type && strcmp(session_type, "wayland") == 0;
}
} // namespace client