summaryrefslogtreecommitdiff
path: root/Userland/Services/WindowServer
diff options
context:
space:
mode:
authornetworkException <git@nwex.de>2022-08-02 00:51:37 +0200
committerBrian Gianforcaro <b.gianfo@gmail.com>2022-08-02 04:04:08 +0000
commitad060befad8dbdfaec4bb5af35d6b4c6a06bc42d (patch)
tree1342d36d0196eb2ffcf6c829074d352b1934f1c6 /Userland/Services/WindowServer
parent2cdc7c4ca07d2e86cad4b630f19d7713447a542d (diff)
downloadserenity-ad060befad8dbdfaec4bb5af35d6b4c6a06bc42d.zip
WindowServer+LibGUI: Remove awkward roundtrip for set wallpaper response
Previously we would wait for a separate message confirming that a wallpaper got set instead of just calling a synchronous api. I'm guessing that this was a limitation of the IPC system when WindowServer got ported to using it. This patch removes the SetWallpaperFinished message and updates the set_wallpaper api to synchronously return a success boolean.
Diffstat (limited to 'Userland/Services/WindowServer')
-rw-r--r--Userland/Services/WindowServer/ConnectionFromClient.cpp5
-rw-r--r--Userland/Services/WindowServer/ConnectionFromClient.h2
-rw-r--r--Userland/Services/WindowServer/WindowClient.ipc2
-rw-r--r--Userland/Services/WindowServer/WindowServer.ipc2
4 files changed, 4 insertions, 7 deletions
diff --git a/Userland/Services/WindowServer/ConnectionFromClient.cpp b/Userland/Services/WindowServer/ConnectionFromClient.cpp
index 0cbad6b1ef..be9f0f63db 100644
--- a/Userland/Services/WindowServer/ConnectionFromClient.cpp
+++ b/Userland/Services/WindowServer/ConnectionFromClient.cpp
@@ -305,10 +305,9 @@ void ConnectionFromClient::set_window_opacity(i32 window_id, float opacity)
it->value->set_opacity(opacity);
}
-void ConnectionFromClient::set_wallpaper(Gfx::ShareableBitmap const& bitmap)
+Messages::WindowServer::SetWallpaperResponse ConnectionFromClient::set_wallpaper(Gfx::ShareableBitmap const& bitmap)
{
- Compositor::the().set_wallpaper(bitmap.bitmap());
- async_set_wallpaper_finished(true);
+ return Compositor::the().set_wallpaper(bitmap.bitmap());
}
void ConnectionFromClient::set_background_color(String const& background_color)
diff --git a/Userland/Services/WindowServer/ConnectionFromClient.h b/Userland/Services/WindowServer/ConnectionFromClient.h
index 0ab98d2ac5..e36db2fad8 100644
--- a/Userland/Services/WindowServer/ConnectionFromClient.h
+++ b/Userland/Services/WindowServer/ConnectionFromClient.h
@@ -126,7 +126,7 @@ private:
virtual void set_fullscreen(i32, bool) override;
virtual void set_frameless(i32, bool) override;
virtual void set_forced_shadow(i32, bool) override;
- virtual void set_wallpaper(Gfx::ShareableBitmap const&) override;
+ virtual Messages::WindowServer::SetWallpaperResponse set_wallpaper(Gfx::ShareableBitmap const&) override;
virtual void set_background_color(String const&) override;
virtual void set_wallpaper_mode(String const&) override;
virtual Messages::WindowServer::GetWallpaperResponse get_wallpaper() override;
diff --git a/Userland/Services/WindowServer/WindowClient.ipc b/Userland/Services/WindowServer/WindowClient.ipc
index 9c45c137d3..ab8b53d943 100644
--- a/Userland/Services/WindowServer/WindowClient.ipc
+++ b/Userland/Services/WindowServer/WindowClient.ipc
@@ -32,8 +32,6 @@ endpoint WindowClient
applet_area_rect_changed(Gfx::IntRect rect) =|
- set_wallpaper_finished(bool success) =|
-
drag_accepted() =|
drag_cancelled() =|
diff --git a/Userland/Services/WindowServer/WindowServer.ipc b/Userland/Services/WindowServer/WindowServer.ipc
index e9b15277b9..b7db386999 100644
--- a/Userland/Services/WindowServer/WindowServer.ipc
+++ b/Userland/Services/WindowServer/WindowServer.ipc
@@ -104,7 +104,7 @@ endpoint WindowServer
popup_menu(i32 menu_id, Gfx::IntPoint screen_position) =|
dismiss_menu(i32 menu_id) =|
- set_wallpaper(Gfx::ShareableBitmap wallpaper_bitmap) =|
+ set_wallpaper(Gfx::ShareableBitmap wallpaper_bitmap) => (bool success)
set_background_color(String background_color) =|
set_wallpaper_mode(String mode) =|