shell: better tiling check for popup constraining
This commit is contained in:
parent
05fadbbc85
commit
386501f980
2 changed files with 20 additions and 2 deletions
|
|
@ -393,8 +393,26 @@ impl Workspace {
|
||||||
.chain(self.tiling_layer.windows().map(|(_, w, _)| w))
|
.chain(self.tiling_layer.windows().map(|(_, w, _)| w))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn is_fullscreen(&self, mapped: &CosmicMapped) -> bool {
|
||||||
|
self.fullscreen
|
||||||
|
.values()
|
||||||
|
.any(|s| s == &mapped.active_window())
|
||||||
|
}
|
||||||
|
|
||||||
pub fn is_floating(&self, mapped: &CosmicMapped) -> bool {
|
pub fn is_floating(&self, mapped: &CosmicMapped) -> bool {
|
||||||
self.floating_layer.mapped().any(|m| m == mapped)
|
!self
|
||||||
|
.fullscreen
|
||||||
|
.values()
|
||||||
|
.any(|s| s == &mapped.active_window())
|
||||||
|
&& self.floating_layer.mapped().any(|m| m == mapped)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn is_tiled(&self, mapped: &CosmicMapped) -> bool {
|
||||||
|
!self
|
||||||
|
.fullscreen
|
||||||
|
.values()
|
||||||
|
.any(|s| s == &mapped.active_window())
|
||||||
|
&& self.tiling_layer.mapped().any(|(_, m, _)| m == mapped)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn render_output<'a, R>(
|
pub fn render_output<'a, R>(
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ impl Shell {
|
||||||
let window_geo_offset = window.geometry().loc;
|
let window_geo_offset = window.geometry().loc;
|
||||||
let window_loc = element_geo.loc + offset + window_geo_offset;
|
let window_loc = element_geo.loc + offset + window_geo_offset;
|
||||||
let anchor_point = get_anchor_point(&positioner) + window_loc;
|
let anchor_point = get_anchor_point(&positioner) + window_loc;
|
||||||
if elem.is_tiled().unwrap() {
|
if workspace.is_tiled(elem) {
|
||||||
if !unconstrain_xdg_popup_tile(surface, element_geo) {
|
if !unconstrain_xdg_popup_tile(surface, element_geo) {
|
||||||
if let Some(output) = workspace.output_under(anchor_point) {
|
if let Some(output) = workspace.output_under(anchor_point) {
|
||||||
unconstrain_xdg_popup(surface, window_loc, output.geometry());
|
unconstrain_xdg_popup(surface, window_loc, output.geometry());
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue