diff options
Diffstat (limited to 'Userland/Services/WindowServer')
-rw-r--r-- | Userland/Services/WindowServer/ScreenLayout.h | 4 | ||||
-rw-r--r-- | Userland/Services/WindowServer/ScreenLayout.ipp | 19 |
2 files changed, 15 insertions, 8 deletions
diff --git a/Userland/Services/WindowServer/ScreenLayout.h b/Userland/Services/WindowServer/ScreenLayout.h index 6a5c5b0571..4ff2d5bcf8 100644 --- a/Userland/Services/WindowServer/ScreenLayout.h +++ b/Userland/Services/WindowServer/ScreenLayout.h @@ -74,13 +74,13 @@ public: namespace IPC { template<> -bool encode(Encoder&, WindowServer::ScreenLayout::Screen const&); +ErrorOr<void> encode(Encoder&, WindowServer::ScreenLayout::Screen const&); template<> ErrorOr<WindowServer::ScreenLayout::Screen> decode(Decoder&); template<> -bool encode(Encoder&, WindowServer::ScreenLayout const&); +ErrorOr<void> encode(Encoder&, WindowServer::ScreenLayout const&); template<> ErrorOr<WindowServer::ScreenLayout> decode(Decoder&); diff --git a/Userland/Services/WindowServer/ScreenLayout.ipp b/Userland/Services/WindowServer/ScreenLayout.ipp index 77b4b04497..f9fc1d7573 100644 --- a/Userland/Services/WindowServer/ScreenLayout.ipp +++ b/Userland/Services/WindowServer/ScreenLayout.ipp @@ -393,10 +393,15 @@ bool ScreenLayout::try_auto_add_display_connector(DeprecatedString const& device namespace IPC { template<> -bool encode(Encoder& encoder, WindowServer::ScreenLayout::Screen const& screen) +ErrorOr<void> encode(Encoder& encoder, WindowServer::ScreenLayout::Screen const& screen) { - encoder << screen.mode << screen.device << screen.location << screen.resolution << screen.scale_factor; - return true; + TRY(encoder.encode(screen.mode)); + TRY(encoder.encode(screen.device)); + TRY(encoder.encode(screen.location)); + TRY(encoder.encode(screen.resolution)); + TRY(encoder.encode(screen.scale_factor)); + + return {}; } template<> @@ -412,10 +417,12 @@ ErrorOr<WindowServer::ScreenLayout::Screen> decode(Decoder& decoder) } template<> -bool encode(Encoder& encoder, WindowServer::ScreenLayout const& screen_layout) +ErrorOr<void> encode(Encoder& encoder, WindowServer::ScreenLayout const& screen_layout) { - encoder << screen_layout.screens << screen_layout.main_screen_index; - return true; + TRY(encoder.encode(screen_layout.screens)); + TRY(encoder.encode(screen_layout.main_screen_index)); + + return {}; } template<> |