aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTony Crisci <tony@dubstepdish.com>2018-01-17 08:27:47 -0500
committerTony Crisci <tony@dubstepdish.com>2018-01-17 08:27:47 -0500
commit43896af90fbd6c743be1e54a0659d7c0f89eaa00 (patch)
treec9d0907dbdc9932b593cf154f4ebce6db5a27e2d /include
parentb40a5f084abeb5530b3a0097c946ba720c897262 (diff)
parentf2698a896085a5a2dd651a7f1d4fb623d567acf4 (diff)
Merge branch 'master' into modifier-fixes
Diffstat (limited to 'include')
-rw-r--r--include/backend/drm/iface.h2
-rw-r--r--include/rootston/config.h1
-rw-r--r--include/rootston/desktop.h2
-rw-r--r--include/wlr/backend/wayland.h6
-rw-r--r--include/wlr/interfaces/wlr_output.h7
-rw-r--r--include/wlr/types/wlr_idle.h51
-rw-r--r--include/wlr/types/wlr_output.h13
-rw-r--r--include/wlr/xwayland.h5
8 files changed, 74 insertions, 13 deletions
diff --git a/include/backend/drm/iface.h b/include/backend/drm/iface.h
index bc61eb51..4a5d2e9d 100644
--- a/include/backend/drm/iface.h
+++ b/include/backend/drm/iface.h
@@ -15,7 +15,7 @@ struct wlr_drm_crtc;
// Used to provide atomic or legacy DRM functions
struct wlr_drm_interface {
// Enable or disable DPMS for connector
- void (*conn_enable)(struct wlr_drm_backend *drm,
+ bool (*conn_enable)(struct wlr_drm_backend *drm,
struct wlr_drm_connector *conn, bool enable);
// Pageflip on crtc. If mode is non-NULL perform a full modeset using it.
bool (*crtc_pageflip)(struct wlr_drm_backend *drm,
diff --git a/include/rootston/config.h b/include/rootston/config.h
index bd24e577..05f23b75 100644
--- a/include/rootston/config.h
+++ b/include/rootston/config.h
@@ -7,6 +7,7 @@
struct roots_output_config {
char *name;
+ bool enable;
enum wl_output_transform transform;
int x, y;
float scale;
diff --git a/include/rootston/desktop.h b/include/rootston/desktop.h
index 8d706b65..9dfd7b10 100644
--- a/include/rootston/desktop.h
+++ b/include/rootston/desktop.h
@@ -13,6 +13,7 @@
#include <wlr/types/wlr_primary_selection.h>
#include <wlr/types/wlr_screenshooter.h>
#include <wlr/types/wlr_list.h>
+#include <wlr/types/wlr_idle.h>
#include "rootston/view.h"
#include "rootston/config.h"
@@ -44,6 +45,7 @@ struct roots_desktop {
struct wlr_screenshooter *screenshooter;
struct wlr_server_decoration_manager *server_decoration_manager;
struct wlr_primary_selection_device_manager *primary_selection_device_manager;
+ struct wlr_idle *idle;
struct wl_listener output_add;
struct wl_listener output_remove;
diff --git a/include/wlr/backend/wayland.h b/include/wlr/backend/wayland.h
index b10ffee3..f89a6383 100644
--- a/include/wlr/backend/wayland.h
+++ b/include/wlr/backend/wayland.h
@@ -11,8 +11,12 @@
/**
* Creates a new wlr_wl_backend. This backend will be created with no outputs;
* you must use wlr_wl_output_create to add them.
+ *
+ * The `remote` argument is the name of the host compositor wayland socket. Set
+ * to NULL for the default behaviour (WAYLAND_DISPLAY env variable or wayland-0
+ * default)
*/
-struct wlr_backend *wlr_wl_backend_create(struct wl_display *display);
+struct wlr_backend *wlr_wl_backend_create(struct wl_display *display, const char *remote);
/**
* Adds a new output to this backend. You may remove outputs by destroying them.
diff --git a/include/wlr/interfaces/wlr_output.h b/include/wlr/interfaces/wlr_output.h
index 6d71f9b6..d5837def 100644
--- a/include/wlr/interfaces/wlr_output.h
+++ b/include/wlr/interfaces/wlr_output.h
@@ -26,14 +26,11 @@ struct wlr_output_impl {
};
void wlr_output_init(struct wlr_output *output, struct wlr_backend *backend,
- const struct wlr_output_impl *impl);
-void wlr_output_free(struct wlr_output *output);
+ const struct wlr_output_impl *impl, struct wl_display *display);
void wlr_output_update_mode(struct wlr_output *output,
struct wlr_output_mode *mode);
void wlr_output_update_custom_mode(struct wlr_output *output, int32_t width,
int32_t height, int32_t refresh);
-struct wl_global *wlr_output_create_global(struct wlr_output *wlr_output,
- struct wl_display *display);
-void wlr_output_destroy_global(struct wlr_output *wlr_output);
+void wlr_output_update_enabled(struct wlr_output *output, bool enabled);
#endif
diff --git a/include/wlr/types/wlr_idle.h b/include/wlr/types/wlr_idle.h
new file mode 100644
index 00000000..689c33a4
--- /dev/null
+++ b/include/wlr/types/wlr_idle.h
@@ -0,0 +1,51 @@
+#ifndef WLR_TYPES_WLR_IDLE_H
+#define WLR_TYPES_WLR_IDLE_H
+
+#include <wayland-server.h>
+#include <wlr/types/wlr_seat.h>
+
+/**
+ * Idle protocol is used to create timers which will notify the client when the
+ * compositor does not receive any input for a given time(in milliseconds). Also
+ * the client will be notify when the timer receve an activity notify and already
+ * was in idle state. Besides this, the client is able to simulate user activity
+ * which will reset the timers and at any time can destroy the timer.
+ */
+
+
+struct wlr_idle {
+ struct wl_global *wl_global;
+ struct wl_list idle_timers; // wlr_idle_timeout::link
+ struct wl_event_loop *event_loop;
+
+ struct wl_listener display_destroy;
+ struct wl_signal activity_notify;
+
+ void *data;
+};
+
+struct wlr_idle_timeout {
+ struct wl_resource *resource;
+ struct wl_list link;
+ struct wlr_seat *seat;
+
+ struct wl_event_source *idle_source;
+ bool idle_state;
+ uint32_t timeout; // milliseconds
+
+ struct wl_listener input_listener;
+ struct wl_listener seat_destroy;
+
+ void *data;
+};
+
+struct wlr_idle *wlr_idle_create(struct wl_display *display);
+
+void wlr_idle_destroy(struct wlr_idle *idle);
+
+/**
+ * Send notification to restart all timers for the given seat. Called by
+ * compositor when there is an user activity event on that seat.
+ */
+void wlr_idle_notify_activity(struct wlr_idle *idle, struct wlr_seat *seat);
+#endif
diff --git a/include/wlr/types/wlr_output.h b/include/wlr/types/wlr_output.h
index 6374ae9b..71463cb5 100644
--- a/include/wlr/types/wlr_output.h
+++ b/include/wlr/types/wlr_output.h
@@ -36,19 +36,19 @@ struct wlr_output_impl;
struct wlr_output {
const struct wlr_output_impl *impl;
struct wlr_backend *backend;
+ struct wl_display *display;
struct wl_global *wl_global;
struct wl_list wl_resources;
- uint32_t flags;
char name[16];
char make[48];
char model[16];
char serial[16];
- float scale;
- int32_t width, height;
- int32_t refresh; // mHz
int32_t phys_width, phys_height; // mm
+
+ bool enabled;
+ float scale;
enum wl_output_subpixel subpixel;
enum wl_output_transform transform;
bool needs_swap;
@@ -58,11 +58,14 @@ struct wlr_output {
// Note: some backends may have zero modes
struct wl_list modes;
struct wlr_output_mode *current_mode;
+ int32_t width, height;
+ int32_t refresh; // mHz
struct {
struct wl_signal frame;
struct wl_signal swap_buffers;
- struct wl_signal resolution;
+ struct wl_signal enable;
+ struct wl_signal mode;
struct wl_signal scale;
struct wl_signal transform;
struct wl_signal destroy;
diff --git a/include/wlr/xwayland.h b/include/wlr/xwayland.h
index b6671de1..c0135943 100644
--- a/include/wlr/xwayland.h
+++ b/include/wlr/xwayland.h
@@ -98,9 +98,12 @@ struct wlr_xwayland_surface {
char *title;
char *class;
char *instance;
- struct wlr_xwayland_surface *parent;
pid_t pid;
+ struct wl_list children; // wlr_xwayland_surface::parent_link
+ struct wlr_xwayland_surface *parent;
+ struct wl_list parent_link; // wlr_xwayland_surface::children
+
xcb_atom_t *window_type;
size_t window_type_len;