Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
google
GitHub Repository: google/crosvm
Path: blob/main/gpu_display/src/gpu_display_win/window_manager.rs
5394 views
1
// Copyright 2023 The ChromiumOS Authors
2
// Use of this source code is governed by a BSD-style license that can be
3
// found in the LICENSE file.
4
5
use std::rc::Rc;
6
7
use anyhow::Result;
8
use base::Tube;
9
10
use super::math_util::Size;
11
use super::surface::DisplayProperties;
12
use super::window::GuiWindow;
13
use super::window_message_processor::WindowPosMessage;
14
15
pub(crate) struct NoopWindowManager {}
16
17
impl NoopWindowManager {
18
/// If initialized in fullscreen mode, we would use 16:9 aspect ratio when switching to windowed
19
/// mode. Note that the caller should call `set_initial_window_pos()` after window messages can
20
/// be routed to `WindowManager`.
21
pub fn new(
22
_window: &GuiWindow,
23
_display_properties: &DisplayProperties,
24
_initial_host_viewport_size: Size,
25
_gpu_main_display_tube: Option<Rc<Tube>>,
26
) -> Result<Self> {
27
Ok(Self {})
28
}
29
30
/// This should be called only after window messages can be routed to `WindowManager`, since we
31
/// rely on them to properly set the host viewport size after resizing the window.
32
pub fn set_initial_window_pos(&mut self, _window: &GuiWindow) -> Result<()> {
33
Ok(())
34
}
35
36
pub fn handle_display_change(&mut self, _window: &GuiWindow) {}
37
38
pub fn handle_window_pos_message(&mut self, _window: &GuiWindow, _message: &WindowPosMessage) {}
39
}
40
41