mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:37:45 +00:00
WindowServer: Add initial support for rendering on multiple screens
This allows WindowServer to use multiple framebuffer devices and compose the desktop with any arbitrary layout. Currently, it is assumed that it is configured contiguous and non-overlapping, but this should eventually be enforced. To make rendering efficient, each window now also tracks on which screens it needs to be rendered. This way we don't have to iterate all the windows for each screen but instead use the same rendering loop and then only render to the screen (or screens) that the window actually uses.
This commit is contained in:
parent
499c33ae0c
commit
4392da970a
42 changed files with 1127 additions and 563 deletions
|
@ -10,12 +10,14 @@
|
|||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
int screen = -1;
|
||||
int width = -1;
|
||||
int height = -1;
|
||||
int scale = 1;
|
||||
|
||||
Core::ArgsParser args_parser;
|
||||
args_parser.set_general_help("Change the screen resolution.");
|
||||
args_parser.add_positional_argument(screen, "Screen", "screen");
|
||||
args_parser.add_positional_argument(width, "Width", "width");
|
||||
args_parser.add_positional_argument(height, "Height", "height");
|
||||
args_parser.add_positional_argument(scale, "Scale Factor", "scale", Core::ArgsParser::Required::No);
|
||||
|
@ -24,7 +26,7 @@ int main(int argc, char** argv)
|
|||
// A Core::EventLoop is all we need, but WindowServerConnection needs a full Application object.
|
||||
char* dummy_argv[] = { argv[0] };
|
||||
auto app = GUI::Application::construct(1, dummy_argv);
|
||||
auto result = GUI::WindowServerConnection::the().set_resolution(Gfx::IntSize { width, height }, scale);
|
||||
auto result = GUI::WindowServerConnection::the().set_resolution(screen, Gfx::IntSize { width, height }, scale);
|
||||
if (!result.success()) {
|
||||
warnln("failed to set resolution");
|
||||
return 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue