dont put popups in views list
use compositor::{Server, Shell, View};
use wlroots::{CompositorHandle, XdgV6ShellHandler, XdgV6ShellManagerHandler,
- XdgV6ShellSurfaceHandle};
+ XdgV6ShellSurfaceHandle, XdgV6ShellState::*};
#[derive(Debug, Default, Clone, PartialEq, Eq)]
pub struct XdgV6 {
@@ -20,13 +20,24 @@ pub struct XdgV6ShellManager;
impl XdgV6ShellManagerHandler for XdgV6ShellManager {
fn new_surface(&mut self,
compositor: CompositorHandle,
- shell_surface: XdgV6ShellSurfaceHandle)
+ mut shell_surface: XdgV6ShellSurfaceHandle)
-> Option<Box<XdgV6ShellHandler>> {
+
+ let is_toplevel = with_handles!([(shell_surface: {&mut shell_surface})] => {
+ match shell_surface.state().unwrap() {
+ TopLevel(_) => true,
+ _ => false
+ }
+ }).unwrap();
+
+ if is_toplevel {
with_handles!([(compositor: {compositor})] => {
let server: &mut Server = compositor.into();
server.views
.push(View::new(Shell::XdgV6(shell_surface.into())));
}).unwrap();
+ }
+
Some(Box::new(XdgV6::new()))
}
