#include "remoting/host/linux/active_display_monitor_x11.h"
#include <memory>
#include "base/task/bind_post_task.h"
#include "base/task/single_thread_task_runner.h"
#include "base/types/cxx23_to_underlying.h"
#include "remoting/base/logging.h"
#include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h"
#include "ui/base/x/x11_display_util.h"
#include "ui/base/x/x11_util.h"
#include "ui/gfx/x/atom_cache.h"
#include "ui/gfx/x/connection.h"
#include "ui/gfx/x/event.h"
#include "ui/gfx/x/future.h"
#include "ui/gfx/x/randr.h"
#include "ui/gfx/x/window_event_manager.h"
namespace remoting {
namespace {
constexpr std::pair<uint32_t, uint32_t> kMinRandrVersion{ … };
}
class ActiveDisplayMonitorX11::Core : public x11::EventObserver { … };
ActiveDisplayMonitorX11::Core::Core(ActiveDisplayMonitor::Callback callback)
: … { … }
ActiveDisplayMonitorX11::Core::~Core() { … }
void ActiveDisplayMonitorX11::Core::Init() { … }
void ActiveDisplayMonitorX11::Core::OnEvent(const x11::Event& xevent) { … }
void ActiveDisplayMonitorX11::Core::GetAndSendActiveDisplay() { … }
x11::Window ActiveDisplayMonitorX11::Core::GetFocusedWindow() const { … }
x11::Window ActiveDisplayMonitorX11::Core::GetTopLevelWindow(
x11::Window window) const { … }
bool ActiveDisplayMonitorX11::Core::IsWindowVisible(x11::Window window) const { … }
webrtc::ScreenId ActiveDisplayMonitorX11::Core::GetDisplayForWindow(
x11::Window window) const { … }
ActiveDisplayMonitorX11::ActiveDisplayMonitorX11(
scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner,
Callback active_display_callback)
: … { … }
ActiveDisplayMonitorX11::~ActiveDisplayMonitorX11() = default;
}