diff --git a/docs/changelog.rst b/docs/changelog.rst index 460ff3967..6700c7ccc 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -47,7 +47,10 @@ Changelog - macOS: Fix the new OS window keyboard shortcut (:sc:`new_os_window`) not working if no kitty window currently has focus. (:iss:`524`) -- Add a config option to set the EDITOR kitty uses (:iss:`580`) +- Add a config option (:opt:`editor`) to set the EDITOR kitty uses (:iss:`580`) + +- Add a config option (:opt:`x11_hide_window_decorations`) to hide window + decorations under X11/Wayland (:iss:`607`) - Add an option to @set-window-title to make the title change non-permanent (:iss:`592`) diff --git a/kitty/config_data.py b/kitty/config_data.py index 51167e05d..098835fc0 100644 --- a/kitty/config_data.py +++ b/kitty/config_data.py @@ -656,6 +656,14 @@ probably better off just hiding the titlebar with :opt:`macos_hide_titlebar`. o('macos_hide_titlebar', False, long_text=_(''' Hide the kitty window's title bar on macOS.''')) + +o('x11_hide_window_decorations', False, long_text=_(''' +Hide the window decorations (title bar and window borders) on X11 and Wayland. +Whether this works and exactly what effect it has depends on the window +manager, as it is the job of the window manager/compositor to draw window +decorations.''')) + + o('macos_option_as_alt', True, long_text=_(''' Use the option key as an alt key. With this set to no, kitty will use the macOS native :kbd:`Option+Key` = unicode character behavior. This will diff --git a/kitty/glfw.c b/kitty/glfw.c index ca10b6ba1..01816f65b 100644 --- a/kitty/glfw.c +++ b/kitty/glfw.c @@ -378,6 +378,9 @@ create_os_window(PyObject UNUSED *self, PyObject *args) { #ifndef __APPLE__ glfwWindowHintString(GLFW_X11_INSTANCE_NAME, wm_class_name); glfwWindowHintString(GLFW_X11_CLASS_NAME, wm_class_class); + if (OPT(x11_hide_window_decorations)) { + glfwWindowHint(GLFW_DECORATED, GLFW_TRUE); + } #endif if (global_state.num_os_windows >= MAX_CHILDREN) { diff --git a/kitty/state.c b/kitty/state.c index c0b946166..f752c23d5 100644 --- a/kitty/state.c +++ b/kitty/state.c @@ -385,6 +385,7 @@ PYWRAP1(set_options) { S(window_alert_on_bell, PyObject_IsTrue); S(macos_option_as_alt, PyObject_IsTrue); S(macos_hide_titlebar, PyObject_IsTrue); + S(x11_hide_window_decorations, PyObject_IsTrue); S(macos_hide_from_tasks, PyObject_IsTrue); PyObject *chars = PyObject_GetAttrString(opts, "select_by_word_characters"); diff --git a/kitty/state.h b/kitty/state.h index bbea93059..663c5885b 100644 --- a/kitty/state.h +++ b/kitty/state.h @@ -23,7 +23,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; - bool macos_option_as_alt, macos_hide_titlebar, macos_hide_from_tasks; + bool macos_option_as_alt, macos_hide_titlebar, macos_hide_from_tasks, x11_hide_window_decorations; int adjust_line_height_px, adjust_column_width_px; float adjust_line_height_frac, adjust_column_width_frac; float background_opacity, dim_opacity;