Commit c73d009b authored by Dominik Laskowski's avatar Dominik Laskowski Committed by Commit Bot

exo: Remove conditional multi-display support

Clients predating multi-display support are no longer in use.

Bug: b:67384524
Test: None
Change-Id: Ie86eb1144e9bb31065e780718681277467258843
Reviewed-on: https://chromium-review.googlesource.com/794650Reviewed-by: default avatarDavid Reveman <reveman@chromium.org>
Commit-Queue: Dominik Laskowski <domlaskowski@chromium.org>
Cr-Commit-Position: refs/heads/master@{#519919}
parent 1e6c40b7
...@@ -2082,10 +2082,6 @@ class WaylandRemoteShell : public ash::TabletModeObserver, ...@@ -2082,10 +2082,6 @@ class WaylandRemoteShell : public ash::TabletModeObserver,
display::Screen::GetScreen()->RemoveObserver(this); display::Screen::GetScreen()->RemoveObserver(this);
} }
bool IsMultiDisplaySupported() const {
return wl_resource_get_version(remote_shell_resource_) >= 5;
}
std::unique_ptr<ShellSurface> CreateShellSurface( std::unique_ptr<ShellSurface> CreateShellSurface(
Surface* surface, Surface* surface,
int container, int container,
...@@ -2102,21 +2098,15 @@ class WaylandRemoteShell : public ash::TabletModeObserver, ...@@ -2102,21 +2098,15 @@ class WaylandRemoteShell : public ash::TabletModeObserver,
// Overridden from display::DisplayObserver: // Overridden from display::DisplayObserver:
void OnDisplayAdded(const display::Display& new_display) override { void OnDisplayAdded(const display::Display& new_display) override {
if (IsMultiDisplaySupported()) ScheduleSendDisplayMetrics(0);
ScheduleSendDisplayMetrics(0);
} }
void OnDisplayRemoved(const display::Display& old_display) override { void OnDisplayRemoved(const display::Display& old_display) override {
if (IsMultiDisplaySupported()) ScheduleSendDisplayMetrics(0);
ScheduleSendDisplayMetrics(0);
} }
void OnDisplayMetricsChanged(const display::Display& display, void OnDisplayMetricsChanged(const display::Display& display,
uint32_t changed_metrics) override { uint32_t changed_metrics) override {
if (!IsMultiDisplaySupported() &&
display::Screen::GetScreen()->GetPrimaryDisplay().id() != display.id())
return;
// No need to update when a primary display has changed without bounds // No need to update when a primary display has changed without bounds
// change. See WaylandPrimaryDisplayObserver::OnDisplayMetricsChanged // change. See WaylandPrimaryDisplayObserver::OnDisplayMetricsChanged
// for more details. // for more details.
...@@ -2177,37 +2167,23 @@ class WaylandRemoteShell : public ash::TabletModeObserver, ...@@ -2177,37 +2167,23 @@ class WaylandRemoteShell : public ash::TabletModeObserver,
const display::Screen* screen = display::Screen::GetScreen(); const display::Screen* screen = display::Screen::GetScreen();
if (IsMultiDisplaySupported()) { for (const auto& display : screen->GetAllDisplays()) {
for (const auto& display : screen->GetAllDisplays()) { const gfx::Rect& bounds = display.bounds();
const gfx::Rect& bounds = display.bounds(); const gfx::Insets& insets = display.GetWorkAreaInsets();
const gfx::Insets& insets = display.GetWorkAreaInsets();
double device_scale_factor =
WMHelper::GetInstance()->GetDisplayInfo(display.id())
.device_scale_factor();
zcr_remote_shell_v1_send_workspace(
remote_shell_resource_, static_cast<uint32_t>(display.id() >> 32),
static_cast<uint32_t>(display.id()), bounds.x(), bounds.y(),
bounds.width(), bounds.height(), insets.left(), insets.top(),
insets.right(), insets.bottom(),
DisplayTransform(display.rotation()),
wl_fixed_from_double(device_scale_factor), display.IsInternal());
}
zcr_remote_shell_v1_send_configure(remote_shell_resource_, layout_mode_); double device_scale_factor = WMHelper::GetInstance()
} ->GetDisplayInfo(display.id())
.device_scale_factor();
display::Display primary_display = screen->GetPrimaryDisplay(); zcr_remote_shell_v1_send_workspace(
const gfx::Insets& insets = primary_display.GetWorkAreaInsets(); remote_shell_resource_, static_cast<uint32_t>(display.id() >> 32),
static_cast<uint32_t>(display.id()), bounds.x(), bounds.y(),
bounds.width(), bounds.height(), insets.left(), insets.top(),
insets.right(), insets.bottom(), DisplayTransform(display.rotation()),
wl_fixed_from_double(device_scale_factor), display.IsInternal());
}
zcr_remote_shell_v1_send_configuration_changed( zcr_remote_shell_v1_send_configure(remote_shell_resource_, layout_mode_);
remote_shell_resource_, primary_display.size().width(),
primary_display.size().height(),
DisplayTransform(primary_display.rotation()),
wl_fixed_from_double(primary_display.device_scale_factor()),
insets.left(), insets.top(), insets.right(), insets.bottom(),
layout_mode_);
wl_client_flush(wl_resource_get_client(remote_shell_resource_)); wl_client_flush(wl_resource_get_client(remote_shell_resource_));
} }
...@@ -2360,11 +2336,9 @@ void remote_shell_get_remote_surface(wl_client* client, ...@@ -2360,11 +2336,9 @@ void remote_shell_get_remote_surface(wl_client* client,
shell_surface->set_state_changed_callback( shell_surface->set_state_changed_callback(
base::Bind(&HandleRemoteSurfaceStateChangedCallback, base::Bind(&HandleRemoteSurfaceStateChangedCallback,
base::Unretained(remote_surface_resource))); base::Unretained(remote_surface_resource)));
if (shell->IsMultiDisplaySupported()) { shell_surface->set_configure_callback(
shell_surface->set_configure_callback( base::Bind(&HandleRemoteSurfaceConfigureCallback,
base::Bind(&HandleRemoteSurfaceConfigureCallback, base::Unretained(remote_surface_resource)));
base::Unretained(remote_surface_resource)));
}
SetImplementation(remote_surface_resource, &remote_surface_implementation, SetImplementation(remote_surface_resource, &remote_surface_implementation,
std::move(shell_surface)); std::move(shell_surface));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment