-
-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wayland: Add experimental pantheon-desktop-shell protocol
This is quite hacky but this open the way to using the pantheon-desktop-shell protocol.
- Loading branch information
Showing
12 changed files
with
571 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
dep_scanner = dependency('wayland-scanner', native: true) | ||
prog_scanner = find_program(dep_scanner.get_variable(pkgconfig: 'wayland_scanner')) | ||
|
||
protocol_file = files('pantheon-desktop-shell-v1.xml') | ||
|
||
pantheon_desktop_shell_sources = [] | ||
pantheon_desktop_shell_sources += custom_target( | ||
'pantheon-desktop-shell-server-protocol.h', | ||
command: [ prog_scanner, 'server-header', '@INPUT@', '@OUTPUT@' ], | ||
input: protocol_file, | ||
output: 'pantheon-desktop-shell-server-protocol.h', | ||
) | ||
|
||
output_type = 'private-code' | ||
if dep_scanner.version().version_compare('< 1.14.91') | ||
output_type = 'code' | ||
endif | ||
pantheon_desktop_shell_sources += custom_target( | ||
'pantheon-desktop-shell-protocol.c', | ||
command: [ prog_scanner, output_type, '@INPUT@', '@OUTPUT@' ], | ||
input: protocol_file, | ||
output: 'pantheon-desktop-shell-protocol.c', | ||
) | ||
|
||
pantheon_desktop_shell_dep = declare_dependency( | ||
dependencies: [ | ||
vala.find_library('pantheon-desktop-shell', dirs: meson.current_source_dir()), | ||
dependency('wayland-server'), | ||
], | ||
include_directories: include_directories('.'), | ||
sources: pantheon_desktop_shell_sources | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<protocol name="pantheon_shell_v1"> | ||
<copyright><![CDATA[ | ||
SPDX-FileCopyrightText: 2023 Corentin Noël <tintou@noel.tf> | ||
SPDX-License-Identifier: LGPL-2.1-or-later | ||
]]></copyright> | ||
|
||
<interface name="io_elementary_pantheon_shell_v1" version="1"> | ||
<description summary="create panel, widget and get more control"> | ||
This interface is used by the Pantheon Wayland shell to communicate with | ||
the compositor. | ||
</description> | ||
|
||
<request name="get_panel"> | ||
<description summary="create a panel surface from a surface"> | ||
Create a panel surface from an existing surface. | ||
</description> | ||
<arg name="output" type="new_id" interface="io_elementary_pantheon_panel_v1"/> | ||
<arg name="surface" type="object" interface="wl_surface"/> | ||
</request> | ||
|
||
<request name="get_widget"> | ||
<description summary="create a widget surface from a surface"> | ||
Create a desktop widget surface from an existing surface. | ||
</description> | ||
<arg name="output" type="new_id" interface="io_elementary_pantheon_widget_v1"/> | ||
<arg name="surface" type="object" interface="wl_surface"/> | ||
</request> | ||
|
||
<request name="get_extended_behavior"> | ||
<description summary="create a desktop-specific surface from a surface"> | ||
Create a desktop-specific surface from an existing surface. | ||
</description> | ||
<arg name="output" type="new_id" interface="io_elementary_pantheon_extended_behavior_v1"/> | ||
<arg name="surface" type="object" interface="wl_surface"/> | ||
</request> | ||
</interface> | ||
|
||
<interface name="io_elementary_pantheon_panel_v1" version="1"> | ||
<request name="destroy" type="destructor"/> | ||
|
||
<enum name="anchor"> | ||
<description summary="anchor"> | ||
The anchor is a placement hint to the compositor. | ||
</description> | ||
<entry name="top" value="0" summary="the top edge of the screen"/> | ||
<entry name="bottom" value="1" summary="the bottom edge of the screen"/> | ||
<entry name="left" value="2" summary="the left edge of the screen"/> | ||
<entry name="right" value="3" summary="the right edge of the screen"/> | ||
</enum> | ||
|
||
<request name="set_anchor"> | ||
<description summary="set panel edge anchor"> | ||
Tell the shell which side of the screen the panel is | ||
located. This is so that new windows do not overlap the panel | ||
and maximized windows maximize properly. | ||
</description> | ||
|
||
<arg name="anchor" type="uint" enum="anchor" summary="anchor"/> | ||
</request> | ||
</interface> | ||
|
||
<interface name="io_elementary_pantheon_widget_v1" version="1"> | ||
<request name="destroy" type="destructor"/> | ||
</interface> | ||
|
||
<interface name="io_elementary_pantheon_extended_behavior_v1" version="1"> | ||
<request name="destroy" type="destructor"/> | ||
<request name="set_keep_above"> | ||
<description summary="set keep above"> | ||
Tell the shell to keep the surface above on all workspaces | ||
</description> | ||
</request> | ||
</interface> | ||
</protocol> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
wayland-server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* Copyright 2023 elementary, Inc. <https://elementary.io> | ||
* Copyright 2023 Corentin Noël <tintou@noel.tf> | ||
* SPDX-License-Identifier: GPL-3.0-or-later | ||
*/ | ||
|
||
namespace Pantheon.Desktop { | ||
[CCode (cheader_filename = "pantheon-desktop-shell-server-protocol.h", cname = "struct io_elementary_pantheon_shell_v1_interface")] | ||
public struct ShellInterface { | ||
[CCode (cheader_filename = "pantheon-desktop-shell-server-protocol.h", cname = "io_elementary_pantheon_shell_v1_interface")] | ||
public static Wl.Interface iface; | ||
public Pantheon.Desktop.GetPanel get_panel; | ||
public Pantheon.Desktop.GetWidget get_widget; | ||
public Pantheon.Desktop.GetExtendedBehavior get_extended_behavior; | ||
|
||
} | ||
[CCode (cheader_filename = "pantheon-desktop-shell-server-protocol.h", cname = "enum io_elementary_pantheon_panel_v1_anchor", cprefix="IO_ELEMENTARY_PANTHEON_PANEL_V1_ANCHOR_", has_type_id = false)] | ||
public enum Anchor { | ||
TOP, | ||
BOTTOM, | ||
LEFT, | ||
RIGHT, | ||
} | ||
|
||
[CCode (cheader_filename = "pantheon-desktop-shell-server-protocol.h", cname = "struct io_elementary_pantheon_panel_v1_interface")] | ||
public struct PanelInterface { | ||
[CCode (cheader_filename = "pantheon-desktop-shell-server-protocol.h", cname = "io_elementary_pantheon_panel_v1_interface")] | ||
public static Wl.Interface iface; | ||
public Destroy destroy; | ||
public SetAnchor set_anchor; | ||
} | ||
|
||
[CCode (cheader_filename = "pantheon-desktop-shell-server-protocol.h", cname = "struct io_elementary_pantheon_widget_v1_interface")] | ||
public struct WidgetInterface { | ||
[CCode (cheader_filename = "pantheon-desktop-shell-server-protocol.h", cname = "io_elementary_pantheon_widget_v1_interface")] | ||
public static Wl.Interface iface; | ||
public Destroy destroy; | ||
} | ||
|
||
[CCode (cheader_filename = "pantheon-desktop-shell-server-protocol.h", cname = "struct io_elementary_pantheon_extended_behavior_v1_interface")] | ||
public struct ExtendedBehaviorInterface { | ||
[CCode (cheader_filename = "pantheon-desktop-shell-server-protocol.h", cname = "io_elementary_pantheon_extended_behavior_v1_interface")] | ||
public static Wl.Interface iface; | ||
public Destroy destroy; | ||
public SetKeepAbove set_keep_above; | ||
} | ||
|
||
[CCode (has_target = false, has_typedef = false)] | ||
public delegate void GetPanel (Wl.Client client, Wl.Resource resource, uint32 output, Wl.Resource surface); | ||
[CCode (has_target = false, has_typedef = false)] | ||
public delegate void GetWidget (Wl.Client client, Wl.Resource resource, uint32 output, Wl.Resource surface); | ||
[CCode (has_target = false, has_typedef = false)] | ||
public delegate void GetExtendedBehavior (Wl.Client client, Wl.Resource resource, uint32 output, Wl.Resource surface); | ||
[CCode (has_target = false, has_typedef = false)] | ||
public delegate void SetAnchor (Wl.Client client, Wl.Resource resource, [CCode (type = "uint32_t")] Anchor anchor); | ||
[CCode (has_target = false, has_typedef = false)] | ||
public delegate void SetKeepAbove (Wl.Client client, Wl.Resource resource); | ||
[CCode (has_target = false, has_typedef = false)] | ||
public delegate void Destroy (Wl.Client client, Wl.Resource resource); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.