Skip to content
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

protocols: add gtk-shell1 #595

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions wayland-protocols-misc/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

## Unreleased

## 0.2.0 -- 04/01/2023
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, sorry if that was unclear, don't add a new header, I do that when doing the release. :)


#### Additions

- Introduce protocol `gtk-shell1`.


## 0.1.0 -- 27/12/2022

## 0.1.0-beta.5
Expand Down
2 changes: 1 addition & 1 deletion wayland-protocols-misc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "wayland-protocols-misc"
version = "0.1.0"
version = "0.2.0"
documentation = "https://docs.rs/wayland-protocols-misc/"
repository = "https://github.com/smithay/wayland-rs"
authors = ["Elinor Berger <[email protected]>"]
Expand Down
108 changes: 108 additions & 0 deletions wayland-protocols-misc/protocols/gtk-shell.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
<?xml version="1.0" encoding="UTF-8"?>
<protocol name="gtk_shell">

<interface name="gtk_shell1" version="5">
<description summary="gtk specific extensions">
gtk_shell is a protocol extension providing additional features for
clients implementing it.
</description>

<enum name="capability">
<entry name="global_app_menu" value="1"/>
<entry name="global_menu_bar" value="2"/>
<entry name="desktop_icons" value="3"/>
</enum>

<event name="capabilities">
<arg name="capabilities" type="uint"/>
</event>

<request name="get_gtk_surface">
<arg name="gtk_surface" type="new_id" interface="gtk_surface1"/>
<arg name="surface" type="object" interface="wl_surface"/>
</request>

<request name="set_startup_id">
<arg name="startup_id" type="string" allow-null="true"/>
</request>

<request name="system_bell">
<arg name="surface" type="object" interface="gtk_surface1" allow-null="true"/>
</request>

<!-- Version 3 additions -->
<request name="notify_launch" since="3">
<arg name="startup_id" type="string"/>
</request>
</interface>

<interface name="gtk_surface1" version="5">
<request name="set_dbus_properties">
<arg name="application_id" type="string" allow-null="true"/>
<arg name="app_menu_path" type="string" allow-null="true"/>
<arg name="menubar_path" type="string" allow-null="true"/>
<arg name="window_object_path" type="string" allow-null="true"/>
<arg name="application_object_path" type="string" allow-null="true"/>
<arg name="unique_bus_name" type="string" allow-null="true"/>
</request>

<request name="set_modal"/>
<request name="unset_modal"/>

<request name="present">
<arg name="time" type="uint"/>
</request>

<!-- Version 2 additions -->

<enum name="state">
<entry name="tiled" value="1"/>

<entry name="tiled_top" value="2" since="2" />
<entry name="tiled_right" value="3" since="2" />
<entry name="tiled_bottom" value="4" since="2" />
<entry name="tiled_left" value="5" since="2" />
</enum>

<enum name="edge_constraint" since="2">
<entry name="resizable_top" value="1"/>
<entry name="resizable_right" value="2"/>
<entry name="resizable_bottom" value="3"/>
<entry name="resizable_left" value="4"/>
</enum>

<event name="configure">
<arg name="states" type="array"/>
</event>

<event name="configure_edges" since="2">
<arg name="constraints" type="array"/>
</event>

<!-- Version 3 additions -->
<request name="request_focus" since="3">
<arg name="startup_id" type="string" allow-null="true"/>
</request>

<!-- Version 4 additions -->
<request name="release" type="destructor" since="4"/>

<!-- Version 5 additions -->
<enum name="gesture" since="5">
<entry name="double_click" value="1"/>
<entry name="right_click" value="2"/>
<entry name="middle_click" value="3"/>
</enum>

<enum name="error" since="5">
<entry name="invalid_gesture" value="0"/>
</enum>

<request name="titlebar_gesture" since="5">
<arg name="serial" type="uint"/>
<arg name="seat" type="object" interface="wl_seat"/>
<arg name="gesture" type="uint" enum="gesture"/>
</request>
</interface>

</protocol>
13 changes: 13 additions & 0 deletions wayland-protocols-misc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,19 @@ pub mod gtk_primary_selection {
wayland_protocol!("./protocols/gtk-primary-selection.xml", []);
}

pub mod gtk_shell {
//! GTK shell protocol.
//!
//! This protocol is a GTK-specific shell extending XDG shell. Most features
//! are identical to XDG shell but many compositors like Wayfire still
//! implement it and clients appear to use it anyway. Additional features
//! include edge constraints, DBus paths to specific elements like the menu
//! bar, title bar gestures like double click, and modals, windows that stick
//! to their parent surface (used for many GTK about dialogs).

wayland_protocol!("./protocols/gtk-shell.xml", []);
}

pub mod zwp_input_method_v2 {
//! Input method v2 unstable
//!
Expand Down