summaryrefslogtreecommitdiffstats
path: root/swaylock
diff options
context:
space:
mode:
authorLibravatar Geoff Greer <geoff@greer.fm>2018-09-20 20:37:08 -0700
committerLibravatar Geoff Greer <geoff@greer.fm>2018-09-22 11:34:21 -0700
commitc495164f6059d8f352afeead86a510365cc802a1 (patch)
treeee7316a573d5feb5332bb5cef509bd37faf5bcf7 /swaylock
parentMerge pull request #2660 from RyanDwyer/fix-scratchpad-iteration (diff)
downloadsway-c495164f6059d8f352afeead86a510365cc802a1.tar.gz
sway-c495164f6059d8f352afeead86a510365cc802a1.tar.zst
sway-c495164f6059d8f352afeead86a510365cc802a1.zip
swaybar, swaylock, & tree/container: Set cairo font options to render text and lines with subpixel hinting (if available).
Diffstat (limited to 'swaylock')
-rw-r--r--swaylock/main.c8
-rw-r--r--swaylock/render.c7
2 files changed, 13 insertions, 2 deletions
diff --git a/swaylock/main.c b/swaylock/main.c
index 668a8742..c25c8eec 100644
--- a/swaylock/main.c
+++ b/swaylock/main.c
@@ -195,11 +195,15 @@ void damage_state(struct swaylock_state *state) {
195 } 195 }
196} 196}
197 197
198static void handle_wl_output_geometry(void *data, struct wl_output *output, 198static void handle_wl_output_geometry(void *data, struct wl_output *wl_output,
199 int32_t x, int32_t y, int32_t width_mm, int32_t height_mm, 199 int32_t x, int32_t y, int32_t width_mm, int32_t height_mm,
200 int32_t subpixel, const char *make, const char *model, 200 int32_t subpixel, const char *make, const char *model,
201 int32_t transform) { 201 int32_t transform) {
202 // Who cares 202 struct swaylock_surface *surface = data;
203 surface->subpixel = subpixel;
204 if (surface->state->run_display) {
205 damage_surface(surface);
206 }
203} 207}
204 208
205static void handle_wl_output_mode(void *data, struct wl_output *output, 209static void handle_wl_output_mode(void *data, struct wl_output *output,
diff --git a/swaylock/render.c b/swaylock/render.c
index 66c55965..fa8832bd 100644
--- a/swaylock/render.c
+++ b/swaylock/render.c
@@ -39,6 +39,13 @@ void render_frame(struct swaylock_surface *surface) {
39 } 39 }
40 40
41 cairo_t *cairo = surface->current_buffer->cairo; 41 cairo_t *cairo = surface->current_buffer->cairo;
42 cairo_set_antialias(cairo, CAIRO_ANTIALIAS_BEST);
43 cairo_font_options_t *fo = cairo_font_options_create();
44 cairo_font_options_set_hint_style(fo, CAIRO_HINT_STYLE_FULL);
45 cairo_font_options_set_antialias(fo, CAIRO_ANTIALIAS_SUBPIXEL);
46 cairo_font_options_set_subpixel_order(fo, to_cairo_subpixel_order(surface->subpixel));
47 cairo_set_font_options(cairo, fo);
48 cairo_font_options_destroy(fo);
42 cairo_identity_matrix(cairo); 49 cairo_identity_matrix(cairo);
43 50
44 cairo_save(cairo); 51 cairo_save(cairo);