fix: correct popup detection logic to handle optional has_skip_taskbar value
This commit is contained in:
parent
0e93461aa6
commit
2f57480d21
1 changed files with 6 additions and 6 deletions
|
|
@ -693,7 +693,7 @@ impl XState {
|
||||||
) -> XResult<bool> {
|
) -> XResult<bool> {
|
||||||
let mut motif_popup = false;
|
let mut motif_popup = false;
|
||||||
let mut wmhint_popup = false;
|
let mut wmhint_popup = false;
|
||||||
let mut has_skip_taskbar = false;
|
let mut has_skip_taskbar = None;
|
||||||
|
|
||||||
let attrs = self
|
let attrs = self
|
||||||
.connection
|
.connection
|
||||||
|
|
@ -711,7 +711,7 @@ impl XState {
|
||||||
);
|
);
|
||||||
|
|
||||||
if let Some(states) = window_state.resolve()? {
|
if let Some(states) = window_state.resolve()? {
|
||||||
has_skip_taskbar = states.contains(&self.atoms.skip_taskbar);
|
has_skip_taskbar = Some(states.contains(&self.atoms.skip_taskbar));
|
||||||
}
|
}
|
||||||
if let Some(hints) = motif_hints {
|
if let Some(hints) = motif_hints {
|
||||||
// If MOTIF_WM_HINTS provides no decorations for client assume its a popup
|
// If MOTIF_WM_HINTS provides no decorations for client assume its a popup
|
||||||
|
|
@ -761,9 +761,7 @@ impl XState {
|
||||||
match ty {
|
match ty {
|
||||||
x if x == self.window_atoms.normal => is_popup = override_redirect || wmhint_popup,
|
x if x == self.window_atoms.normal => is_popup = override_redirect || wmhint_popup,
|
||||||
x if x == self.window_atoms.dialog => is_popup = override_redirect,
|
x if x == self.window_atoms.dialog => is_popup = override_redirect,
|
||||||
x if x == self.window_atoms.utility => {
|
x if x == self.window_atoms.utility => is_popup = override_redirect || motif_popup,
|
||||||
is_popup = override_redirect || motif_popup;
|
|
||||||
}
|
|
||||||
x if [
|
x if [
|
||||||
self.window_atoms.menu,
|
self.window_atoms.menu,
|
||||||
self.window_atoms.popup_menu,
|
self.window_atoms.popup_menu,
|
||||||
|
|
@ -786,8 +784,10 @@ impl XState {
|
||||||
}
|
}
|
||||||
|
|
||||||
if !known_window_type {
|
if !known_window_type {
|
||||||
|
if let Some(has_skip_taskbar) = has_skip_taskbar {
|
||||||
is_popup = has_skip_taskbar;
|
is_popup = has_skip_taskbar;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Ok(is_popup)
|
Ok(is_popup)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue