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 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(
|
||||
self.wlr_xdg_toplevel_decoration,
|
||||
.WLR_XDG_TOPLEVEL_DECORATION_V1_MODE_CLIENT_SIDE,
|
||||
);
|
||||
} else {
|
||||
_ = c.wlr_xdg_toplevel_decoration_v1_set_mode(
|
||||
self.wlr_xdg_toplevel_decoration,
|
||||
.WLR_XDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE,
|
||||
for (self.server.config.csd_filter.items) |filter_app_id| {
|
||||
if (std.mem.eql(u8, std.mem.span(app_id), filter_app_id)) {
|
||||
break .WLR_XDG_TOPLEVEL_DECORATION_V1_MODE_CLIENT_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
|
||||
// to use client side decorations, inform it that it is tiled. This
|
||||
// prevents firefox, for example, from drawing shadows around itself.
|
||||
if (wlr_xdg_toplevel.parent == null) {
|
||||
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) {
|
||||
// If the toplevel has an app_id which is not configured to use client side
|
||||
// decorations, inform it that it is tiled.
|
||||
for (root.server.config.csd_filter.items) |filter_app_id| {
|
||||
if (std.mem.eql(u8, std.mem.span(app_id), filter_app_id)) {
|
||||
view.draw_borders = false;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
_ = c.wlr_xdg_toplevel_set_tiled(
|
||||
self.wlr_xdg_surface,
|
||||
c.WLR_EDGE_LEFT | c.WLR_EDGE_RIGHT | c.WLR_EDGE_TOP | c.WLR_EDGE_BOTTOM,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
view.map();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user