2020-05-02 10:21:10 -07:00
|
|
|
// This file is part of river, a dynamic tiling wayland compositor.
|
|
|
|
//
|
2020-11-11 11:30:21 -08:00
|
|
|
// Copyright 2020 The River Developers
|
2020-05-02 10:21:10 -07:00
|
|
|
//
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
|
2020-04-25 12:40:26 -07:00
|
|
|
const Self = @This();
|
|
|
|
|
|
|
|
const std = @import("std");
|
2020-11-03 15:23:21 -08:00
|
|
|
const wlr = @import("wlroots");
|
|
|
|
const wl = @import("wayland").server.wl;
|
2020-04-25 12:40:26 -07:00
|
|
|
|
2020-06-16 16:25:11 -07:00
|
|
|
const log = @import("log.zig");
|
2020-06-16 11:54:05 -07:00
|
|
|
const util = @import("util.zig");
|
2020-05-02 10:21:10 -07:00
|
|
|
|
2020-05-02 14:11:56 -07:00
|
|
|
const Box = @import("Box.zig");
|
2020-10-17 07:45:18 -07:00
|
|
|
const Seat = @import("Seat.zig");
|
2020-05-02 14:11:56 -07:00
|
|
|
const View = @import("View.zig");
|
2020-04-25 12:40:26 -07:00
|
|
|
const ViewStack = @import("view_stack.zig").ViewStack;
|
2020-05-02 14:11:56 -07:00
|
|
|
const XdgPopup = @import("XdgPopup.zig");
|
2020-04-25 12:40:26 -07:00
|
|
|
|
|
|
|
/// The view this xdg toplevel implements
|
|
|
|
view: *View,
|
|
|
|
|
|
|
|
/// The corresponding wlroots object
|
2020-11-03 15:23:21 -08:00
|
|
|
xdg_surface: *wlr.XdgSurface,
|
2020-04-25 12:40:26 -07:00
|
|
|
|
|
|
|
// Listeners that are always active over the view's lifetime
|
2020-12-31 06:35:35 -08:00
|
|
|
destroy: wl.Listener(*wlr.XdgSurface) = wl.Listener(*wlr.XdgSurface).init(handleDestroy),
|
|
|
|
map: wl.Listener(*wlr.XdgSurface) = wl.Listener(*wlr.XdgSurface).init(handleMap),
|
|
|
|
unmap: wl.Listener(*wlr.XdgSurface) = wl.Listener(*wlr.XdgSurface).init(handleUnmap),
|
2020-04-25 12:40:26 -07:00
|
|
|
|
|
|
|
// Listeners that are only active while the view is mapped
|
2020-12-31 06:35:35 -08:00
|
|
|
commit: wl.Listener(*wlr.Surface) = wl.Listener(*wlr.Surface).init(handleCommit),
|
|
|
|
new_popup: wl.Listener(*wlr.XdgPopup) = wl.Listener(*wlr.XdgPopup).init(handleNewPopup),
|
|
|
|
// zig fmt: off
|
|
|
|
request_fullscreen: wl.Listener(*wlr.XdgToplevel.event.SetFullscreen) =
|
|
|
|
wl.Listener(*wlr.XdgToplevel.event.SetFullscreen).init(handleRequestFullscreen),
|
|
|
|
request_move: wl.Listener(*wlr.XdgToplevel.event.Move) =
|
|
|
|
wl.Listener(*wlr.XdgToplevel.event.Move).init(handleRequestMove),
|
|
|
|
request_resize: wl.Listener(*wlr.XdgToplevel.event.Resize) =
|
|
|
|
wl.Listener(*wlr.XdgToplevel.event.Resize).init(handleRequestResize),
|
|
|
|
// zig fmt: on
|
|
|
|
set_title: wl.Listener(*wlr.XdgSurface) = wl.Listener(*wlr.XdgSurface).init(handleSetTitle),
|
2021-01-01 04:29:57 -08:00
|
|
|
set_app_id: wl.Listener(*wlr.XdgSurface) = wl.Listener(*wlr.XdgSurface).init(handleSetAppId),
|
2020-04-25 12:40:26 -07:00
|
|
|
|
2020-11-03 15:23:21 -08:00
|
|
|
pub fn init(self: *Self, view: *View, xdg_surface: *wlr.XdgSurface) void {
|
|
|
|
self.* = .{ .view = view, .xdg_surface = xdg_surface };
|
|
|
|
xdg_surface.data = @ptrToInt(self);
|
2020-04-25 12:40:26 -07:00
|
|
|
|
|
|
|
// Add listeners that are active over the view's entire lifetime
|
2020-11-03 15:23:21 -08:00
|
|
|
self.xdg_surface.events.destroy.add(&self.destroy);
|
|
|
|
self.xdg_surface.events.map.add(&self.map);
|
|
|
|
self.xdg_surface.events.unmap.add(&self.unmap);
|
2020-04-25 12:40:26 -07:00
|
|
|
}
|
|
|
|
|
2020-08-20 05:35:19 -07:00
|
|
|
pub fn deinit(self: *Self) void {
|
2020-11-03 15:23:21 -08:00
|
|
|
if (self.view.surface != null) {
|
2020-08-20 05:35:19 -07:00
|
|
|
// Remove listeners that are active for the entire lifetime of the view
|
2020-11-03 15:23:21 -08:00
|
|
|
self.destroy.link.remove();
|
|
|
|
self.map.link.remove();
|
|
|
|
self.unmap.link.remove();
|
2020-08-20 05:35:19 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-06-09 10:13:28 -07:00
|
|
|
/// Returns true if a configure must be sent to ensure the dimensions of the
|
|
|
|
/// pending_box are applied.
|
|
|
|
pub fn needsConfigure(self: Self) bool {
|
2020-11-03 15:23:21 -08:00
|
|
|
const server_pending = &self.xdg_surface.role_data.toplevel.server_pending;
|
2020-08-03 06:00:04 -07:00
|
|
|
const state = &self.view.pending;
|
2020-06-09 10:13:28 -07:00
|
|
|
|
|
|
|
// Checking server_pending is sufficient here since it will be either in
|
|
|
|
// sync with the current dimensions or be the dimensions sent with the
|
|
|
|
// most recent configure. In both cases server_pending has the values we
|
|
|
|
// want to check against.
|
2020-08-03 06:00:04 -07:00
|
|
|
return (state.focus != 0) != server_pending.activated or
|
|
|
|
state.box.width != server_pending.width or
|
|
|
|
state.box.height != server_pending.height;
|
2020-06-09 10:13:28 -07:00
|
|
|
}
|
|
|
|
|
2020-08-03 06:00:04 -07:00
|
|
|
/// Send a configure event, applying the pending state of the view.
|
|
|
|
pub fn configure(self: Self) void {
|
2020-11-03 15:23:21 -08:00
|
|
|
const toplevel = self.xdg_surface.role_data.toplevel;
|
2020-08-03 06:00:04 -07:00
|
|
|
const state = &self.view.pending;
|
2020-11-03 15:23:21 -08:00
|
|
|
_ = toplevel.setActivated(state.focus != 0);
|
|
|
|
_ = toplevel.setFullscreen(state.fullscreen);
|
|
|
|
self.view.pending_serial = toplevel.setSize(state.box.width, state.box.height);
|
2020-04-25 12:40:26 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/// Close the view. This will lead to the unmap and destroy events being sent
|
|
|
|
pub fn close(self: Self) void {
|
2020-11-03 15:23:21 -08:00
|
|
|
self.xdg_surface.role_data.toplevel.sendClose();
|
2020-04-25 12:40:26 -07:00
|
|
|
}
|
|
|
|
|
2020-11-03 15:23:21 -08:00
|
|
|
pub inline fn forEachSurface(
|
2020-04-25 12:40:26 -07:00
|
|
|
self: Self,
|
2020-11-03 15:23:21 -08:00
|
|
|
comptime T: type,
|
|
|
|
iterator: fn (surface: *wlr.Surface, sx: c_int, sy: c_int, data: T) callconv(.C) void,
|
|
|
|
user_data: T,
|
2020-04-25 12:40:26 -07:00
|
|
|
) void {
|
2020-11-03 15:23:21 -08:00
|
|
|
self.xdg_surface.forEachSurface(T, iterator, user_data);
|
2020-04-25 12:40:26 -07:00
|
|
|
}
|
2020-04-27 07:25:49 -07:00
|
|
|
|
2020-05-08 05:51:10 -07:00
|
|
|
/// Return the surface at output coordinates ox, oy and set sx, sy to the
|
|
|
|
/// corresponding surface-relative coordinates, if there is a surface.
|
2020-11-03 15:23:21 -08:00
|
|
|
pub fn surfaceAt(self: Self, ox: f64, oy: f64, sx: *f64, sy: *f64) ?*wlr.Surface {
|
2020-06-13 05:42:31 -07:00
|
|
|
const view = self.view;
|
2020-11-03 15:23:21 -08:00
|
|
|
return self.xdg_surface.surfaceAt(
|
2020-06-27 13:43:15 -07:00
|
|
|
ox - @intToFloat(f64, view.current.box.x - view.surface_box.x),
|
|
|
|
oy - @intToFloat(f64, view.current.box.y - view.surface_box.y),
|
2020-05-08 05:51:10 -07:00
|
|
|
sx,
|
|
|
|
sy,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2020-12-23 16:59:30 -08:00
|
|
|
/// Return the current title of the toplevel if any.
|
|
|
|
pub fn getTitle(self: Self) ?[*:0]const u8 {
|
|
|
|
return self.xdg_surface.role_data.toplevel.title;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Return the current app_id of the toplevel if any .
|
|
|
|
pub fn getAppId(self: Self) ?[*:0]const u8 {
|
|
|
|
return self.xdg_surface.role_data.toplevel.app_id;
|
2020-06-04 07:56:58 -07:00
|
|
|
}
|
|
|
|
|
2020-07-29 07:36:46 -07:00
|
|
|
/// Return bounds on the dimensions of the toplevel.
|
|
|
|
pub fn getConstraints(self: Self) View.Constraints {
|
2020-11-03 15:23:21 -08:00
|
|
|
const state = &self.xdg_surface.role_data.toplevel.current;
|
2020-07-29 07:36:46 -07:00
|
|
|
return .{
|
2020-08-10 12:26:48 -07:00
|
|
|
.min_width = std.math.max(state.min_width, View.min_size),
|
2020-07-29 07:36:46 -07:00
|
|
|
.max_width = if (state.max_width > 0) state.max_width else std.math.maxInt(u32),
|
2020-08-10 12:26:48 -07:00
|
|
|
.min_height = std.math.max(state.min_height, View.min_size),
|
2020-07-29 07:36:46 -07:00
|
|
|
.max_height = if (state.max_height > 0) state.max_height else std.math.maxInt(u32),
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2020-04-25 12:40:26 -07:00
|
|
|
/// Called when the xdg surface is destroyed
|
2020-11-03 15:23:21 -08:00
|
|
|
fn handleDestroy(listener: *wl.Listener(*wlr.XdgSurface), xdg_surface: *wlr.XdgSurface) void {
|
|
|
|
const self = @fieldParentPtr(Self, "destroy", listener);
|
2020-08-20 05:35:19 -07:00
|
|
|
self.deinit();
|
2020-11-03 15:23:21 -08:00
|
|
|
self.view.surface = null;
|
2020-04-25 12:40:26 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/// Called when the xdg surface is mapped, or ready to display on-screen.
|
2020-11-03 15:23:21 -08:00
|
|
|
fn handleMap(listener: *wl.Listener(*wlr.XdgSurface), xdg_surface: *wlr.XdgSurface) void {
|
|
|
|
const self = @fieldParentPtr(Self, "map", listener);
|
2020-04-25 12:40:26 -07:00
|
|
|
const view = self.view;
|
|
|
|
const root = view.output.root;
|
2020-11-03 15:23:21 -08:00
|
|
|
const toplevel = self.xdg_surface.role_data.toplevel;
|
2020-04-25 12:40:26 -07:00
|
|
|
|
|
|
|
// Add listeners that are only active while mapped
|
2020-11-03 15:23:21 -08:00
|
|
|
self.xdg_surface.surface.events.commit.add(&self.commit);
|
|
|
|
self.xdg_surface.events.new_popup.add(&self.new_popup);
|
|
|
|
toplevel.events.request_fullscreen.add(&self.request_fullscreen);
|
|
|
|
toplevel.events.request_move.add(&self.request_move);
|
|
|
|
toplevel.events.request_resize.add(&self.request_resize);
|
|
|
|
toplevel.events.set_title.add(&self.set_title);
|
2021-01-01 04:29:57 -08:00
|
|
|
toplevel.events.set_app_id.add(&self.set_app_id);
|
2020-10-25 06:54:31 -07:00
|
|
|
|
2020-11-03 15:23:21 -08:00
|
|
|
view.surface = self.xdg_surface.surface;
|
2020-04-25 12:40:26 -07:00
|
|
|
|
2020-06-29 02:15:55 -07:00
|
|
|
// Use the view's "natural" size centered on the output as the default
|
|
|
|
// floating dimensions
|
2020-11-03 15:23:21 -08:00
|
|
|
view.float_box.width = @intCast(u32, self.xdg_surface.geometry.width);
|
|
|
|
view.float_box.height = @intCast(u32, self.xdg_surface.geometry.height);
|
2020-06-29 02:15:55 -07:00
|
|
|
view.float_box.x = std.math.max(0, @divTrunc(@intCast(i32, view.output.usable_box.width) -
|
|
|
|
@intCast(i32, view.float_box.width), 2));
|
|
|
|
view.float_box.y = std.math.max(0, @divTrunc(@intCast(i32, view.output.usable_box.height) -
|
|
|
|
@intCast(i32, view.float_box.height), 2));
|
2020-04-25 12:40:26 -07:00
|
|
|
|
2020-11-03 15:23:21 -08:00
|
|
|
const state = &toplevel.current;
|
2020-06-27 14:48:04 -07:00
|
|
|
const has_fixed_size = state.min_width != 0 and state.min_height != 0 and
|
|
|
|
(state.min_width == state.max_width or state.min_height == state.max_height);
|
2020-11-03 15:23:21 -08:00
|
|
|
const app_id: [*:0]const u8 = if (toplevel.app_id) |id| id else "NULL";
|
2020-04-27 07:25:49 -07:00
|
|
|
|
2020-11-03 15:23:21 -08:00
|
|
|
if (toplevel.parent != null or has_fixed_size) {
|
2020-06-27 14:48:04 -07:00
|
|
|
// If the toplevel has a parent or has a fixed size make it float
|
2020-10-22 10:22:54 -07:00
|
|
|
view.current.float = true;
|
2020-06-28 11:30:12 -07:00
|
|
|
view.pending.float = true;
|
2020-06-29 02:15:55 -07:00
|
|
|
view.pending.box = view.float_box;
|
2020-06-27 14:48:04 -07:00
|
|
|
} else {
|
2020-04-27 07:25:49 -07:00
|
|
|
// Make views with app_ids listed in the float filter float
|
2020-06-27 14:48:04 -07:00
|
|
|
for (root.server.config.float_filter.items) |filter_app_id| {
|
|
|
|
if (std.mem.eql(u8, std.mem.span(app_id), std.mem.span(filter_app_id))) {
|
2020-08-11 10:04:37 -07:00
|
|
|
view.current.float = true;
|
2020-06-28 11:30:12 -07:00
|
|
|
view.pending.float = true;
|
2020-06-29 02:15:55 -07:00
|
|
|
view.pending.box = view.float_box;
|
2020-06-27 14:48:04 -07:00
|
|
|
break;
|
|
|
|
}
|
2020-04-25 12:40:26 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-07-16 10:48:13 -07:00
|
|
|
// 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)) {
|
2020-07-15 16:21:22 -07:00
|
|
|
view.draw_borders = false;
|
2020-07-16 10:48:13 -07:00
|
|
|
break;
|
2020-07-15 16:21:22 -07:00
|
|
|
}
|
2020-07-16 10:48:13 -07:00
|
|
|
} else {
|
2020-11-03 15:23:21 -08:00
|
|
|
_ = toplevel.setTiled(.{ .top = true, .bottom = true, .left = true, .right = true });
|
2020-07-15 16:21:22 -07:00
|
|
|
}
|
2020-06-13 05:42:31 -07:00
|
|
|
|
2020-05-08 05:51:10 -07:00
|
|
|
view.map();
|
2020-04-25 12:40:26 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/// Called when the surface is unmapped and will no longer be displayed.
|
2020-11-03 15:23:21 -08:00
|
|
|
fn handleUnmap(listener: *wl.Listener(*wlr.XdgSurface), xdg_surface: *wlr.XdgSurface) void {
|
|
|
|
const self = @fieldParentPtr(Self, "unmap", listener);
|
2020-04-25 12:40:26 -07:00
|
|
|
const root = self.view.output.root;
|
|
|
|
|
2020-05-08 05:51:10 -07:00
|
|
|
self.view.unmap();
|
2020-04-25 12:40:26 -07:00
|
|
|
|
|
|
|
// Remove listeners that are only active while mapped
|
2020-11-03 15:23:21 -08:00
|
|
|
self.commit.link.remove();
|
|
|
|
self.new_popup.link.remove();
|
|
|
|
self.request_fullscreen.link.remove();
|
|
|
|
self.request_move.link.remove();
|
|
|
|
self.request_resize.link.remove();
|
|
|
|
self.set_title.link.remove();
|
2020-04-25 12:40:26 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/// Called when the surface is comitted
|
2020-11-03 15:23:21 -08:00
|
|
|
fn handleCommit(listener: *wl.Listener(*wlr.Surface), surface: *wlr.Surface) void {
|
|
|
|
const self = @fieldParentPtr(Self, "commit", listener);
|
2020-04-25 12:40:26 -07:00
|
|
|
const view = self.view;
|
|
|
|
|
2020-11-03 15:23:21 -08:00
|
|
|
var wlr_box: wlr.Box = undefined;
|
|
|
|
self.xdg_surface.getGeometry(&wlr_box);
|
2020-06-13 05:42:31 -07:00
|
|
|
const new_box = Box.fromWlrBox(wlr_box);
|
|
|
|
|
|
|
|
// If we have sent a configure changing the size
|
2020-04-25 12:40:26 -07:00
|
|
|
if (view.pending_serial) |s| {
|
2020-06-13 05:42:31 -07:00
|
|
|
// Update the stored dimensions of the surface
|
|
|
|
view.surface_box = new_box;
|
|
|
|
|
2020-11-03 15:23:21 -08:00
|
|
|
if (s == self.xdg_surface.configure_serial) {
|
2020-10-22 10:22:54 -07:00
|
|
|
view.notifyConfiguredOrApplyPending();
|
2020-06-09 10:13:28 -07:00
|
|
|
} else {
|
2020-06-13 05:42:31 -07:00
|
|
|
// If the client has not yet acked our configure, we need to send a
|
|
|
|
// frame done event so that it commits another buffer. These
|
2020-06-09 10:13:28 -07:00
|
|
|
// buffers won't be rendered since we are still rendering our
|
|
|
|
// stashed buffer from when the transaction started.
|
|
|
|
view.sendFrameDone();
|
2020-04-25 12:40:26 -07:00
|
|
|
}
|
2020-06-13 05:42:31 -07:00
|
|
|
} else {
|
|
|
|
// TODO: handle unexpected change in dimensions
|
|
|
|
if (!std.meta.eql(view.surface_box, new_box))
|
2020-06-16 16:25:11 -07:00
|
|
|
log.err(.xdg_shell, "view changed size unexpectedly", .{});
|
2020-06-13 05:42:31 -07:00
|
|
|
view.surface_box = new_box;
|
2020-04-25 12:40:26 -07:00
|
|
|
}
|
|
|
|
}
|
2020-04-27 06:19:16 -07:00
|
|
|
|
|
|
|
/// Called when a new xdg popup is requested by the client
|
2020-11-03 15:23:21 -08:00
|
|
|
fn handleNewPopup(listener: *wl.Listener(*wlr.XdgPopup), wlr_xdg_popup: *wlr.XdgPopup) void {
|
|
|
|
const self = @fieldParentPtr(Self, "new_popup", listener);
|
2020-04-27 06:19:16 -07:00
|
|
|
|
|
|
|
// This will free itself on destroy
|
2020-11-03 15:23:21 -08:00
|
|
|
const xdg_popup = util.gpa.create(XdgPopup) catch {
|
|
|
|
wlr_xdg_popup.resource.postNoMemory();
|
2020-07-05 13:49:17 -07:00
|
|
|
return;
|
|
|
|
};
|
2020-06-27 13:43:15 -07:00
|
|
|
xdg_popup.init(self.view.output, &self.view.current.box, wlr_xdg_popup);
|
2020-04-27 06:19:16 -07:00
|
|
|
}
|
2020-06-29 02:52:53 -07:00
|
|
|
|
|
|
|
/// Called when the client asks to be fullscreened. We always honor the request
|
|
|
|
/// for now, perhaps it should be denied in some cases in the future.
|
2020-11-03 15:23:21 -08:00
|
|
|
fn handleRequestFullscreen(
|
|
|
|
listener: *wl.Listener(*wlr.XdgToplevel.event.SetFullscreen),
|
|
|
|
event: *wlr.XdgToplevel.event.SetFullscreen,
|
|
|
|
) void {
|
|
|
|
const self = @fieldParentPtr(Self, "request_fullscreen", listener);
|
2020-08-11 10:04:37 -07:00
|
|
|
self.view.pending.fullscreen = event.fullscreen;
|
|
|
|
self.view.applyPending();
|
2020-06-29 02:52:53 -07:00
|
|
|
}
|
2020-10-17 07:45:18 -07:00
|
|
|
|
|
|
|
/// Called when the client asks to be moved via the cursor, for example when the
|
|
|
|
/// user drags CSD titlebars.
|
2020-11-03 15:23:21 -08:00
|
|
|
fn handleRequestMove(
|
|
|
|
listener: *wl.Listener(*wlr.XdgToplevel.event.Move),
|
|
|
|
event: *wlr.XdgToplevel.event.Move,
|
|
|
|
) void {
|
|
|
|
const self = @fieldParentPtr(Self, "request_move", listener);
|
|
|
|
const seat = @intToPtr(*Seat, event.seat.seat.data);
|
2020-10-17 13:40:15 -07:00
|
|
|
seat.cursor.enterMode(.move, self.view);
|
2020-10-17 07:45:18 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/// Called when the client asks to be resized via the cursor.
|
2020-11-03 15:23:21 -08:00
|
|
|
fn handleRequestResize(listener: *wl.Listener(*wlr.XdgToplevel.event.Resize), event: *wlr.XdgToplevel.event.Resize) void {
|
|
|
|
const self = @fieldParentPtr(Self, "request_resize", listener);
|
|
|
|
const seat = @intToPtr(*Seat, event.seat.seat.data);
|
2020-10-17 13:40:15 -07:00
|
|
|
seat.cursor.enterMode(.resize, self.view);
|
2020-10-17 07:45:18 -07:00
|
|
|
}
|
2020-10-25 06:54:31 -07:00
|
|
|
|
|
|
|
/// Called when the client sets / updates its title
|
2020-11-03 15:23:21 -08:00
|
|
|
fn handleSetTitle(listener: *wl.Listener(*wlr.XdgSurface), xdg_surface: *wlr.XdgSurface) void {
|
|
|
|
const self = @fieldParentPtr(Self, "set_title", listener);
|
2021-01-01 04:29:57 -08:00
|
|
|
self.view.notifyTitle();
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Called when the client sets / updates its app_id
|
|
|
|
fn handleSetAppId(listener: *wl.Listener(*wlr.XdgSurface), xdg_surface: *wlr.XdgSurface) void {
|
|
|
|
const self = @fieldParentPtr(Self, "set_app_id", listener);
|
|
|
|
self.view.notifyAppId();
|
2020-10-25 06:54:31 -07:00
|
|
|
}
|