Fix fake scroll when scrolling in unfocused kitty window
Scrolling should happen in the kitty window under the mouse cursor, not in the currently active kitty window.
This commit is contained in:
parent
04b6bf3b74
commit
85fe783652
@ -303,7 +303,6 @@ void enter_event(void);
|
||||
void mouse_event(int, int, int);
|
||||
void focus_in_event(void);
|
||||
void scroll_event(double, double, int, int);
|
||||
void fake_scroll(int, bool);
|
||||
void set_special_key_combo(int glfw_key, int mods, bool is_native);
|
||||
void on_key_input(GLFWkeyevent *ev);
|
||||
void request_window_attention(id_type, bool);
|
||||
|
||||
@ -203,8 +203,7 @@ on_key_input(GLFWkeyevent *ev) {
|
||||
}
|
||||
|
||||
void
|
||||
fake_scroll(int amount, bool upwards) {
|
||||
Window *w = active_window();
|
||||
fake_scroll(Window *w, int amount, bool upwards) {
|
||||
if (!w) return;
|
||||
int key = upwards ? GLFW_KEY_UP : GLFW_KEY_DOWN;
|
||||
while (amount-- > 0) {
|
||||
|
||||
@ -698,7 +698,7 @@ scroll_event(double UNUSED xoffset, double yoffset, int flags, int modifiers) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
fake_scroll(abs(s), upwards);
|
||||
fake_scroll(w, abs(s), upwards);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -277,3 +277,4 @@ void stop_main_loop(void);
|
||||
void os_window_update_size_increments(OSWindow *window);
|
||||
void set_os_window_title_from_window(Window *w, OSWindow *os_window);
|
||||
void update_os_window_title(OSWindow *os_window);
|
||||
void fake_scroll(Window *w, int amount, bool upwards);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user