mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 00:36:07 +03:00
apprt/gtk: small comments
This commit is contained in:
@ -178,15 +178,6 @@ pub fn focusedSurface(self: *const App) ?*Surface {
|
||||
return surface;
|
||||
}
|
||||
|
||||
/// Is this the last focused surface. This is only valid while on the main
|
||||
/// thread before tick is called.
|
||||
pub fn isFocused(self: *const App, surface: *const Surface) bool {
|
||||
if (!self.hasSurface(surface)) return false;
|
||||
const focused = self.focused_surface orelse return false;
|
||||
if (!self.hasSurface(focused)) return false;
|
||||
return surface == focused;
|
||||
}
|
||||
|
||||
/// Returns true if confirmation is needed to quit the app. It is up to
|
||||
/// the apprt to call this.
|
||||
pub fn needsConfirmQuit(self: *const App) bool {
|
||||
|
@ -861,11 +861,17 @@ fn gtkActionPresentSurface(
|
||||
/// This is called to setup the action map that this application supports.
|
||||
/// This should be called only once on startup.
|
||||
fn initActions(self: *App) void {
|
||||
// The set of actions. Each action has (in order):
|
||||
// [0] The action name
|
||||
// [1] The callback function
|
||||
// [2] The GVariantType of the parameter
|
||||
//
|
||||
// For action names:
|
||||
// https://docs.gtk.org/gio/type_func.Action.name_is_valid.html
|
||||
const actions = .{
|
||||
.{ "quit", >kActionQuit, null },
|
||||
.{ "open_config", >kActionOpenConfig, null },
|
||||
.{ "reload_config", >kActionReloadConfig, null },
|
||||
// https://docs.gtk.org/gio/type_func.Action.name_is_valid.html
|
||||
.{ "present-surface", >kActionPresentSurface, c.G_VARIANT_TYPE("t") },
|
||||
};
|
||||
|
||||
|
@ -1146,12 +1146,10 @@ pub fn showDesktopNotification(
|
||||
|
||||
const notification = c.g_notification_new(t.ptr);
|
||||
defer c.g_object_unref(notification);
|
||||
|
||||
c.g_notification_set_body(notification, body.ptr);
|
||||
|
||||
const icon = c.g_themed_icon_new("com.mitchellh.ghostty");
|
||||
defer c.g_object_unref(icon);
|
||||
|
||||
c.g_notification_set_icon(notification, icon);
|
||||
|
||||
const pointer = c.g_variant_new_uint64(@intFromPtr(&self.core_surface));
|
||||
|
Reference in New Issue
Block a user