wayland: Implement xdg-activation when opening urls (#11368)

Since Wayland doesn't have a way for windows to activate themselves,
currently, when you click on a link in Zed, the browser window opens in
the background.

This PR implements the `xdg-activation` protocol to get an activation
token, which the browser can use to raise its window.


https://github.com/zed-industries/zed/assets/71973804/8b3456c0-89f8-4201-b1cb-633a149796b7

Release Notes:

- N/A
This commit is contained in:
apricotbucket28
2024-05-03 14:02:39 -07:00
committed by GitHub
parent dccf6dae01
commit 86696d88cf
5 changed files with 79 additions and 5 deletions
+8 -1
View File
@@ -29,7 +29,10 @@ use crate::{
Size, TouchPhase, WindowParams, X11Window,
};
use super::{super::SCROLL_LINES, X11Display, X11WindowStatePtr, XcbAtoms};
use super::{
super::{open_uri_internal, SCROLL_LINES},
X11Display, X11WindowStatePtr, XcbAtoms,
};
use super::{button_of_key, modifiers_from_state};
use crate::platform::linux::is_within_click_distance;
use crate::platform::linux::platform::DOUBLE_CLICK_INTERVAL;
@@ -672,6 +675,10 @@ impl LinuxClient for X11Client {
//todo(linux)
fn set_cursor_style(&self, _style: CursorStyle) {}
fn open_uri(&self, uri: &str) {
open_uri_internal(uri, None);
}
fn write_to_primary(&self, item: crate::ClipboardItem) {
self.0.borrow_mut().primary.set_contents(item.text);
}