opt: optimzie func name

This commit is contained in:
DreamMaoMao 2025-09-17 12:04:10 +08:00
parent 50e4a49c2e
commit 13e90496ef
2 changed files with 10 additions and 9 deletions

View file

@ -2737,8 +2737,8 @@ void reapply_monitor_rules(void) {
} }
if (mr->width > 0 && mr->height > 0 && mr->refresh > 0) { if (mr->width > 0 && mr->height > 0 && mr->refresh > 0) {
internal_mode = get_output_mode(m->wlr_output, mr->width, internal_mode = get_nearest_output_mode(
mr->height, mr->refresh); m->wlr_output, mr->width, mr->height, mr->refresh);
if (internal_mode) { if (internal_mode) {
wlr_output_state_set_mode(&state, internal_mode); wlr_output_state_set_mode(&state, internal_mode);
} else if (wlr_output_is_headless(m->wlr_output)) { } else if (wlr_output_is_headless(m->wlr_output)) {

View file

@ -641,9 +641,9 @@ static struct wlr_box setclient_coordinate_center(Client *c,
int offsetx, int offsety); int offsetx, int offsety);
static unsigned int get_tags_first_tag(unsigned int tags); static unsigned int get_tags_first_tag(unsigned int tags);
static struct wlr_output_mode *get_output_mode(struct wlr_output *output, static struct wlr_output_mode *
int width, int height, get_nearest_output_mode(struct wlr_output *output, int width, int height,
float refresh); float refresh);
static void client_commit(Client *c); static void client_commit(Client *c);
static void layer_commit(LayerSurface *l); static void layer_commit(LayerSurface *l);
@ -2504,8 +2504,9 @@ void createlocksurface(struct wl_listener *listener, void *data) {
client_notify_enter(lock_surface->surface, wlr_seat_get_keyboard(seat)); client_notify_enter(lock_surface->surface, wlr_seat_get_keyboard(seat));
} }
struct wlr_output_mode *get_output_mode(struct wlr_output *output, int width, struct wlr_output_mode *get_nearest_output_mode(struct wlr_output *output,
int height, float refresh) { int width, int height,
float refresh) {
struct wlr_output_mode *mode, *nearest_mode = NULL; struct wlr_output_mode *mode, *nearest_mode = NULL;
float min_diff = 99999.0f; float min_diff = 99999.0f;
@ -2586,8 +2587,8 @@ void createmon(struct wl_listener *listener, void *data) {
rr = r->rr; rr = r->rr;
if (r->width > 0 && r->height > 0 && r->refresh > 0) { if (r->width > 0 && r->height > 0 && r->refresh > 0) {
internal_mode = get_output_mode(m->wlr_output, r->width, internal_mode = get_nearest_output_mode(m->wlr_output, r->width,
r->height, r->refresh); r->height, r->refresh);
if (internal_mode) { if (internal_mode) {
custom_monitor_mode = true; custom_monitor_mode = true;
wlr_output_state_set_mode(&state, internal_mode); wlr_output_state_set_mode(&state, internal_mode);