Enable context menu popups in dialog, close context menu when location changes

This commit is contained in:
Jeremy Soller 2025-07-24 11:34:41 -06:00
parent e1bc0abaab
commit a6e369df0f
No known key found for this signature in database
GPG key ID: 670FDFB5428E05CA
3 changed files with 84 additions and 13 deletions

View file

@ -3879,18 +3879,6 @@ impl Tab {
));
}
//TODO: check for wayland
if self.context_menu != last_context_menu {
if last_context_menu.is_some() {
commands.push(Command::ContextMenu(None));
}
if let Some(point) = self.context_menu {
commands.push(Command::ContextMenu(Some(
point + self.offset_opt.unwrap_or_default(),
)));
}
}
// Change directory if requested
if let Some(mut location) = cd {
if matches!(self.mode, Mode::Desktop) {
@ -3935,6 +3923,18 @@ impl Tab {
}
}
// Update context menu popup
if self.context_menu != last_context_menu {
if last_context_menu.is_some() {
commands.push(Command::ContextMenu(None));
}
if let Some(point) = self.context_menu {
commands.push(Command::ContextMenu(Some(
point + self.offset_opt.unwrap_or_default(),
)));
}
}
commands
}