mirror of
https://github.com/MezzalunaWM/Mezzaluna.git
synced 2026-03-08 04:57:32 -04:00
removed all windows decorations properly, added window closing and compositor exiting as well as view focusing
This commit is contained in:
parent
f636efdfe9
commit
976900ffa6
11 changed files with 289 additions and 117 deletions
|
|
@ -116,15 +116,15 @@ pub fn init(self: *Server) void {
|
|||
self.xdg_shell.events.new_popup.add(&self.new_xdg_popup);
|
||||
|
||||
// XdgDecorationManagerV1 events
|
||||
// self.xdg_toplevel_decoration_manager.events.new_toplevel_decoration.add(&self.new_toplevel_decoration);
|
||||
self.xdg_toplevel_decoration_manager.events.new_toplevel_decoration.add(&self.new_xdg_toplevel_decoration);
|
||||
}
|
||||
|
||||
pub fn deinit(self: *Server) void {
|
||||
pub fn deinit(self: *Server) noreturn {
|
||||
self.new_input.link.remove();
|
||||
self.new_output.link.remove();
|
||||
self.new_xdg_toplevel.link.remove();
|
||||
self.new_xdg_popup.link.remove();
|
||||
self.new_xdg_toplevel.link.remove();
|
||||
self.new_xdg_toplevel_decoration.link.remove();
|
||||
|
||||
self.seat.deinit();
|
||||
self.root.deinit();
|
||||
|
|
@ -134,6 +134,9 @@ pub fn deinit(self: *Server) void {
|
|||
|
||||
self.wl_server.destroyClients();
|
||||
self.wl_server.destroy();
|
||||
|
||||
std.log.debug("Exiting mez succesfully", .{});
|
||||
std.process.exit(0);
|
||||
}
|
||||
|
||||
// --------- Backend event handlers ---------
|
||||
|
|
@ -185,20 +188,23 @@ fn handleNewXdgToplevel(
|
|||
_: *wl.Listener(*wlr.XdgToplevel),
|
||||
xdg_toplevel: *wlr.XdgToplevel
|
||||
) void {
|
||||
std.log.debug("Request for new toplevel", .{});
|
||||
_ = View.initFromTopLevel(xdg_toplevel);
|
||||
}
|
||||
|
||||
fn handleNewXdgToplevelDecoration(
|
||||
_: *wl.Listener(*wlr.XdgToplevelDecorationV1),
|
||||
decoration: *wlr.XdgToplevelDecorationV1
|
||||
) void {
|
||||
std.log.debug("Request for decorations", .{});
|
||||
if(server.root.views.get(@intFromPtr(decoration.toplevel))) |view| {
|
||||
view.xdg_toplevel_decoration = decoration;
|
||||
}
|
||||
}
|
||||
|
||||
fn handleNewXdgPopup(
|
||||
_: *wl.Listener(*wlr.XdgPopup),
|
||||
_: *wlr.XdgPopup
|
||||
) void {
|
||||
std.log.err("Unimplemented handle new xdg popup", .{});
|
||||
}
|
||||
|
||||
fn handleNewXdgToplevelDecoration(
|
||||
_: *wl.Listener(*wlr.XdgToplevelDecorationV1),
|
||||
decoration: *wlr.XdgToplevelDecorationV1
|
||||
) void {
|
||||
// TODO: Configured with lua perhaps
|
||||
decoration.current.mode = .server_side;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue