From 6669325faed2f71dd61844f177e22b40dc27ea69 Mon Sep 17 00:00:00 2001 From: TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> Date: Sun, 30 Nov 2025 20:50:04 +0900 Subject: modified slock/slock.c --- slock/slock.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/slock/slock.c b/slock/slock.c index 86be711..f7af3c8 100644 --- a/slock/slock.c +++ b/slock/slock.c @@ -349,8 +349,9 @@ refresh(Display *dpy, Window win , int screen, struct tm time, cairo_t* cr, cair text_width = extents.width; text_height = extents.height; - xpos = DisplayWidth(dpy, screen) / 4 - text_width / 2; - ypos = (DisplayHeight(dpy, screen) + 12 * text_height) / 2; + /* Center text horizontally and vertically based on text center point */ + xpos = (DisplayWidth(dpy, screen) / 2) - (text_width / 2) - extents.x_bearing; + ypos = (DisplayHeight(dpy, screen) / 2) - (text_height / 2) - extents.y_bearing; cairo_move_to(cr, xpos, ypos); cairo_show_text(cr, tm); cairo_surface_flush(sfc); -- cgit v1.2.3