aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorFurkan Sahin <furkan-dev@proton.me>2019-02-10 16:56:57 -0800
committerFurkan Sahin <furkan-dev@proton.me>2019-02-10 16:56:57 -0800
commit5fffb7cf80becae6c6475b1d5d350f46de51aafd (patch)
tree6a8b5b2204624848edb0b37ecfad8c7764bd2633 /common
parent6545281d99449ef186880498a1bbfdcf4517e219 (diff)
Add support for manually setting subpixel hinting on outputs.
Many laptop screens report unknown subpixel order. Allow users to manually set subpixel hinting to work around this. Addresses https://github.com/swaywm/sway/issues/3163
Diffstat (limited to 'common')
-rw-r--r--common/util.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/common/util.c b/common/util.c
index edbbf3f7..c43c5ddf 100644
--- a/common/util.c
+++ b/common/util.c
@@ -4,6 +4,7 @@
#include <stdlib.h>
#include <string.h>
#include <strings.h>
+#include <wayland-server-protocol.h>
#include "log.h"
#include "util.h"
@@ -54,3 +55,23 @@ float parse_float(const char *value) {
}
return flt;
}
+
+
+const char *sway_wl_output_subpixel_to_string(enum wl_output_subpixel subpixel) {
+ switch (subpixel) {
+ case WL_OUTPUT_SUBPIXEL_UNKNOWN:
+ return "unknown";
+ case WL_OUTPUT_SUBPIXEL_NONE:
+ return "none";
+ case WL_OUTPUT_SUBPIXEL_HORIZONTAL_RGB:
+ return "rgb";
+ case WL_OUTPUT_SUBPIXEL_HORIZONTAL_BGR:
+ return "bgr";
+ case WL_OUTPUT_SUBPIXEL_VERTICAL_RGB:
+ return "vrgb";
+ case WL_OUTPUT_SUBPIXEL_VERTICAL_BGR:
+ return "vbgr";
+ }
+ sway_assert(false, "Unknown value for wl_output_subpixel.");
+ return NULL;
+}