mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 17:37:34 +00:00
WindowServer: Create the VirtualScreenBackend
This screen backend is just memory-backed and doesn't connect to any screen hardware. That way, we can boot Serenity without video hardware but in full graphical mode :^) To create a virtual screen, put something like this in your WindowServer.ini. There's no way yet to do this through Display Settings, though an existing virtual screen's settings can be changed there. ```ini [Screen0] Mode=Virtual Left=1024 Top=0 Width=1920 Height=1080 ScaleFactor=1 ```
This commit is contained in:
parent
be98ce0f9f
commit
935f401714
4 changed files with 140 additions and 4 deletions
44
Userland/Services/WindowServer/VirtualScreenBackend.h
Normal file
44
Userland/Services/WindowServer/VirtualScreenBackend.h
Normal file
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
* Copyright (c) 2022, kleines Filmröllchen <filmroellchen@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "ScreenBackend.h"
|
||||
#include "ScreenLayout.h"
|
||||
#include <AK/Error.h>
|
||||
#include <AK/Span.h>
|
||||
#include <AK/String.h>
|
||||
#include <sys/ioctl_numbers.h>
|
||||
|
||||
namespace WindowServer {
|
||||
|
||||
class VirtualScreenBackend : public ScreenBackend {
|
||||
public:
|
||||
virtual ~VirtualScreenBackend();
|
||||
|
||||
VirtualScreenBackend() = default;
|
||||
|
||||
private:
|
||||
friend class Screen;
|
||||
|
||||
virtual ErrorOr<void> open() override;
|
||||
|
||||
virtual void set_head_buffer(int index) override;
|
||||
|
||||
virtual ErrorOr<void> flush_framebuffer_rects(int, Span<FBRect const>) override { return {}; }
|
||||
|
||||
virtual ErrorOr<void> unmap_framebuffer() override;
|
||||
virtual ErrorOr<void> map_framebuffer() override;
|
||||
|
||||
virtual ErrorOr<void> set_head_resolution(FBHeadResolution) override;
|
||||
virtual ErrorOr<FBHeadProperties> get_head_properties() override;
|
||||
|
||||
int m_height { 0 };
|
||||
int m_width { 0 };
|
||||
bool m_first_buffer_active { true };
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue