diff options
| author | Furkan Sahin <furkan-dev@proton.me> | 2020-05-28 03:36:38 -0400 |
|---|---|---|
| committer | Furkan Sahin <furkan-dev@proton.me> | 2020-05-28 03:36:38 -0400 |
| commit | f3b0358251efb85fbf569197f782c0da5d98ade0 (patch) | |
| tree | 3ffbb663d571f9d881cab31cc6bc8363bbe01b79 | |
| parent | 97ab14fa3a81fef95e1c47859fc6a2aa986a0609 (diff) | |
ipc: invert output transformation when necessary
After swaywm/wlroots#2023, #4996 inverted configuration transformations.
For consistency, we should undo (double-apply) the inversion when
communicating via IPC.
Closes #5356.
| -rw-r--r-- | sway/ipc-json.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sway/ipc-json.c b/sway/ipc-json.c index 67f0eed7..c2e43f6e 100644 --- a/sway/ipc-json.c +++ b/sway/ipc-json.c @@ -68,19 +68,24 @@ static const char *ipc_json_output_transform_description(enum wl_output_transfor case WL_OUTPUT_TRANSFORM_NORMAL: return "normal"; case WL_OUTPUT_TRANSFORM_90: - return "90"; + // Sway uses clockwise transforms, while WL_OUTPUT_TRANSFORM_* describes + // anti-clockwise transforms. + return "270"; case WL_OUTPUT_TRANSFORM_180: return "180"; case WL_OUTPUT_TRANSFORM_270: - return "270"; + // Transform also inverted here. + return "90"; case WL_OUTPUT_TRANSFORM_FLIPPED: return "flipped"; case WL_OUTPUT_TRANSFORM_FLIPPED_90: - return "flipped-90"; + // Inverted. + return "flipped-270"; case WL_OUTPUT_TRANSFORM_FLIPPED_180: return "flipped-180"; case WL_OUTPUT_TRANSFORM_FLIPPED_270: - return "flipped-270"; + // Inverted. + return "flipped-90"; } return NULL; } |
