mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-03-05 04:55:10 +00:00
WindowServer: Spawn a secondary thread to decode wallpapers.
The threading API's are not very mature, so this code looks a bit crufty but it does take the load off the WindowServer main thread when changing wallpapers. :^)
This commit is contained in:
@@ -332,11 +332,12 @@ void WSClientConnection::handle_request(const WSAPISetWindowOpacityRequest& requ
|
||||
|
||||
void WSClientConnection::handle_request(const WSAPISetWallpaperRequest& request)
|
||||
{
|
||||
bool success = WSWindowManager::the().set_wallpaper(request.wallpaper());
|
||||
WSAPI_ServerMessage response;
|
||||
response.type = WSAPI_ServerMessage::Type::DidSetWallpaper;
|
||||
response.value = success;
|
||||
post_message(response);
|
||||
WSWindowManager::the().set_wallpaper(request.wallpaper(), [&] (bool success) {
|
||||
WSAPI_ServerMessage response;
|
||||
response.type = WSAPI_ServerMessage::Type::DidSetWallpaper;
|
||||
response.value = success;
|
||||
post_message(response);
|
||||
});
|
||||
}
|
||||
|
||||
void WSClientConnection::handle_request(const WSAPIGetWallpaperRequest&)
|
||||
|
||||
Reference in New Issue
Block a user