diff --git a/docs/changelog.rst b/docs/changelog.rst index 760bccf04..34f42796c 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -13,6 +13,9 @@ Changelog - macOS: Fix :kbd:`cmd+period` key not working (:iss:`1318`) +- macOS: Add an option :opt:`macos_show_window_title_in_menubar` to not + show the current window title in the menu-bar (:iss:`1066`) + - Fix using remote control to set cursor text color causing errors when creating new windows (:iss:`1326`) diff --git a/kitty/child-monitor.c b/kitty/child-monitor.c index 6bc1d7656..4cd29d16e 100644 --- a/kitty/child-monitor.c +++ b/kitty/child-monitor.c @@ -547,7 +547,7 @@ update_window_title(Window *w, OSWindow *os_window) { Py_INCREF(os_window->window_title); set_os_window_title(os_window, PyUnicode_AsUTF8(w->title)); #ifdef __APPLE__ - if (os_window->is_focused) cocoa_update_title(w->title); + if (os_window->is_focused && OPT(macos_show_window_title_in_menubar)) cocoa_update_title(w->title); #endif return true; } diff --git a/kitty/config_data.py b/kitty/config_data.py index 07be6a170..30ef55ede 100644 --- a/kitty/config_data.py +++ b/kitty/config_data.py @@ -831,6 +831,10 @@ o('macos_traditional_fullscreen', False, long_text=_(''' Use the traditional full-screen transition, that is faster, but less pretty. ''')) +o('macos_show_window_title_in_menubar', True, long_text=_(''' +Show the title of the currently active window in the macOS +menu-bar, making use of otherwise wasted space.''')) + # Disabled by default because of https://github.com/kovidgoyal/kitty/issues/794 o('macos_custom_beam_cursor', False, long_text=_(''' Enable/disable custom mouse cursor for macOS that is easier to see on both diff --git a/kitty/state.c b/kitty/state.c index 51d38972d..ad6fd7868 100644 --- a/kitty/state.c +++ b/kitty/state.c @@ -391,6 +391,7 @@ PYWRAP1(set_options) { S(macos_option_as_alt, PyObject_IsTrue); S(macos_traditional_fullscreen, PyObject_IsTrue); S(macos_quit_when_last_window_closed, PyObject_IsTrue); + S(macos_show_window_title_in_menubar, PyObject_IsTrue); S(macos_window_resizable, PyObject_IsTrue); S(macos_hide_from_tasks, PyObject_IsTrue); S(macos_thicken_font, PyFloat_AsDouble); diff --git a/kitty/state.h b/kitty/state.h index 19b648646..062b91919 100644 --- a/kitty/state.h +++ b/kitty/state.h @@ -24,7 +24,7 @@ typedef struct { color_type url_color, background, active_border_color, inactive_border_color, bell_border_color; double repaint_delay, input_delay; bool focus_follows_mouse, hide_window_decorations; - bool macos_option_as_alt, macos_hide_from_tasks, macos_quit_when_last_window_closed, macos_window_resizable, macos_traditional_fullscreen; + bool macos_option_as_alt, macos_hide_from_tasks, macos_quit_when_last_window_closed, macos_window_resizable, macos_traditional_fullscreen, macos_show_window_title_in_menubar; float macos_thicken_font; int adjust_line_height_px, adjust_column_width_px; float adjust_line_height_frac, adjust_column_width_frac;