shell: Unify element_for_(x11_|wl_)surface
This commit is contained in:
parent
dbe2a073ef
commit
6858238bd6
13 changed files with 56 additions and 105 deletions
|
|
@ -76,7 +76,7 @@ impl XdgShellHandler for State {
|
|||
let kind = PopupKind::Xdg(surface);
|
||||
if let Some(root) = find_popup_root_surface(&kind)
|
||||
.ok()
|
||||
.and_then(|root| self.common.shell.element_for_wl_surface(&root))
|
||||
.and_then(|root| self.common.shell.element_for_surface(&root))
|
||||
{
|
||||
let target = root.clone().into();
|
||||
let ret = self
|
||||
|
|
@ -169,7 +169,7 @@ impl XdgShellHandler for State {
|
|||
if let Some(mapped) = self
|
||||
.common
|
||||
.shell
|
||||
.element_for_wl_surface(surface.wl_surface())
|
||||
.element_for_surface(surface.wl_surface())
|
||||
.cloned()
|
||||
{
|
||||
if !mapped.is_stack()
|
||||
|
|
@ -184,7 +184,7 @@ impl XdgShellHandler for State {
|
|||
if let Some(mapped) = self
|
||||
.common
|
||||
.shell
|
||||
.element_for_wl_surface(surface.wl_surface())
|
||||
.element_for_surface(surface.wl_surface())
|
||||
.cloned()
|
||||
{
|
||||
let seat = self.common.last_active_seat().clone();
|
||||
|
|
@ -196,7 +196,7 @@ impl XdgShellHandler for State {
|
|||
if let Some(mapped) = self
|
||||
.common
|
||||
.shell
|
||||
.element_for_wl_surface(surface.wl_surface())
|
||||
.element_for_surface(surface.wl_surface())
|
||||
.cloned()
|
||||
{
|
||||
self.common.shell.unmaximize_request(&mapped);
|
||||
|
|
@ -214,7 +214,7 @@ impl XdgShellHandler for State {
|
|||
if let Some(mapped) = self
|
||||
.common
|
||||
.shell
|
||||
.element_for_wl_surface(surface.wl_surface())
|
||||
.element_for_surface(surface.wl_surface())
|
||||
.cloned()
|
||||
{
|
||||
let from = self
|
||||
|
|
@ -351,7 +351,7 @@ impl XdgShellHandler for State {
|
|||
if let Some(mapped) = self
|
||||
.common
|
||||
.shell
|
||||
.element_for_wl_surface(surface.wl_surface())
|
||||
.element_for_surface(surface.wl_surface())
|
||||
.cloned()
|
||||
{
|
||||
if let Some(workspace) = self.common.shell.space_for_mut(&mapped) {
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ use tracing::{trace, warn};
|
|||
impl Shell {
|
||||
pub fn unconstrain_popup(&self, surface: &PopupSurface) {
|
||||
if let Some(parent) = get_popup_toplevel(&surface) {
|
||||
if let Some(elem) = self.element_for_wl_surface(&parent) {
|
||||
if let Some(elem) = self.element_for_surface(&parent) {
|
||||
let (mut element_geo, output, is_tiled) =
|
||||
if let Some(workspace) = self.space_for(elem) {
|
||||
let Some(elem_geo) = workspace.element_geometry(elem) else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue