summaryrefslogtreecommitdiff
path: root/types/output/wlr_output.c
diff options
context:
space:
mode:
authorErik Reider <[email protected]>2024-01-06 02:31:14 +0100
committerGitHub <[email protected]>2024-01-06 02:31:14 +0100
commit6759e8da7ab53a46b0eb04e5045b8c67262c3a11 (patch)
treec65ed83ca04b61bdbae7e1b8a7f2c16f29b89730 /types/output/wlr_output.c
parentb929a2bbadf467864796ad4ec90882ce86cfebff (diff)
parentace97585b2b4d8cbb5ead6cd0f72fa8e8889c9d7 (diff)
Merge pull request #24 from wlrfx/wlroots-0.17-rebase
Rebase to wlroots 0.17
Diffstat (limited to 'types/output/wlr_output.c')
-rw-r--r--types/output/wlr_output.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/types/output/wlr_output.c b/types/output/wlr_output.c
new file mode 100644
index 0000000..43325cf
--- /dev/null
+++ b/types/output/wlr_output.c
@@ -0,0 +1,24 @@
+#define _POSIX_C_SOURCE 200809L
+#include <stdlib.h>
+
+#include "types/wlr_output.h"
+
+void output_pending_resolution(struct wlr_output *output,
+ const struct wlr_output_state *state, int *width, int *height) {
+ if (state->committed & WLR_OUTPUT_STATE_MODE) {
+ switch (state->mode_type) {
+ case WLR_OUTPUT_STATE_MODE_FIXED:
+ *width = state->mode->width;
+ *height = state->mode->height;
+ return;
+ case WLR_OUTPUT_STATE_MODE_CUSTOM:
+ *width = state->custom_mode.width;
+ *height = state->custom_mode.height;
+ return;
+ }
+ abort();
+ } else {
+ *width = output->width;
+ *height = output->height;
+ }
+}