Skip to content

Commit fd135b0

Browse files
committed
Update mock server to match the version in the gtk4 repo
1 parent ae2d675 commit fd135b0

File tree

13 files changed

+493
-1495
lines changed

13 files changed

+493
-1495
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ The easiest way to build against GTK Layer Shell is to use the `gtk-layer-shell-
5656
### Build Dependencies
5757
* [Meson](https://mesonbuild.com/) (>=0.45.1)
5858
* [libwayland](https://gitlab.freedesktop.org/wayland/wayland) (>=1.10.0)
59+
* [wayland-protocols](https://gitlab.freedesktop.org/wayland/wayland-protocols) (>=1.16.0)
5960
* [GTK3](https://www.gtk.org/) (>=3.22.0)
6061
* [GObject introspection](https://gitlab.gnome.org/GNOME/gobject-introspection/)
6162
* [GTK Doc](https://www.gtk.org/gtk-doc/) (only required if docs are enabled)

meson.build

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ project('gtk-layer-shell',
22
['c'],
33
version: '0.9.1',
44
license: 'LGPLv3',
5-
meson_version: '>=0.45.1',
5+
meson_version: '>=0.54.0',
66
default_options: ['c_std=gnu11', 'warning_level=3'])
77

88
lib_so_version = '0'
@@ -20,8 +20,8 @@ wayland_server = dependency('wayland-server', version: '>=1.10.0', required: fal
2020
# wayland_scanner is required, but we can find it without pkg-config
2121
wayland_scanner = dependency('wayland-scanner', version: '>=1.10.0', required: false, native: true)
2222

23-
# use system xdg-shell protocol when available
24-
wayland_protocols = dependency('wayland-protocols', version: '>=1.16', required: false)
23+
# required, see https://github.com/wmww/gtk4-layer-shell/issues/24
24+
wayland_protocols = dependency('wayland-protocols', version: '>=1.16', required: true)
2525

2626
pkg_config = import('pkgconfig')
2727
gnome = import('gnome')

protocol/meson.build

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
if wayland_scanner.found()
2-
prog_wayland_scanner = find_program(wayland_scanner.get_pkgconfig_variable('wayland_scanner'))
2+
prog_wayland_scanner = find_program(wayland_scanner.get_variable(pkgconfig: 'wayland_scanner'))
33
else
44
prog_wayland_scanner = find_program('wayland-scanner')
55
endif
66

77
protocols = [
8-
'wlr-layer-shell-unstable-v1.xml'
8+
'wlr-layer-shell-unstable-v1.xml',
9+
join_paths(
10+
wayland_protocols.get_variable(pkgconfig: 'pkgdatadir'),
11+
'stable/xdg-shell/xdg-shell.xml'),
12+
join_paths(
13+
wayland_protocols.get_variable(pkgconfig: 'pkgdatadir'),
14+
'staging/ext-session-lock/ext-session-lock-v1.xml'),
915
]
1016

11-
if wayland_protocols.found()
12-
protocols += join_paths(
13-
wayland_protocols.get_pkgconfig_variable('pkgdatadir'),
14-
'stable/xdg-shell/xdg-shell.xml')
15-
else
16-
# use bundled xdg-shell.xml
17-
protocols += 'xdg-shell.xml'
17+
if get_option('tests')
18+
protocols += 'xdg-dialog-v1.xml'
1819
endif
1920

2021
gen_client_header = generator(prog_wayland_scanner,
@@ -27,16 +28,17 @@ gen_server_header = generator(prog_wayland_scanner,
2728

2829
gen_private_code = generator(prog_wayland_scanner,
2930
output: ['@BASENAME@.c'],
30-
arguments: ['-c', 'code', '@INPUT@', '@BUILD_DIR@/@BASENAME@.c'])
31-
# 'code' is deprecated, and can be replaced with 'private-code' when all platforms have a new enough wayland-scanner
31+
arguments: ['-c', 'private-code', '@INPUT@', '@BUILD_DIR@/@BASENAME@.c'])
3232

3333
client_protocol_srcs = []
3434
server_protocol_srcs = []
3535

3636
foreach protocol : protocols
3737
client_header = gen_client_header.process(protocol)
38-
server_header = gen_server_header.process(protocol)
3938
code = gen_private_code.process(protocol)
4039
client_protocol_srcs += [client_header, code]
41-
server_protocol_srcs += [server_header, code]
40+
if get_option('tests')
41+
server_header = gen_server_header.process(protocol)
42+
server_protocol_srcs += [server_header, code]
43+
endif
4244
endforeach

protocol/xdg-dialog-v1.xml

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<protocol name="xdg_dialog_v1">
3+
<copyright>
4+
Copyright © 2023 Carlos Garnacho
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a
7+
copy of this software and associated documentation files (the "Software"),
8+
to deal in the Software without restriction, including without limitation
9+
the rights to use, copy, modify, merge, publish, distribute, sublicense,
10+
and/or sell copies of the Software, and to permit persons to whom the
11+
Software is furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice (including the next
14+
paragraph) shall be included in all copies or substantial portions of the
15+
Software.
16+
17+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20+
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23+
DEALINGS IN THE SOFTWARE.
24+
</copyright>
25+
26+
<interface name="xdg_wm_dialog_v1" version="1">
27+
<description summary="create dialogs related to other toplevels">
28+
The xdg_wm_dialog_v1 interface is exposed as a global object allowing
29+
to register surfaces with a xdg_toplevel role as "dialogs" relative to
30+
another toplevel.
31+
32+
The compositor may let this relation influence how the surface is
33+
placed, displayed or interacted with.
34+
35+
Warning! The protocol described in this file is currently in the testing
36+
phase. Backward compatible changes may be added together with the
37+
corresponding interface version bump. Backward incompatible changes can
38+
only be done by creating a new major version of the extension.
39+
</description>
40+
41+
<enum name="error">
42+
<entry name="already_used" value="0"
43+
summary="the xdg_toplevel object has already been used to create a xdg_dialog_v1"/>
44+
</enum>
45+
46+
<request name="destroy" type="destructor">
47+
<description summary="destroy the dialog manager object">
48+
Destroys the xdg_wm_dialog_v1 object. This does not affect
49+
the xdg_dialog_v1 objects generated through it.
50+
</description>
51+
</request>
52+
53+
<request name="get_xdg_dialog">
54+
<description summary="create a dialog object">
55+
Creates a xdg_dialog_v1 object for the given toplevel. See the interface
56+
description for more details.
57+
58+
Compositors must raise an already_used error if clients attempt to
59+
create multiple xdg_dialog_v1 objects for the same xdg_toplevel.
60+
</description>
61+
<arg name="id" type="new_id" interface="xdg_dialog_v1"/>
62+
<arg name="toplevel" type="object" interface="xdg_toplevel"/>
63+
</request>
64+
</interface>
65+
66+
<interface name="xdg_dialog_v1" version="1">
67+
<description summary="dialog object">
68+
A xdg_dialog_v1 object is an ancillary object tied to a xdg_toplevel. Its
69+
purpose is hinting the compositor that the toplevel is a "dialog" (e.g. a
70+
temporary window) relative to another toplevel (see
71+
xdg_toplevel.set_parent). If the xdg_toplevel is destroyed, the xdg_dialog_v1
72+
becomes inert.
73+
74+
Through this object, the client may provide additional hints about
75+
the purpose of the secondary toplevel. This interface has no effect
76+
on toplevels that are not attached to a parent toplevel.
77+
</description>
78+
79+
<request name="destroy" type="destructor">
80+
<description summary="destroy the dialog object">
81+
Destroys the xdg_dialog_v1 object. If this object is destroyed
82+
before the related xdg_toplevel, the compositor should unapply its
83+
effects.
84+
</description>
85+
</request>
86+
87+
<request name="set_modal">
88+
<description summary="mark dialog as modal">
89+
Hints that the dialog has "modal" behavior. Modal dialogs typically
90+
require to be fully addressed by the user (i.e. closed) before resuming
91+
interaction with the parent toplevel, and may require a distinct
92+
presentation.
93+
94+
Clients must implement the logic to filter events in the parent
95+
toplevel on their own.
96+
97+
Compositors may choose any policy in event delivery to the parent
98+
toplevel, from delivering all events unfiltered to using them for
99+
internal consumption.
100+
</description>
101+
</request>
102+
103+
<request name="unset_modal">
104+
<description summary="mark dialog as not modal">
105+
Drops the hint that this dialog has "modal" behavior. See
106+
xdg_dialog_v1.set_modal for more details.
107+
</description>
108+
</request>
109+
</interface>
110+
</protocol>

0 commit comments

Comments
 (0)