summaryrefslogtreecommitdiff
path: root/src/apprt/gtk/class/surface.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/apprt/gtk/class/surface.zig')
-rw-r--r--src/apprt/gtk/class/surface.zig8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/apprt/gtk/class/surface.zig b/src/apprt/gtk/class/surface.zig
index cc17e3470..51e4ea7b2 100644
--- a/src/apprt/gtk/class/surface.zig
+++ b/src/apprt/gtk/class/surface.zig
@@ -1468,6 +1468,12 @@ pub const Surface = extern struct {
pub fn sendDesktopNotification(self: *Self, title: [:0]const u8, body: [:0]const u8) void {
const app = Application.default();
+ const priv: *Private = self.private();
+
+ const core_surface = priv.core_surface orelse {
+ log.warn("can't send notification because there is no core surface", .{});
+ return;
+ };
const t = switch (title.len) {
0 => "Ghostty",
@@ -1482,7 +1488,7 @@ pub const Surface = extern struct {
defer icon.unref();
notification.setIcon(icon.as(gio.Icon));
- const pointer = glib.Variant.newUint64(@intFromPtr(self));
+ const pointer = glib.Variant.newUint64(@intFromPtr(core_surface));
notification.setDefaultActionAndTargetValue(
"app.present-surface",
pointer,