From a92b20f85a2b08f8024e9c6879150160cdf2a6d4 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 7 Aug 2018 07:56:56 +0530 Subject: [PATCH] Only do manual focus follows mouse on macOS --- docs/changelog.rst | 2 +- kitty/mouse.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 571d1bc78..1ce7953fb 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -40,7 +40,7 @@ Changelog - kitty @ new-window: Add a new option :option:`kitty @ new-window --window-type` to create top-level OS windows (:iss:`770`) -- The :opt:`focus_follows_mouse` option now also works across top-level kitty OS windows +- macOS: The :opt:`focus_follows_mouse` option now also works across top-level kitty OS windows (:iss:`754`) - Fix detection of URLs in HTML source code (URLs inside quotes) (:iss:`785`) diff --git a/kitty/mouse.c b/kitty/mouse.c index 94ef5a916..0c53116f2 100644 --- a/kitty/mouse.c +++ b/kitty/mouse.c @@ -478,9 +478,13 @@ focus_in_event() { void enter_event() { +#ifdef __APPLE__ + // On cocoa there is no way to configure the window manager to + // focus windows on mouse enter, so we do it ourselves if (OPT(focus_follows_mouse) && !global_state.callback_os_window->is_focused) { focus_os_window(global_state.callback_os_window, false); } +#endif } void