mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:47:45 +00:00
WindowServer: Add API to set/get screen layouts
This sets the stage so that DisplaySettings can configure the screen layout and set various screen resolutions in one go. It also allows for an easy "atomic" revert of the previous settings.
This commit is contained in:
parent
34394044b3
commit
aa15bf81e4
23 changed files with 558 additions and 228 deletions
|
@ -11,11 +11,17 @@
|
|||
#include <LibGUI/Forward.h>
|
||||
#include <LibGfx/Rect.h>
|
||||
#include <Services/Taskbar/TaskbarWindow.h>
|
||||
#include <Services/WindowServer/ScreenLayout.h>
|
||||
|
||||
namespace GUI {
|
||||
|
||||
using ScreenLayout = WindowServer::ScreenLayout;
|
||||
|
||||
class Desktop {
|
||||
public:
|
||||
// Most people will probably have 4 screens or less
|
||||
static constexpr size_t default_screen_rect_count = 4;
|
||||
|
||||
static Desktop& the();
|
||||
Desktop();
|
||||
|
||||
|
@ -35,7 +41,7 @@ public:
|
|||
void did_receive_screen_rects(Badge<WindowServerConnection>, const Vector<Gfx::IntRect, 4>&, size_t);
|
||||
|
||||
private:
|
||||
Vector<Gfx::IntRect, 4> m_rects;
|
||||
Vector<Gfx::IntRect, default_screen_rect_count> m_rects;
|
||||
size_t m_main_screen_index { 0 };
|
||||
Gfx::IntRect m_bounding_rect;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue