-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
servoshell: Right-click menu #39291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
servoshell: Right-click menu #39291
Conversation
|
Heads up! This PR modifies the following files:
|
Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
fa0cef1 to
57e4c7b
Compare
| fn show_native_context_menu( | ||
| &self, | ||
| _webview: WebView, | ||
| result_sender: GenericSender<ContextMenuResult>, | ||
| _: Option<String>, | ||
| _: Vec<String>, | ||
| _options: NativeContextMenu, | ||
| ) { | ||
| let _ = result_sender.send(ContextMenuResult::Ignored); | ||
| } | ||
|
|
||
| fn show_custom_context_menu( | ||
| &self, | ||
| _webview: WebView, | ||
| result_sender: GenericSender<ContextMenuResult>, | ||
| _items: Vec<ContextMenuItem>, | ||
| ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the difference between a native and custom context menu?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Native menu is the one the browser will display by default, with actions that can only be handled by the browser itself. Custom context menus are created by the script thread.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On second thought, I'm considering removing that functionality.
| ), | ||
| /// Show a context menu to the user | ||
| ShowContextMenu( | ||
| ShowCustomContextMenu( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be unused?
| libservo = { path = "../../components/servo", features = ["background_hang_monitor", "bluetooth", "testbinding"] } | ||
| log = { workspace = true } | ||
| mime_guess = { workspace = true } | ||
| muda = "0.17.1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer not to add another dependency, especially one that adds dependencies on platform-specific toolkits. Please implement these menus as egui context menus.
|
This change has been superseded by recent work improving the Servo context menu APIs. |
Adds a righclick menu on desktop servoshell. At the moment, the rightclick menu displays completely disabled options when clicking on a link. Additionally custom rightclick menus aren't supported (I still need to clean up the API a bit).
Supports: windows and MacOS.
Testing: Manual
Fixes: Partially #38062