1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 09:27:35 +00:00

Applications: Create a display properties manager

An interactive application to modify the current display settings, such as
the current wallpaper as well as the screen resolution. Currently we're
adding the resolutions ourselves, because there's currently no way to
detect was resolutions the current display adapter supports (or at least
I can't see one... Maybe VBE does and I'm stupid). It even comes with
a very nice template'd `ItemList` that can support a vector of any type,
which makes life much simpler.
This commit is contained in:
Jesse Buhagiar 2019-09-03 21:45:02 +10:00 committed by Andreas Kling
parent af14b8dc59
commit ecbc0322c1
15 changed files with 329 additions and 1 deletions

View file

@ -7,6 +7,7 @@
#include <LibDraw/Point.h>
#include <LibDraw/Rect.h>
#include <WindowServer/WSCursor.h>
#include <WindowServer/WSAPITypes.h>
#include <WindowServer/WSWindowType.h>
class WSEvent : public CEvent {
@ -60,6 +61,7 @@ public:
APIGetClipboardContentsRequest,
APISetWallpaperRequest,
APIGetWallpaperRequest,
APISetResolutionRequest,
APISetWindowOverrideCursorRequest,
APISetWindowHasAlphaChannelRequest,
APIMoveWindowToFrontRequest,
@ -441,6 +443,20 @@ public:
}
};
class WSAPISetResolutionRequest final : public WSAPIClientRequest {
public:
explicit WSAPISetResolutionRequest(int client_id, int width, int height)
: WSAPIClientRequest(WSEvent::APISetResolutionRequest, client_id),
m_resolution(width, height)
{
}
Size resolution() const { return m_resolution; }
private:
Size m_resolution;
};
class WSAPISetWindowTitleRequest final : public WSAPIClientRequest {
public:
explicit WSAPISetWindowTitleRequest(int client_id, int window_id, const String& title)