aboutsummaryrefslogtreecommitdiff
path: root/gpu_display/src/gpu_display_win/window_manager.rs
blob: 0067185031458e26eff90f1ac46e92e1f2009338 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright 2023 The ChromiumOS Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

use std::rc::Rc;

use anyhow::Result;
use base::Tube;

use super::math_util::Size;
use super::window::GuiWindow;
use super::window_message_processor::WindowPosMessage;
use super::DisplayProperties;

pub(crate) struct NoopWindowManager {}

impl NoopWindowManager {
    /// If initialized in fullscreen mode, we would use 16:9 aspect ratio when switching to windowed
    /// mode. Note that the caller should call `set_initial_window_pos()` after window messages can
    /// be routed to `WindowManager`.
    pub fn new(
        _window: &GuiWindow,
        _display_properties: &DisplayProperties,
        _initial_host_viewport_size: Size,
        _gpu_main_display_tube: Option<Rc<Tube>>,
    ) -> Result<Self> {
        Ok(Self {})
    }

    /// This should be called only after window messages can be routed to `WindowManager`, since we
    /// rely on them to properly set the host viewport size after resizing the window.
    pub fn set_initial_window_pos(&mut self, _window: &GuiWindow) -> Result<()> {
        Ok(())
    }

    pub fn handle_display_change(&mut self, _window: &GuiWindow) {}

    pub fn handle_window_pos_message(&mut self, _window: &GuiWindow, _message: &WindowPosMessage) {}
}