Merge branch 'fake_scroll_correct_window' of https://github.com/Luflosi/kitty

This commit is contained in:
Kovid Goyal 2020-06-05 20:20:40 +05:30
commit 24ca919f33
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
4 changed files with 3 additions and 4 deletions

View File

@ -303,7 +303,6 @@ void enter_event(void);
void mouse_event(int, int, int); void mouse_event(int, int, int);
void focus_in_event(void); void focus_in_event(void);
void scroll_event(double, double, int, int); 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 set_special_key_combo(int glfw_key, int mods, bool is_native);
void on_key_input(GLFWkeyevent *ev); void on_key_input(GLFWkeyevent *ev);
void request_window_attention(id_type, bool); void request_window_attention(id_type, bool);

View File

@ -203,8 +203,7 @@ on_key_input(GLFWkeyevent *ev) {
} }
void void
fake_scroll(int amount, bool upwards) { fake_scroll(Window *w, int amount, bool upwards) {
Window *w = active_window();
if (!w) return; if (!w) return;
int key = upwards ? GLFW_KEY_UP : GLFW_KEY_DOWN; int key = upwards ? GLFW_KEY_UP : GLFW_KEY_DOWN;
while (amount-- > 0) { while (amount-- > 0) {

View File

@ -698,7 +698,7 @@ scroll_event(double UNUSED xoffset, double yoffset, int flags, int modifiers) {
} }
} }
} else { } else {
fake_scroll(abs(s), upwards); fake_scroll(w, abs(s), upwards);
} }
} }
} }

View File

@ -277,3 +277,4 @@ void stop_main_loop(void);
void os_window_update_size_increments(OSWindow *window); void os_window_update_size_increments(OSWindow *window);
void set_os_window_title_from_window(Window *w, OSWindow *os_window); void set_os_window_title_from_window(Window *w, OSWindow *os_window);
void update_os_window_title(OSWindow *os_window); void update_os_window_title(OSWindow *os_window);
void fake_scroll(Window *w, int amount, bool upwards);