shell: Don't annouce toplevels before they have contents
This commit is contained in:
parent
5a8840b12e
commit
4ed3aceefc
5 changed files with 29 additions and 14 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
|
@ -3282,7 +3282,7 @@ checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0"
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "smithay"
|
name = "smithay"
|
||||||
version = "0.3.0"
|
version = "0.3.0"
|
||||||
source = "git+https://github.com/pop-os/smithay?rev=217e0a4114#217e0a41148ad073e2b34fc8861c0532828e941f"
|
source = "git+https://github.com/pop-os/smithay?rev=406a40d6ec#406a40d6ec09723d8f1c73f3b7c9d62494cdbd13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"appendlist",
|
"appendlist",
|
||||||
"bitflags",
|
"bitflags",
|
||||||
|
|
|
||||||
|
|
@ -70,4 +70,4 @@ debug = true
|
||||||
lto = "fat"
|
lto = "fat"
|
||||||
|
|
||||||
[patch."https://github.com/Smithay/smithay.git"]
|
[patch."https://github.com/Smithay/smithay.git"]
|
||||||
smithay = { git = "https://github.com/pop-os/smithay", rev = "217e0a4114" }
|
smithay = { git = "https://github.com/pop-os/smithay", rev = "406a40d6ec" }
|
||||||
|
|
|
||||||
|
|
@ -1059,6 +1059,7 @@ impl Shell {
|
||||||
let (window, seat) = state.common.shell.pending_windows.remove(pos);
|
let (window, seat) = state.common.shell.pending_windows.remove(pos);
|
||||||
|
|
||||||
let workspace = state.common.shell.workspaces.active_mut(output);
|
let workspace = state.common.shell.workspaces.active_mut(output);
|
||||||
|
state.common.shell.toplevel_info_state.new_toplevel(&window);
|
||||||
state
|
state
|
||||||
.common
|
.common
|
||||||
.shell
|
.shell
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,6 @@ impl XdgShellHandler for State {
|
||||||
fn new_toplevel(&mut self, surface: ToplevelSurface) {
|
fn new_toplevel(&mut self, surface: ToplevelSurface) {
|
||||||
let seat = self.common.last_active_seat().clone();
|
let seat = self.common.last_active_seat().clone();
|
||||||
let window = CosmicSurface::Wayland(Window::new(surface));
|
let window = CosmicSurface::Wayland(Window::new(surface));
|
||||||
self.common.shell.toplevel_info_state.new_toplevel(&window);
|
|
||||||
self.common.shell.pending_windows.push((window, seat));
|
self.common.shell.pending_windows.push((window, seat));
|
||||||
// We will position the window after the first commit, when we know its size hints
|
// We will position the window after the first commit, when we know its size hints
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -94,6 +94,7 @@ impl State {
|
||||||
self.common.event_loop_handle.clone(),
|
self.common.event_loop_handle.clone(),
|
||||||
None,
|
None,
|
||||||
std::iter::empty::<(OsString, OsString)>(),
|
std::iter::empty::<(OsString, OsString)>(),
|
||||||
|
//vec![("WAYLAND_DEBUG", "client")].into_iter(),
|
||||||
|map| {
|
|map| {
|
||||||
if let Some(node) = drm_node {
|
if let Some(node) = drm_node {
|
||||||
map.insert_if_missing(|| node);
|
map.insert_if_missing(|| node);
|
||||||
|
|
@ -141,31 +142,45 @@ impl XwmHandler for Data {
|
||||||
err
|
err
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let surface = CosmicSurface::X11(window.clone());
|
||||||
if self
|
if self
|
||||||
.state
|
.state
|
||||||
.common
|
.common
|
||||||
.shell
|
.shell
|
||||||
.element_for_surface(&CosmicSurface::X11(window.clone()))
|
.element_for_surface(&surface)
|
||||||
.is_some()
|
.is_some()
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let window = CosmicSurface::X11(window);
|
|
||||||
self.state
|
|
||||||
.common
|
|
||||||
.shell
|
|
||||||
.toplevel_info_state
|
|
||||||
.new_toplevel(&window);
|
|
||||||
|
|
||||||
let seat = self.state.common.last_active_seat().clone();
|
let seat = self.state.common.last_active_seat().clone();
|
||||||
let output = seat.active_output();
|
|
||||||
self.state
|
self.state
|
||||||
.common
|
.common
|
||||||
.shell
|
.shell
|
||||||
.pending_windows
|
.pending_windows
|
||||||
.push((window.clone(), seat));
|
.push((surface, seat));
|
||||||
Shell::map_window(&mut self.state, &window, &output);
|
}
|
||||||
|
|
||||||
|
fn map_window_notify(&mut self, _xwm: XwmId, surface: X11Surface) {
|
||||||
|
if let Some((window, seat)) = self
|
||||||
|
.state
|
||||||
|
.common
|
||||||
|
.shell
|
||||||
|
.pending_windows
|
||||||
|
.iter()
|
||||||
|
.find(|(window, _)| {
|
||||||
|
if let CosmicSurface::X11(window) = window {
|
||||||
|
window == &surface
|
||||||
|
} else {
|
||||||
|
false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.cloned()
|
||||||
|
{
|
||||||
|
let output = seat.active_output();
|
||||||
|
Shell::map_window(&mut self.state, &window, &output);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn mapped_override_redirect_window(&mut self, _xwm: XwmId, window: X11Surface) {
|
fn mapped_override_redirect_window(&mut self, _xwm: XwmId, window: X11Surface) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue