Skip to content

Commit

Permalink
start migration from wf-shell to gtk-layer-shell
Browse files Browse the repository at this point in the history
1. update to wf-shell-v2
2. add gtk-layer-shell as dependency
3. start porting autohiding window to layer-shell
  • Loading branch information
ammen99 committed Aug 11, 2019
1 parent efe1fd4 commit 8493fb2
Show file tree
Hide file tree
Showing 14 changed files with 332 additions and 501 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "subprojects/gtk-layer-shell"]
path = subprojects/gtk-layer-shell
url = https://github.com/wmww/gtk-layer-shell
5 changes: 3 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ project(
license: 'MIT',
meson_version: '>=0.43.0',
default_options: [
'cpp_std=c++11',
'cpp_std=c++14',
'c_std=c11',
'warning_level=2',
'werror=false',
Expand All @@ -17,14 +17,15 @@ wayland_client = dependency('wayland-client')
wayland_protos = dependency('wayland-protocols')
gtkmm = dependency('gtkmm-3.0')
wfconfig = dependency('wf-config') #TODO fallback submodule
gtklayershell = dependency('gtk-layer-shell-0', fallback: ['gtk-layer-shell', 'gtk_layer_shell_dep'])

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

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

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

subdir('proto')
subdir('data')
Expand Down
6 changes: 2 additions & 4 deletions proto/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@ wayland_scanner_client = generator(
)

client_protocols = [
[wl_protocol_dir, 'unstable/xdg-output/xdg-output-unstable-v1.xml'],
[wl_protocol_dir, 'stable/xdg-shell/xdg-shell.xml'],
'wayfire-shell.xml',
'wlr-foreign-toplevel-management-unstable-v1.xml'
'wlr-foreign-toplevel-management-unstable-v1.xml',
'wayfire-shell-unstable-v2.xml',
]

wl_protos_src = []
Expand Down
110 changes: 110 additions & 0 deletions proto/wayfire-shell-unstable-v2.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
<protocol name="wayfire_shell">
<interface name="zwf_shell_manager_v2" version="1">
<description summary="DE integration">
This protocol provides additional events and requests for special DE
clients like panels, docks, etc.

It is meant as an addition for protocols like wlr-layer-shell.
</description>

<request name="get_wf_output">
<description summary="Create a wf_output from the given output"/>
<arg name="output" type="object" interface="wl_output"/>
<arg name="id" type="new_id" interface="zwf_output_v2"/>
</request>

<request name="get_wf_surface">
<description summary="Create a wf_surface from the given wl_surface"/>
<arg name="surface" type="object" interface="wl_surface"/>
<arg name="id" type="new_id" interface="zwf_surface_v2"/>
</request>
</interface>

<interface name="zwf_output_v2" version="1">
<description summary="A wrapper for wl_output">
Represents a single output.
Each output is managed independently from the others.
</description>

<event name="enter_fullscreen">
<description summary="A window was fullscreened">
Emitted when a window gets fullscreened on the given output. In this
mode, windows in the TOP layer are not visible.

There will be no two consecutive enter_fullscreen calls, i.e. if
fullscreen mode is entered it will be exited before going into this mode
again.
</description>
</event>

<event name="leave_fullscreen">
<description summary="A window was fullscreened">
Emitted when the output is no longer in fullscreen mode. Each
leave_fullscreen has a corresponding enter_fullscreen before it.
</description>
</event>

<request name="inhibit_output">
<description summary="Don't render the output">
Request the compositor to not render the output, so the output usually
is cleared to black color. To enable output rendering again, call
inhibit_output_done.
</description>
</request>

<request name="inhibit_output_done">
<description summary="Render the output">
Stop inhibiting the output. This must be called as many times as
inhibit_output was called to actually uninhibit rendering.

The inhibit/inhibit_done requests can be called multiple times, even
from different apps, so don't assume that a call to inhibit_done would
always mean actually starting the rendering process.
</description>
</request>

<enum name="hotspot_edge">
<entry name="top" value="1"/>
<entry name="bottom" value="2"/>
<entry name="left" value="4"/>
<entry name="right" value="8"/>
</enum>

<request name="create_hotspot">
<description summary="Create a hotspot on the output">
A hotspot on the output is an edge or a corner region of the
output where the mouse has been residing for a given amount of time.

The hotspot can be used for example for autohiding panels, where the
panel is shown when the mouse hovers on the edge of the output for a
specific amount of time.
</description>

<arg name="hotspot" type="uint" summary="bitwise or of the edges the output"/>
<arg name="threshold" type="uint" summary="distance from the edge of the output"/>
<arg name="timeout" type="uint" summary="minimum time for the mouse to be in the hotspot"/>
<arg name="id" type="new_id" interface="zwf_hotspot_v2"/>
</request>
</interface>

<interface name="zwf_hotspot_v2" version="1">
<description summary="An edge of the output defined by 1 or 2 edges"/>

<event name="triggered">
<description summary="Hotspot was triggered">
Means that the mouse was inside the indicated hotspot for the given
amount of time.

Emitted at most once for each entry of the mouse inside the hotspot.
</description>
</event>
</interface>

<interface name="zwf_surface_v2" version="1">
<description summary="A special surface"/>
<request name="interactive_move">
<description summary="Start and interactive move of the surface"/>
</request>
</interface>

</protocol>
168 changes: 0 additions & 168 deletions proto/wayfire-shell.xml

This file was deleted.

6 changes: 3 additions & 3 deletions src/meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
subdir('util')
subdir('panel')
subdir('background')
subdir('dock')
#subdir('panel')
#subdir('background')
#subdir('dock')

Loading

0 comments on commit 8493fb2

Please sign in to comment.