mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
stylistic tweaks
This commit is contained in:
@ -472,7 +472,9 @@ extension Ghostty {
|
|||||||
let pb = NSPasteboard.general
|
let pb = NSPasteboard.general
|
||||||
pb.declareTypes([.string], owner: nil)
|
pb.declareTypes([.string], owner: nil)
|
||||||
pb.setString(valueStr, forType: .string)
|
pb.setString(valueStr, forType: .string)
|
||||||
} else {
|
return
|
||||||
|
}
|
||||||
|
|
||||||
NotificationCenter.default.post(
|
NotificationCenter.default.post(
|
||||||
name: Notification.confirmClipboard,
|
name: Notification.confirmClipboard,
|
||||||
object: surface,
|
object: surface,
|
||||||
@ -482,7 +484,6 @@ extension Ghostty {
|
|||||||
]
|
]
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
static func reloadConfig(_ userdata: UnsafeMutableRawPointer?) -> ghostty_config_t? {
|
static func reloadConfig(_ userdata: UnsafeMutableRawPointer?) -> ghostty_config_t? {
|
||||||
guard let newConfig = Self.loadConfig() else {
|
guard let newConfig = Self.loadConfig() else {
|
||||||
|
@ -2532,8 +2532,18 @@ pub fn completeClipboardRequest(
|
|||||||
) !void {
|
) !void {
|
||||||
switch (req) {
|
switch (req) {
|
||||||
.paste => try self.completeClipboardPaste(data, confirmed),
|
.paste => try self.completeClipboardPaste(data, confirmed),
|
||||||
.osc_52_read => |clipboard| try self.completeClipboardReadOSC52(data, clipboard, confirmed),
|
|
||||||
.osc_52_write => |clipboard| try self.rt_surface.setClipboardString(data, clipboard, !confirmed),
|
.osc_52_read => |clipboard| try self.completeClipboardReadOSC52(
|
||||||
|
data,
|
||||||
|
clipboard,
|
||||||
|
confirmed,
|
||||||
|
),
|
||||||
|
|
||||||
|
.osc_52_write => |clipboard| try self.rt_surface.setClipboardString(
|
||||||
|
data,
|
||||||
|
clipboard,
|
||||||
|
!confirmed,
|
||||||
|
),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -507,8 +507,6 @@ pub const Surface = struct {
|
|||||||
) void {
|
) void {
|
||||||
const alloc = self.app.core_app.alloc;
|
const alloc = self.app.core_app.alloc;
|
||||||
|
|
||||||
const request_type: apprt.ClipboardRequestType = state.*;
|
|
||||||
|
|
||||||
// Attempt to complete the request, but we may request
|
// Attempt to complete the request, but we may request
|
||||||
// confirmation.
|
// confirmation.
|
||||||
self.core_surface.completeClipboardRequest(
|
self.core_surface.completeClipboardRequest(
|
||||||
@ -523,7 +521,7 @@ pub const Surface = struct {
|
|||||||
self.opts.userdata,
|
self.opts.userdata,
|
||||||
str.ptr,
|
str.ptr,
|
||||||
state,
|
state,
|
||||||
request_type,
|
state.*,
|
||||||
);
|
);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
@ -520,7 +520,9 @@ pub fn setClipboardString(
|
|||||||
if (!confirm) {
|
if (!confirm) {
|
||||||
const clipboard = getClipboard(@ptrCast(self.gl_area), clipboard_type);
|
const clipboard = getClipboard(@ptrCast(self.gl_area), clipboard_type);
|
||||||
c.gdk_clipboard_set_text(clipboard, val.ptr);
|
c.gdk_clipboard_set_text(clipboard, val.ptr);
|
||||||
} else {
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
ClipboardConfirmationWindow.create(
|
ClipboardConfirmationWindow.create(
|
||||||
self.app,
|
self.app,
|
||||||
val,
|
val,
|
||||||
@ -530,7 +532,6 @@ pub fn setClipboardString(
|
|||||||
log.err("failed to create clipboard confirmation window err={}", .{window_err});
|
log.err("failed to create clipboard confirmation window err={}", .{window_err});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
const ClipboardRequest = struct {
|
const ClipboardRequest = struct {
|
||||||
self: *Surface,
|
self: *Surface,
|
||||||
|
Reference in New Issue
Block a user