Skip to content

Commit 8493fb2

Browse files
committed
start migration from wf-shell to gtk-layer-shell
1. update to wf-shell-v2 2. add gtk-layer-shell as dependency 3. start porting autohiding window to layer-shell
1 parent efe1fd4 commit 8493fb2

14 files changed

+332
-501
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "subprojects/gtk-layer-shell"]
2+
path = subprojects/gtk-layer-shell
3+
url = https://github.com/wmww/gtk-layer-shell

meson.build

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ project(
66
license: 'MIT',
77
meson_version: '>=0.43.0',
88
default_options: [
9-
'cpp_std=c++11',
9+
'cpp_std=c++14',
1010
'c_std=c11',
1111
'warning_level=2',
1212
'werror=false',
@@ -17,14 +17,15 @@ wayland_client = dependency('wayland-client')
1717
wayland_protos = dependency('wayland-protocols')
1818
gtkmm = dependency('gtkmm-3.0')
1919
wfconfig = dependency('wf-config') #TODO fallback submodule
20+
gtklayershell = dependency('gtk-layer-shell-0', fallback: ['gtk-layer-shell', 'gtk_layer_shell_dep'])
2021

2122
needs_libinotify = ['freebsd', 'dragonfly'].contains(host_machine.system())
2223
libinotify = dependency('libinotify', required: needs_libinotify)
2324

2425
add_project_arguments(['-Wno-pedantic', '-Wno-unused-parameter', '-Wno-parentheses', '-Wno-cast-function-type'], language: 'cpp')
2526

2627
icon_dir = join_paths(get_option('prefix'), 'share', 'wayfire', 'icons')
27-
add_global_arguments('-DICONDIR="' + icon_dir + '"', language : 'cpp')
28+
add_project_arguments('-DICONDIR="' + icon_dir + '"', language : 'cpp')
2829

2930
subdir('proto')
3031
subdir('data')

proto/meson.build

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,8 @@ wayland_scanner_client = generator(
1515
)
1616

1717
client_protocols = [
18-
[wl_protocol_dir, 'unstable/xdg-output/xdg-output-unstable-v1.xml'],
19-
[wl_protocol_dir, 'stable/xdg-shell/xdg-shell.xml'],
20-
'wayfire-shell.xml',
21-
'wlr-foreign-toplevel-management-unstable-v1.xml'
18+
'wlr-foreign-toplevel-management-unstable-v1.xml',
19+
'wayfire-shell-unstable-v2.xml',
2220
]
2321

2422
wl_protos_src = []

proto/wayfire-shell-unstable-v2.xml

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
<protocol name="wayfire_shell">
2+
<interface name="zwf_shell_manager_v2" version="1">
3+
<description summary="DE integration">
4+
This protocol provides additional events and requests for special DE
5+
clients like panels, docks, etc.
6+
7+
It is meant as an addition for protocols like wlr-layer-shell.
8+
</description>
9+
10+
<request name="get_wf_output">
11+
<description summary="Create a wf_output from the given output"/>
12+
<arg name="output" type="object" interface="wl_output"/>
13+
<arg name="id" type="new_id" interface="zwf_output_v2"/>
14+
</request>
15+
16+
<request name="get_wf_surface">
17+
<description summary="Create a wf_surface from the given wl_surface"/>
18+
<arg name="surface" type="object" interface="wl_surface"/>
19+
<arg name="id" type="new_id" interface="zwf_surface_v2"/>
20+
</request>
21+
</interface>
22+
23+
<interface name="zwf_output_v2" version="1">
24+
<description summary="A wrapper for wl_output">
25+
Represents a single output.
26+
Each output is managed independently from the others.
27+
</description>
28+
29+
<event name="enter_fullscreen">
30+
<description summary="A window was fullscreened">
31+
Emitted when a window gets fullscreened on the given output. In this
32+
mode, windows in the TOP layer are not visible.
33+
34+
There will be no two consecutive enter_fullscreen calls, i.e. if
35+
fullscreen mode is entered it will be exited before going into this mode
36+
again.
37+
</description>
38+
</event>
39+
40+
<event name="leave_fullscreen">
41+
<description summary="A window was fullscreened">
42+
Emitted when the output is no longer in fullscreen mode. Each
43+
leave_fullscreen has a corresponding enter_fullscreen before it.
44+
</description>
45+
</event>
46+
47+
<request name="inhibit_output">
48+
<description summary="Don't render the output">
49+
Request the compositor to not render the output, so the output usually
50+
is cleared to black color. To enable output rendering again, call
51+
inhibit_output_done.
52+
</description>
53+
</request>
54+
55+
<request name="inhibit_output_done">
56+
<description summary="Render the output">
57+
Stop inhibiting the output. This must be called as many times as
58+
inhibit_output was called to actually uninhibit rendering.
59+
60+
The inhibit/inhibit_done requests can be called multiple times, even
61+
from different apps, so don't assume that a call to inhibit_done would
62+
always mean actually starting the rendering process.
63+
</description>
64+
</request>
65+
66+
<enum name="hotspot_edge">
67+
<entry name="top" value="1"/>
68+
<entry name="bottom" value="2"/>
69+
<entry name="left" value="4"/>
70+
<entry name="right" value="8"/>
71+
</enum>
72+
73+
<request name="create_hotspot">
74+
<description summary="Create a hotspot on the output">
75+
A hotspot on the output is an edge or a corner region of the
76+
output where the mouse has been residing for a given amount of time.
77+
78+
The hotspot can be used for example for autohiding panels, where the
79+
panel is shown when the mouse hovers on the edge of the output for a
80+
specific amount of time.
81+
</description>
82+
83+
<arg name="hotspot" type="uint" summary="bitwise or of the edges the output"/>
84+
<arg name="threshold" type="uint" summary="distance from the edge of the output"/>
85+
<arg name="timeout" type="uint" summary="minimum time for the mouse to be in the hotspot"/>
86+
<arg name="id" type="new_id" interface="zwf_hotspot_v2"/>
87+
</request>
88+
</interface>
89+
90+
<interface name="zwf_hotspot_v2" version="1">
91+
<description summary="An edge of the output defined by 1 or 2 edges"/>
92+
93+
<event name="triggered">
94+
<description summary="Hotspot was triggered">
95+
Means that the mouse was inside the indicated hotspot for the given
96+
amount of time.
97+
98+
Emitted at most once for each entry of the mouse inside the hotspot.
99+
</description>
100+
</event>
101+
</interface>
102+
103+
<interface name="zwf_surface_v2" version="1">
104+
<description summary="A special surface"/>
105+
<request name="interactive_move">
106+
<description summary="Start and interactive move of the surface"/>
107+
</request>
108+
</interface>
109+
110+
</protocol>

proto/wayfire-shell.xml

Lines changed: 0 additions & 168 deletions
This file was deleted.

src/meson.build

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
subdir('util')
2-
subdir('panel')
3-
subdir('background')
4-
subdir('dock')
2+
#subdir('panel')
3+
#subdir('background')
4+
#subdir('dock')
55

0 commit comments

Comments
 (0)