mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
gtk(wayland): bind globals correctly (#8110)
This commit is contained in:
@ -157,11 +157,19 @@ pub const App = struct {
|
|||||||
const ctx_fields = @typeInfo(Context).@"struct".fields;
|
const ctx_fields = @typeInfo(Context).@"struct".fields;
|
||||||
|
|
||||||
switch (event) {
|
switch (event) {
|
||||||
.global => |v| global: {
|
.global => |v| {
|
||||||
|
log.debug("found global {s}", .{v.interface});
|
||||||
|
|
||||||
// We don't actually do anything with this other than checking
|
// We don't actually do anything with this other than checking
|
||||||
// for its existence, so we process this separately.
|
// for its existence, so we process this separately.
|
||||||
if (std.mem.orderZ(u8, v.interface, "xdg_wm_dialog_v1") == .eq)
|
if (std.mem.orderZ(
|
||||||
|
u8,
|
||||||
|
v.interface,
|
||||||
|
"xdg_wm_dialog_v1",
|
||||||
|
) == .eq) {
|
||||||
context.xdg_wm_dialog_present = true;
|
context.xdg_wm_dialog_present = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
inline for (ctx_fields) |field| {
|
inline for (ctx_fields) |field| {
|
||||||
const T = getInterfaceType(field) orelse continue;
|
const T = getInterfaceType(field) orelse continue;
|
||||||
@ -170,7 +178,8 @@ pub const App = struct {
|
|||||||
u8,
|
u8,
|
||||||
v.interface,
|
v.interface,
|
||||||
T.interface.name,
|
T.interface.name,
|
||||||
) != .eq) break :global;
|
) == .eq) {
|
||||||
|
log.debug("matched {}", .{T});
|
||||||
|
|
||||||
@field(context, field.name) = registry.bind(
|
@field(context, field.name) = registry.bind(
|
||||||
v.name,
|
v.name,
|
||||||
@ -184,6 +193,7 @@ pub const App = struct {
|
|||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// This should be a rare occurrence, but in case a global
|
// This should be a rare occurrence, but in case a global
|
||||||
|
@ -157,11 +157,19 @@ pub const App = struct {
|
|||||||
const ctx_fields = @typeInfo(Context).@"struct".fields;
|
const ctx_fields = @typeInfo(Context).@"struct".fields;
|
||||||
|
|
||||||
switch (event) {
|
switch (event) {
|
||||||
.global => |v| global: {
|
.global => |v| {
|
||||||
|
log.debug("found global {s}", .{v.interface});
|
||||||
|
|
||||||
// We don't actually do anything with this other than checking
|
// We don't actually do anything with this other than checking
|
||||||
// for its existence, so we process this separately.
|
// for its existence, so we process this separately.
|
||||||
if (std.mem.orderZ(u8, v.interface, "xdg_wm_dialog_v1") == .eq)
|
if (std.mem.orderZ(
|
||||||
|
u8,
|
||||||
|
v.interface,
|
||||||
|
"xdg_wm_dialog_v1",
|
||||||
|
) == .eq) {
|
||||||
context.xdg_wm_dialog_present = true;
|
context.xdg_wm_dialog_present = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
inline for (ctx_fields) |field| {
|
inline for (ctx_fields) |field| {
|
||||||
const T = getInterfaceType(field) orelse continue;
|
const T = getInterfaceType(field) orelse continue;
|
||||||
@ -170,7 +178,8 @@ pub const App = struct {
|
|||||||
u8,
|
u8,
|
||||||
v.interface,
|
v.interface,
|
||||||
T.interface.name,
|
T.interface.name,
|
||||||
) != .eq) break :global;
|
) == .eq) {
|
||||||
|
log.debug("matched {}", .{T});
|
||||||
|
|
||||||
@field(context, field.name) = registry.bind(
|
@field(context, field.name) = registry.bind(
|
||||||
v.name,
|
v.name,
|
||||||
@ -184,6 +193,7 @@ pub const App = struct {
|
|||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// This should be a rare occurrence, but in case a global
|
// This should be a rare occurrence, but in case a global
|
||||||
|
Reference in New Issue
Block a user