From 8195533bb3736fc02b0ce913a85eab3561e0eed0 Mon Sep 17 00:00:00 2001 From: Tin Date: Tue, 7 Nov 2023 23:06:34 +0100 Subject: [PATCH] Fix lua stack pops in one of error branches Remove some code added by accident; reduce change list. Fix mouse_enter and mouse_leave events. Signed-off-by: Tin --- src/conky.cc | 2 +- src/display-wayland.cc | 5 +++-- src/llua.cc | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/conky.cc b/src/conky.cc index 456ace0a..b316b18f 100644 --- a/src/conky.cc +++ b/src/conky.cc @@ -157,7 +157,7 @@ const char builtin_config_magic[] = "==builtin=="; #undef SIGNAL_BLOCKING /* debugging level, used by logging.h */ -int global_debug_level = 2; +int global_debug_level = 0; /* disable inotify auto reload feature if desired */ static conky::simple_config_setting disable_auto_reload( diff --git a/src/display-wayland.cc b/src/display-wayland.cc index d9afc950..5b242ffc 100644 --- a/src/display-wayland.cc +++ b/src/display-wayland.cc @@ -451,6 +451,7 @@ static void on_pointer_enter(void *data, wl_pointer *pointer, uint32_t serial, abs_x, abs_y }; + llua_mouse_hook(event); } static void on_pointer_leave(void *data, @@ -472,6 +473,7 @@ static void on_pointer_leave(void *data, abs_x, abs_y }; + llua_mouse_hook(event); } static void on_pointer_motion(void *data, @@ -628,7 +630,6 @@ bool display_output_wayland::initialize() { wl_seat_add_listener(wl_globals.seat, &listener, global_window); #endif /* BUILD_MOUSE_EVENTS */ - wl_surface_set_buffer_scale(global_window->surface, global_window->scale); wl_surface_commit(global_window->surface); wl_display_roundtrip(global_display); wayland_create_window(); @@ -1262,7 +1263,7 @@ struct window *window_create(struct wl_surface *surface, struct wl_shm *shm, window->rectangle.y = 0; window->rectangle.width = width; window->rectangle.height = height; - window->scale = 1; + window->scale = 0; window->pending_scale = 1; window->surface = surface; diff --git a/src/llua.cc b/src/llua.cc index ee686e83..8af794b0 100644 --- a/src/llua.cc +++ b/src/llua.cc @@ -531,7 +531,7 @@ bool llua_mouse_hook(const EventT &ev) { lua_pop(lua_L, 1); } else { NORM_ERR("llua_mouse_hook: hook %s is not defined", hook_name.c_str()); - lua_pop(lua_L, 1); + lua_pop(lua_L, 2); return false; } } else if (ty != LUA_TFUNCTION) {