summaryrefslogtreecommitdiff
path: root/Userland/notify.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-03-29 19:04:05 +0200
committerAndreas Kling <kling@serenityos.org>2020-03-29 19:37:23 +0200
commit7cfe712f4d0298cb645a602afe116698ab0fcd67 (patch)
tree51a964bf210be086634bc69bd48d3ed11debffe5 /Userland/notify.cpp
parent24a0354ce84c6c839930788bc772736f7c56ae18 (diff)
downloadserenity-7cfe712f4d0298cb645a602afe116698ab0fcd67.zip
LibGfx+LibIPC: Add Gfx::ShareableBitmap, a bitmap for easy IPC usage
With this patch, it's now possible to pass a Gfx::ShareableBitmap in an IPC message. As long as the message itself is synchronous, the bitmap will be adopted by the receiving end, and disowned by the sender nicely without any accounting effort like we've had to do in the past. Use this in NotificationServer to allow sending arbitrary bitmaps as icons instead of paths-to-icons.
Diffstat (limited to 'Userland/notify.cpp')
-rw-r--r--Userland/notify.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/Userland/notify.cpp b/Userland/notify.cpp
index 4dded943f5..37431e00ee 100644
--- a/Userland/notify.cpp
+++ b/Userland/notify.cpp
@@ -27,6 +27,7 @@
#include <LibCore/ArgsParser.h>
#include <LibGUI/Application.h>
#include <LibGUI/Notification.h>
+#include <LibGfx/Bitmap.h>
#include <stdio.h>
int main(int argc, char** argv)
@@ -45,7 +46,7 @@ int main(int argc, char** argv)
auto notification = GUI::Notification::construct();
notification->set_text(message);
notification->set_title(title);
- notification->set_icon_path(icon_path);
+ notification->set_icon(Gfx::Bitmap::load_from_file(icon_path));
notification->show();
return 0;