mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-27 10:41:58 +02:00
macOS: Allow scrolling window contents using mouse wheel/trackbar even when the window is not the active window
Fixes #729
This commit is contained in:
@@ -16,6 +16,9 @@ Changelog
|
|||||||
- Add an option :opt:`env` to set environment variables in child processes
|
- Add an option :opt:`env` to set environment variables in child processes
|
||||||
from kitty.conf
|
from kitty.conf
|
||||||
|
|
||||||
|
- macOS: Allow scrolling window contents using mouse wheel/trackbar even when the
|
||||||
|
window is not the active window (:iss:`729`)
|
||||||
|
|
||||||
0.11.3 [2018-07-10]
|
0.11.3 [2018-07-10]
|
||||||
------------------------------
|
------------------------------
|
||||||
|
|
||||||
|
|||||||
@@ -501,6 +501,13 @@ scroll_event(double UNUSED xoffset, double yoffset) {
|
|||||||
bool in_tab_bar;
|
bool in_tab_bar;
|
||||||
unsigned int window_idx = 0;
|
unsigned int window_idx = 0;
|
||||||
Window *w = window_for_event(&window_idx, &in_tab_bar);
|
Window *w = window_for_event(&window_idx, &in_tab_bar);
|
||||||
|
if (!w && !in_tab_bar) {
|
||||||
|
// allow scroll events even if window is not currently focused (in
|
||||||
|
// which case on some platforms such as macOS the mouse location is zeroed so
|
||||||
|
// window_for_event() does not work).
|
||||||
|
Tab *t = global_state.callback_os_window->tabs + global_state.callback_os_window->active_tab;
|
||||||
|
if (t) w = t->windows + t->active_window;
|
||||||
|
}
|
||||||
if (w) {
|
if (w) {
|
||||||
Screen *screen = w->render_data.screen;
|
Screen *screen = w->render_data.screen;
|
||||||
if (screen->linebuf == screen->main_linebuf) {
|
if (screen->linebuf == screen->main_linebuf) {
|
||||||
|
|||||||
Reference in New Issue
Block a user