aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-09-14 21:14:18 -0400
committerGitHub <noreply@github.com>2018-09-14 21:14:18 -0400
commitdf991a55ab23017d4c5d90d344d472e904dc682f (patch)
treeb1c1ab11c651f0ec614446244bf29e371e6aa898 /include
parent0210905eef94216c42a070b638c6f3e6d81512e2 (diff)
parentcb293f09e774d179cdd3d9351a2834d473fd823c (diff)
Merge pull request #1241 from emersion/output-enable-error-checking
output: make wlr_output_enable return a bool
Diffstat (limited to 'include')
-rw-r--r--include/backend/drm/drm.h2
-rw-r--r--include/wlr/interfaces/wlr_output.h2
-rw-r--r--include/wlr/types/wlr_output.h8
3 files changed, 8 insertions, 4 deletions
diff --git a/include/backend/drm/drm.h b/include/backend/drm/drm.h
index fe279917..25225227 100644
--- a/include/backend/drm/drm.h
+++ b/include/backend/drm/drm.h
@@ -143,6 +143,6 @@ void finish_drm_resources(struct wlr_drm_backend *drm);
void restore_drm_outputs(struct wlr_drm_backend *drm);
void scan_drm_connectors(struct wlr_drm_backend *state);
int handle_drm_event(int fd, uint32_t mask, void *data);
-void enable_drm_connector(struct wlr_output *output, bool enable);
+bool enable_drm_connector(struct wlr_output *output, bool enable);
#endif
diff --git a/include/wlr/interfaces/wlr_output.h b/include/wlr/interfaces/wlr_output.h
index 4860a5b6..4cbf0d67 100644
--- a/include/wlr/interfaces/wlr_output.h
+++ b/include/wlr/interfaces/wlr_output.h
@@ -15,7 +15,7 @@
#include <wlr/types/wlr_output.h>
struct wlr_output_impl {
- void (*enable)(struct wlr_output *output, bool enable);
+ bool (*enable)(struct wlr_output *output, bool enable);
bool (*set_mode)(struct wlr_output *output, struct wlr_output_mode *mode);
bool (*set_custom_mode)(struct wlr_output *output, int32_t width,
int32_t height, int32_t refresh);
diff --git a/include/wlr/types/wlr_output.h b/include/wlr/types/wlr_output.h
index 3a9f3c41..ded57959 100644
--- a/include/wlr/types/wlr_output.h
+++ b/include/wlr/types/wlr_output.h
@@ -124,11 +124,15 @@ struct wlr_output_event_swap_buffers {
struct wlr_surface;
-void wlr_output_enable(struct wlr_output *output, bool enable);
+/**
+ * Enables or disables the output. A disabled output is turned off and doesn't
+ * emit `frame` events.
+ */
+bool wlr_output_enable(struct wlr_output *output, bool enable);
void wlr_output_create_global(struct wlr_output *output);
void wlr_output_destroy_global(struct wlr_output *output);
/**
- * Sets the output mode.
+ * Sets the output mode. Enables the output if it's currently disabled.
*/
bool wlr_output_set_mode(struct wlr_output *output,
struct wlr_output_mode *mode);