Create seat before shell surface

This commit is contained in:
Kenny Levinsen
2019-07-31 23:59:19 +02:00
parent b87bcd8cc9
commit e426e1f884
+25 -27
View File
@@ -197,11 +197,34 @@ impl App {
let pools = DoubleMemPool::new(&shm, || {}).expect("Failed to create a memory pool !");
//
// Get our seat
//
let seat = manager
.instantiate_range(1, 6, NewProxy::implement_dummy)
.unwrap();
//
// Keyboard processing
//
let kbd_clone = cmd_queue.clone();
map_keyboard_auto_with_repeat(
&seat,
KeyRepeatKind::System,
move |event: KbEvent, _| match event {
KbEvent::Key { keysym, .. } => match keysym {
0xFF1B => kbd_clone.lock().unwrap().push_back(Cmd::Exit),
_ => (),
},
_ => (),
},
|_, _| {},
)
.expect("Failed to map keyboard");
//
// Prepare shell so that we can create our shell surface
//
// shells
let shell = if let Ok(layer) = manager.instantiate_exact(
1,
|layer: NewProxy<zwlr_layer_shell_v1::ZwlrLayerShellV1>| {
@@ -250,31 +273,6 @@ impl App {
surface.commit();
event_queue.sync_roundtrip().unwrap();
//
// Get our seat
//
let seat = manager
.instantiate_range(1, 6, NewProxy::implement_dummy)
.unwrap();
//
// Keyboard processing
//
let kbd_clone = cmd_queue.clone();
map_keyboard_auto_with_repeat(
&seat,
KeyRepeatKind::System,
move |event: KbEvent, _| match event {
KbEvent::Key { keysym, .. } => match keysym {
0xFF1B => kbd_clone.lock().unwrap().push_back(Cmd::Exit),
_ => (),
},
_ => (),
},
|_, _| {},
)
.expect("Failed to map keyboard");
//
// Cursor processing
//