diff options
Diffstat (limited to 'render.c')
| -rw-r--r-- | render.c | 24 |
1 files changed, 20 insertions, 4 deletions
@@ -80,10 +80,26 @@ void render_frame(struct swaylock_surface *surface) { int new_width = buffer_diameter; int new_height = buffer_diameter; - int subsurf_xpos = surface->width / 2 - - buffer_width / (2 * surface->scale) + 2 / surface->scale; - int subsurf_ypos = surface->height / 2 - - (state->args.radius + state->args.thickness); + int subsurf_xpos; + int subsurf_ypos; + + // Center the indicator unless overridden by the user + if (state->args.override_indicator_x_position) { + subsurf_xpos = state->args.indicator_x_position - + buffer_width / (2 * surface->scale) + 2 / surface->scale; + } else { + subsurf_xpos = surface->width / 2 - + buffer_width / (2 * surface->scale) + 2 / surface->scale; + } + + if (state->args.override_indicator_y_position) { + subsurf_ypos = state->args.indicator_y_position - + (state->args.radius + state->args.thickness); + } else { + subsurf_ypos = surface->height / 2 - + (state->args.radius + state->args.thickness); + } + wl_subsurface_set_position(surface->subsurface, subsurf_xpos, subsurf_ypos); surface->current_buffer = get_next_buffer(state->shm, |
