Fix bug causing XDG toplevels with a parent to not respect the CSD filter
This commit is contained in:
parent
a93c263502
commit
228c2c372f
@ -61,19 +61,12 @@ fn handleRequestMode(listener: ?*c.wl_listener, data: ?*c_void) callconv(.C) voi
|
|||||||
const wlr_xdg_toplevel: *c.wlr_xdg_toplevel = @field(wlr_xdg_surface, c.wlr_xdg_surface_union).toplevel;
|
const wlr_xdg_toplevel: *c.wlr_xdg_toplevel = @field(wlr_xdg_surface, c.wlr_xdg_surface_union).toplevel;
|
||||||
const app_id: [*:0]const u8 = if (wlr_xdg_toplevel.app_id) |id| id else "NULL";
|
const app_id: [*:0]const u8 = if (wlr_xdg_toplevel.app_id) |id| id else "NULL";
|
||||||
|
|
||||||
const use_csd = for (self.server.config.csd_filter.items) |filter_app_id| {
|
|
||||||
if (std.mem.eql(u8, std.mem.span(app_id), filter_app_id)) break true;
|
|
||||||
} else false;
|
|
||||||
|
|
||||||
if (use_csd) {
|
|
||||||
_ = c.wlr_xdg_toplevel_decoration_v1_set_mode(
|
_ = c.wlr_xdg_toplevel_decoration_v1_set_mode(
|
||||||
self.wlr_xdg_toplevel_decoration,
|
self.wlr_xdg_toplevel_decoration,
|
||||||
.WLR_XDG_TOPLEVEL_DECORATION_V1_MODE_CLIENT_SIDE,
|
for (self.server.config.csd_filter.items) |filter_app_id| {
|
||||||
);
|
if (std.mem.eql(u8, std.mem.span(app_id), filter_app_id)) {
|
||||||
} else {
|
break .WLR_XDG_TOPLEVEL_DECORATION_V1_MODE_CLIENT_SIDE;
|
||||||
_ = c.wlr_xdg_toplevel_decoration_v1_set_mode(
|
|
||||||
self.wlr_xdg_toplevel_decoration,
|
|
||||||
.WLR_XDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
} else .WLR_XDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
@ -189,23 +189,19 @@ fn handleMap(listener: ?*c.wl_listener, data: ?*c_void) callconv(.C) void {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the toplevel has no parent and has an app_id which is not configured
|
// If the toplevel has an app_id which is not configured to use client side
|
||||||
// to use client side decorations, inform it that it is tiled. This
|
// decorations, inform it that it is tiled.
|
||||||
// prevents firefox, for example, from drawing shadows around itself.
|
for (root.server.config.csd_filter.items) |filter_app_id| {
|
||||||
if (wlr_xdg_toplevel.parent == null) {
|
if (std.mem.eql(u8, std.mem.span(app_id), filter_app_id)) {
|
||||||
const use_csd = for (root.server.config.csd_filter.items) |filter_app_id| {
|
|
||||||
if (std.mem.eql(u8, std.mem.span(app_id), filter_app_id)) break true;
|
|
||||||
} else false;
|
|
||||||
|
|
||||||
if (use_csd) {
|
|
||||||
view.draw_borders = false;
|
view.draw_borders = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
_ = c.wlr_xdg_toplevel_set_tiled(
|
_ = c.wlr_xdg_toplevel_set_tiled(
|
||||||
self.wlr_xdg_surface,
|
self.wlr_xdg_surface,
|
||||||
c.WLR_EDGE_LEFT | c.WLR_EDGE_RIGHT | c.WLR_EDGE_TOP | c.WLR_EDGE_BOTTOM,
|
c.WLR_EDGE_LEFT | c.WLR_EDGE_RIGHT | c.WLR_EDGE_TOP | c.WLR_EDGE_BOTTOM,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
view.map();
|
view.map();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user