diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 00000000..8b032d56
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "subprojects/gtk-layer-shell"]
+ path = subprojects/gtk-layer-shell
+ url = https://github.com/wmww/gtk-layer-shell
diff --git a/meson.build b/meson.build
index d876858e..271a1f9c 100644
--- a/meson.build
+++ b/meson.build
@@ -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',
@@ -17,6 +17,7 @@ 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)
@@ -24,7 +25,7 @@ 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')
diff --git a/proto/meson.build b/proto/meson.build
index 03f9bd10..e357a0d9 100644
--- a/proto/meson.build
+++ b/proto/meson.build
@@ -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 = []
diff --git a/proto/wayfire-shell-unstable-v2.xml b/proto/wayfire-shell-unstable-v2.xml
new file mode 100644
index 00000000..ffdabd50
--- /dev/null
+++ b/proto/wayfire-shell-unstable-v2.xml
@@ -0,0 +1,110 @@
+
+
+
+ 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.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Represents a single output.
+ Each output is managed independently from the others.
+
+
+
+
+ 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.
+
+
+
+
+
+ Emitted when the output is no longer in fullscreen mode. Each
+ leave_fullscreen has a corresponding enter_fullscreen before it.
+
+
+
+
+
+ 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.
+
+
+
+
+
+ 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.
+
+
+
+
+
+
+
+
+
+
+
+
+ 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.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 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.
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/proto/wayfire-shell.xml b/proto/wayfire-shell.xml
deleted file mode 100644
index d1d4f82f..00000000
--- a/proto/wayfire-shell.xml
+++ /dev/null
@@ -1,168 +0,0 @@
-
-
-
- The purpose of this protocol is to enable the creation of different
- desktop-interface windows like panels, backgrounds, docks,
- lockscreens, etc. It also aims to allow the creation of full-blown
- DEs using Wayfire.
-
- Note that in contrast to some other efforts to create a similar
- protocol, such as wlr-layer-shell, this isn't a new "shell" for
- giving a role to wl_surfaces. This protocol can be used with any
- type of toplevel surface (xdg_toplevel, xdg_toplevel_v6, etc.)
- to give them to the corresponding WM role.
-
-
-
-
-
-
-
-
-
-
- Assign the given role to the given surface and add it to the
- given output. A client can specify a null output, in which case
- the compositor will assign the surface to the focused output,
- if any such output.
-
- The role cannot be changed later, and neither can the surface be
- moved to a different output, except by the compositor.
-
-
-
-
-
-
-
-
-
-
-
- Represents a single output.
- Each output is managed independently from the others.
-
-
-
- Panels are always rendered on top, even above fullscreen windows.
- If autohide is 1, the event indicates that the panels should hide
- itself, by for example unmapping or sliding outside of the output.
- If autohide is 0, this means that the reason for the last request
- with autohide == 1 is no longer valid, i.e the panels can show
- themselves.
-
- The output_hide_panels can be called multiple times with
- autohide = 1, and the panel should show itself only when
- it has received a matching number of events with autohide = 0
-
-
-
-
-
-
-
- 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
-
-
-
-
-
- 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.
-
-
-
-
-
-
- Represents a surface with a specific WM role.
- It belongs to the output which it was created for.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Sets the position on the screen where the compositor should
- position the view. Can be reset by specifying anchor 0. If not
- set, the compositor will assume manual positioning via the
- configure request.
-
- If one anchor edge is provided, the wm surface is "stuck" to
- that edge.
- If two anchor edges are provided, the wm surface is considered
- anchored to the corner of the screen between them.
-
- Any other anchor edge configuration is considered invalid.
-
-
-
-
-
-
- Set the offset from the anchored edges to the wm surface. This
- is an alternative to the configure request. Using both will
- result in undefined results.
-
- Margin has effect only for edges the wm surface is anchored to.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Sets how the wm surface will interact with keyboard focus.
- Setting no_focus means that the surface will never receive
- keyboard focus, click_to_focus means normal focus semantics (i.e
- what you expect from "normal" windows), and exclusive focus means
- that no other window can get keyboard focus.
-
-
-
-
-
-
- Request the compositor to reserve the given amount of pixels
- for the wm surface(like STRUTS in X11). This has effect only
- if the surface is anchored to a single edge. Margin doesn't
- affect exclusive zone in any way.
-
-
-
-
-
diff --git a/src/meson.build b/src/meson.build
index 483b9bce..6396e53f 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -1,5 +1,5 @@
subdir('util')
-subdir('panel')
-subdir('background')
-subdir('dock')
+#subdir('panel')
+#subdir('background')
+#subdir('dock')
diff --git a/src/util/display.cpp b/src/util/display.cpp
deleted file mode 100644
index 09dc7863..00000000
--- a/src/util/display.cpp
+++ /dev/null
@@ -1,146 +0,0 @@
-#include "display.hpp"
-#include
-#include
-#include
-#include
-
-// listeners
-static void registry_add_object(void *data, struct wl_registry *registry, uint32_t name,
- const char *interface, uint32_t version)
-{
- auto display = static_cast (data);
- if (strcmp(interface, zwf_shell_manager_v1_interface.name) == 0)
- {
- display->zwf_shell_manager =
- (zwf_shell_manager_v1*) wl_registry_bind(registry, name,
- &zwf_shell_manager_v1_interface,
- std::min(version, 1u));
- }
-
- if (strcmp(interface, zxdg_output_manager_v1_interface.name) == 0)
- {
- display->zxdg_output_manager = (zxdg_output_manager_v1*)
- wl_registry_bind(registry, name, &zxdg_output_manager_v1_interface,
- std::min(version, 2u));
- }
-
- if (strcmp(interface, wl_output_interface.name) == 0)
- {
- auto output = (wl_output*) wl_registry_bind(registry, name, &wl_output_interface,
- std::min(version, 1u));
- display->name_to_wayfire_output[name] = new WayfireOutput(display, output);
- }
-
- if (strcmp(interface, wl_seat_interface.name) == 0 && !display->default_seat)
- {
- display->default_seat = (wl_seat*) wl_registry_bind(registry, name,
- &wl_seat_interface, std::min(version, 1u));
- }
-}
-
-static void registry_remove_object(void *data, struct wl_registry *registry, uint32_t name)
-{
- auto display = (WayfireDisplay*) data;
- if (display->name_to_wayfire_output.count(name))
- {
- delete display->name_to_wayfire_output[name];
- display->name_to_wayfire_output.erase(name);
- }
-}
-
-static struct wl_registry_listener registry_listener =
-{
- ®istry_add_object,
- ®istry_remove_object
-};
-
-/* WayfireDisplay implementation */
-WayfireDisplay::WayfireDisplay(std::function new_output_cb)
-{
- this->new_output_callback = new_output_cb;
-
- auto gdk_display = gdk_display_get_default();
- auto display = gdk_wayland_display_get_wl_display(gdk_display);
-
- if (!display)
- {
- std::cerr << "Failed to connect to wayland display!"
- << " Are you sure you are running a wayland compositor?" << std::endl;
- std::exit(-1);
- }
-
- wl_registry *registry = wl_display_get_registry(display);
- wl_registry_add_listener(registry, ®istry_listener, this);
- wl_display_roundtrip(display);
-
- if (!this->zxdg_output_manager)
- {
- std::cerr << "xdg_output not available" << std::endl;
- std::exit(-1);
- }
-
- if (!this->zwf_shell_manager)
- {
- std::cerr << "wayfire-shell not available" << std::endl;
- std::exit(-1);
- }
-}
-
-WayfireDisplay::~WayfireDisplay()
-{
- zxdg_output_manager_v1_destroy(zxdg_output_manager);
-
- // TODO: we should also destroy all kinds of shells,
- // registry, etc. here
- wl_display_disconnect(display);
-}
-
-/* zxdg_output impl */
-static void zxdg_output_logical_position(void *data, struct zxdg_output_v1 *zxdg_output_v1,
- int32_t x, int32_t y)
-{ }
-
-static void zxdg_output_logical_size(void *data, struct zxdg_output_v1 *zxdg_output_v1,
- int32_t width, int32_t height)
-{
- auto wo = (WayfireOutput*) data;
- if (width > 0 && height > 0 && wo->resized_callback)
- wo->resized_callback(wo, width, height);
-}
-
-static void zxdg_output_done(void *data, struct zxdg_output_v1 *zxdg_output_v1) { }
-static void zxdg_output_name(void *data, struct zxdg_output_v1 *zxdg_output_v1, const char *name) {}
-static void zxdg_output_description(void *data, struct zxdg_output_v1 *zxdg_output_v1, const char *description) {}
-
-const struct zxdg_output_v1_listener zxdg_output_v1_impl =
-{
- zxdg_output_logical_position,
- zxdg_output_logical_size,
- zxdg_output_done,
- zxdg_output_name,
- zxdg_output_description
-};
-
-/* WayfireOutput implementation */
-WayfireOutput::WayfireOutput(WayfireDisplay *display, wl_output *output)
-{
- this->display = display;
- this->handle = output;
-
- zxdg_output = zxdg_output_manager_v1_get_xdg_output(display->zxdg_output_manager, handle);
- zxdg_output_v1_add_listener(zxdg_output, &zxdg_output_v1_impl, this);
-
- if (display->zwf_shell_manager)
- zwf = zwf_shell_manager_v1_get_wf_output(display->zwf_shell_manager, output);
-
- if (display->new_output_callback)
- display->new_output_callback(this);
-}
-
-WayfireOutput::~WayfireOutput()
-{
- if (destroyed_callback)
- destroyed_callback(this);
-
- zxdg_output_v1_destroy(zxdg_output);
-}
diff --git a/src/util/display.hpp b/src/util/display.hpp
deleted file mode 100644
index 528e75c4..00000000
--- a/src/util/display.hpp
+++ /dev/null
@@ -1,43 +0,0 @@
-#ifndef DISPLAY_HPP
-#define DISPLAY_HPP
-
-#include
-#include
-#include