diff options
author | Erik Reider <[email protected]> | 2023-12-30 11:25:16 +0100 |
---|---|---|
committer | Erik Reider <[email protected]> | 2024-01-02 11:21:58 +0100 |
commit | 0b52aa9d137b03017313e028accc92dc5d536440 (patch) | |
tree | 06649993526e0a339fff34f0ae8b4c8ec2fa4d13 /types/output | |
parent | b929a2bbadf467864796ad4ec90882ce86cfebff (diff) |
Initial rebase without effects
Diffstat (limited to 'types/output')
-rw-r--r-- | types/output/wlr_output.c | 24 |
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; + } +} |