mirror of
https://github.com/MezzalunaWM/Mezzaluna.git
synced 2026-03-08 04:57:32 -04:00
basic layer keyboard
This commit is contained in:
parent
814daf0f2e
commit
87368dbc66
1 changed files with 15 additions and 2 deletions
|
|
@ -70,6 +70,18 @@ pub fn deinit(self: *LayerSurface) void {
|
||||||
gpa.destroy(self);
|
gpa.destroy(self);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn allowKeyboard(self: *LayerSurface) void {
|
||||||
|
const keyboard_interactive = self.wlr_layer_surface.current.keyboard_interactive;
|
||||||
|
if(keyboard_interactive == .exclusive or keyboard_interactive == .on_demand) {
|
||||||
|
server.seat.wlr_seat.keyboardNotifyEnter(
|
||||||
|
self.wlr_layer_surface.surface,
|
||||||
|
&server.seat.wlr_seat.keyboard_state.keyboard.?.keycodes,
|
||||||
|
null
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// --------- LayerSurface event handlers ---------
|
||||||
fn handleDestroy(
|
fn handleDestroy(
|
||||||
listener: *wl.Listener(*wlr.LayerSurfaceV1),
|
listener: *wl.Listener(*wlr.LayerSurfaceV1),
|
||||||
_: *wlr.LayerSurfaceV1
|
_: *wlr.LayerSurfaceV1
|
||||||
|
|
@ -79,9 +91,10 @@ fn handleDestroy(
|
||||||
}
|
}
|
||||||
|
|
||||||
fn handleMap(
|
fn handleMap(
|
||||||
_: *wl.Listener(void)
|
listener: *wl.Listener(void)
|
||||||
) void {
|
) void {
|
||||||
std.log.debug("Unimplemented layer surface map", .{});
|
const layer: *LayerSurface = @fieldParentPtr("map", listener);
|
||||||
|
layer.allowKeyboard();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn handleUnmap(listener: *wl.Listener(void)) void {
|
fn handleUnmap(listener: *wl.Listener(void)) void {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue