Merge pull request #434 from mahkoh/jorth/toplevel-tag
wayland: implement xdg-toplevel-tag-v1
This commit is contained in:
commit
1d017ec2c2
6 changed files with 122 additions and 0 deletions
|
|
@ -175,6 +175,7 @@ Jay supports the following wayland protocols:
|
|||
| wp_viewporter | 1 | |
|
||||
| xdg_activation_v1 | 1 | |
|
||||
| xdg_toplevel_drag_manager_v1 | 1 | |
|
||||
| xdg_toplevel_tag_manager_v1 | 1 | |
|
||||
| xdg_wm_base | 7 | |
|
||||
| xdg_wm_dialog_v1 | 1 | |
|
||||
| zwlr_data_control_manager_v1 | 2 | Yes |
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
- Floating windows can now be configured to be shown above fullscreen windows
|
||||
by using the `enable-float-above-fullscreen` action.
|
||||
- Implement xdg-toplevel-tag-v1.
|
||||
|
||||
# 1.10.0 (2025-04-22)
|
||||
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ use {
|
|||
wp_viewporter::WpViewporterGlobal,
|
||||
xdg_activation_v1::XdgActivationV1Global,
|
||||
xdg_toplevel_drag_manager_v1::XdgToplevelDragManagerV1Global,
|
||||
xdg_toplevel_tag_manager_v1::XdgToplevelTagManagerV1Global,
|
||||
xdg_wm_base::XdgWmBaseGlobal,
|
||||
xdg_wm_dialog_v1::XdgWmDialogV1Global,
|
||||
zwlr_layer_shell_v1::ZwlrLayerShellV1Global,
|
||||
|
|
@ -221,6 +222,7 @@ impl Globals {
|
|||
add_singleton!(WlFixesGlobal);
|
||||
add_singleton!(ExtWorkspaceManagerV1Global);
|
||||
add_singleton!(WpColorManagerV1Global);
|
||||
add_singleton!(XdgToplevelTagManagerV1Global);
|
||||
}
|
||||
|
||||
pub fn add_backend_singletons(&self, backend: &Rc<dyn Backend>) {
|
||||
|
|
|
|||
|
|
@ -75,6 +75,7 @@ pub mod xdg_activation_v1;
|
|||
pub mod xdg_positioner;
|
||||
pub mod xdg_toplevel_drag_manager_v1;
|
||||
pub mod xdg_toplevel_drag_v1;
|
||||
pub mod xdg_toplevel_tag_manager_v1;
|
||||
pub mod xdg_wm_base;
|
||||
pub mod xdg_wm_dialog_v1;
|
||||
pub mod zwlr_layer_shell_v1;
|
||||
|
|
|
|||
104
src/ifs/xdg_toplevel_tag_manager_v1.rs
Normal file
104
src/ifs/xdg_toplevel_tag_manager_v1.rs
Normal file
|
|
@ -0,0 +1,104 @@
|
|||
use {
|
||||
crate::{
|
||||
client::{Client, ClientError},
|
||||
globals::{Global, GlobalName},
|
||||
leaks::Tracker,
|
||||
object::{Object, Version},
|
||||
wire::{XdgToplevelTagManagerV1Id, xdg_toplevel_tag_manager_v1::*},
|
||||
},
|
||||
std::rc::Rc,
|
||||
thiserror::Error,
|
||||
};
|
||||
|
||||
pub struct XdgToplevelTagManagerV1Global {
|
||||
name: GlobalName,
|
||||
}
|
||||
|
||||
impl XdgToplevelTagManagerV1Global {
|
||||
pub fn new(name: GlobalName) -> Self {
|
||||
Self { name }
|
||||
}
|
||||
|
||||
fn bind_(
|
||||
self: Rc<Self>,
|
||||
id: XdgToplevelTagManagerV1Id,
|
||||
client: &Rc<Client>,
|
||||
version: Version,
|
||||
) -> Result<(), XdgTopleveTagManagerV1Error> {
|
||||
let obj = Rc::new(XdgToplevelTagManagerV1 {
|
||||
id,
|
||||
client: client.clone(),
|
||||
tracker: Default::default(),
|
||||
version,
|
||||
});
|
||||
track!(client, obj);
|
||||
client.add_client_obj(&obj)?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
global_base!(
|
||||
XdgToplevelTagManagerV1Global,
|
||||
XdgToplevelTagManagerV1,
|
||||
XdgTopleveTagManagerV1Error
|
||||
);
|
||||
|
||||
impl Global for XdgToplevelTagManagerV1Global {
|
||||
fn singleton(&self) -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
fn version(&self) -> u32 {
|
||||
1
|
||||
}
|
||||
}
|
||||
|
||||
simple_add_global!(XdgToplevelTagManagerV1Global);
|
||||
|
||||
pub struct XdgToplevelTagManagerV1 {
|
||||
pub id: XdgToplevelTagManagerV1Id,
|
||||
pub client: Rc<Client>,
|
||||
pub tracker: Tracker<Self>,
|
||||
pub version: Version,
|
||||
}
|
||||
|
||||
impl XdgToplevelTagManagerV1RequestHandler for XdgToplevelTagManagerV1 {
|
||||
type Error = XdgTopleveTagManagerV1Error;
|
||||
|
||||
fn destroy(&self, _req: Destroy, _slf: &Rc<Self>) -> Result<(), Self::Error> {
|
||||
self.client.remove_obj(self)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn set_toplevel_tag(
|
||||
&self,
|
||||
_req: SetToplevelTag<'_>,
|
||||
_slf: &Rc<Self>,
|
||||
) -> Result<(), Self::Error> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn set_toplevel_description(
|
||||
&self,
|
||||
_req: SetToplevelDescription<'_>,
|
||||
_slf: &Rc<Self>,
|
||||
) -> Result<(), Self::Error> {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
object_base! {
|
||||
self = XdgToplevelTagManagerV1;
|
||||
version = self.version;
|
||||
}
|
||||
|
||||
impl Object for XdgToplevelTagManagerV1 {}
|
||||
|
||||
simple_add_obj!(XdgToplevelTagManagerV1);
|
||||
|
||||
#[derive(Debug, Error)]
|
||||
pub enum XdgTopleveTagManagerV1Error {
|
||||
#[error(transparent)]
|
||||
ClientError(Box<ClientError>),
|
||||
}
|
||||
efrom!(XdgTopleveTagManagerV1Error, ClientError);
|
||||
13
wire/xdg_toplevel_tag_manager_v1.txt
Normal file
13
wire/xdg_toplevel_tag_manager_v1.txt
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
request destroy {
|
||||
|
||||
}
|
||||
|
||||
request set_toplevel_tag {
|
||||
toplevel: id(xdg_toplevel),
|
||||
tag: str,
|
||||
}
|
||||
|
||||
request set_toplevel_description {
|
||||
toplevel: id(xdg_toplevel),
|
||||
description: str,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue