diff options
author | Geoff Greer <geoff@greer.fm> | 2019-02-10 16:56:57 -0800 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2019-03-24 09:37:24 +0200 |
commit | 6e3046878d4dced3f2e503973ad31d7921c0c400 (patch) | |
tree | 6a8b5b2204624848edb0b37ecfad8c7764bd2633 /common/util.c | |
parent | Allow for workspace renaming during exec handling (diff) | |
download | sway-6e3046878d4dced3f2e503973ad31d7921c0c400.tar.gz sway-6e3046878d4dced3f2e503973ad31d7921c0c400.tar.zst sway-6e3046878d4dced3f2e503973ad31d7921c0c400.zip |
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/util.c')
-rw-r--r-- | common/util.c | 21 |
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 @@ | |||
4 | #include <stdlib.h> | 4 | #include <stdlib.h> |
5 | #include <string.h> | 5 | #include <string.h> |
6 | #include <strings.h> | 6 | #include <strings.h> |
7 | #include <wayland-server-protocol.h> | ||
7 | #include "log.h" | 8 | #include "log.h" |
8 | #include "util.h" | 9 | #include "util.h" |
9 | 10 | ||
@@ -54,3 +55,23 @@ float parse_float(const char *value) { | |||
54 | } | 55 | } |
55 | return flt; | 56 | return flt; |
56 | } | 57 | } |
58 | |||
59 | |||
60 | const char *sway_wl_output_subpixel_to_string(enum wl_output_subpixel subpixel) { | ||
61 | switch (subpixel) { | ||
62 | case WL_OUTPUT_SUBPIXEL_UNKNOWN: | ||
63 | return "unknown"; | ||
64 | case WL_OUTPUT_SUBPIXEL_NONE: | ||
65 | return "none"; | ||
66 | case WL_OUTPUT_SUBPIXEL_HORIZONTAL_RGB: | ||
67 | return "rgb"; | ||
68 | case WL_OUTPUT_SUBPIXEL_HORIZONTAL_BGR: | ||
69 | return "bgr"; | ||
70 | case WL_OUTPUT_SUBPIXEL_VERTICAL_RGB: | ||
71 | return "vrgb"; | ||
72 | case WL_OUTPUT_SUBPIXEL_VERTICAL_BGR: | ||
73 | return "vbgr"; | ||
74 | } | ||
75 | sway_assert(false, "Unknown value for wl_output_subpixel."); | ||
76 | return NULL; | ||
77 | } | ||