mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-18 06:25:13 +02:00
Add macos_hide_from_tasks option
This commit is contained in:
@@ -228,6 +228,12 @@ macos_change_titlebar_color(PyObject *self UNUSED, PyObject *val) {
|
|||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static PyObject*
|
||||||
|
macos_set_hide_from_tasks(PyObject *self UNUSED, PyObject *val UNUSED) {
|
||||||
|
[NSApp setActivationPolicy:NSApplicationActivationPolicyAccessory];
|
||||||
|
Py_RETURN_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
cocoa_set_titlebar_color(void *w)
|
cocoa_set_titlebar_color(void *w)
|
||||||
{
|
{
|
||||||
@@ -260,6 +266,7 @@ static PyMethodDef module_methods[] = {
|
|||||||
{"cocoa_get_lang", (PyCFunction)cocoa_get_lang, METH_NOARGS, ""},
|
{"cocoa_get_lang", (PyCFunction)cocoa_get_lang, METH_NOARGS, ""},
|
||||||
{"cwd_of_process", (PyCFunction)cwd_of_process, METH_O, ""},
|
{"cwd_of_process", (PyCFunction)cwd_of_process, METH_O, ""},
|
||||||
{"macos_change_titlebar_color", (PyCFunction)macos_change_titlebar_color, METH_O, ""},
|
{"macos_change_titlebar_color", (PyCFunction)macos_change_titlebar_color, METH_O, ""},
|
||||||
|
{"macos_set_hide_from_tasks", (PyCFunction)macos_set_hide_from_tasks, METH_NOARGS, ""},
|
||||||
{NULL, NULL, 0, NULL} /* Sentinel */
|
{NULL, NULL, 0, NULL} /* Sentinel */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -318,6 +318,7 @@ type_map = {
|
|||||||
'initial_window_width': positive_int,
|
'initial_window_width': positive_int,
|
||||||
'initial_window_height': positive_int,
|
'initial_window_height': positive_int,
|
||||||
'macos_hide_titlebar': to_bool,
|
'macos_hide_titlebar': to_bool,
|
||||||
|
'macos_hide_from_tasks': to_bool,
|
||||||
'macos_option_as_alt': to_bool,
|
'macos_option_as_alt': to_bool,
|
||||||
'macos_titlebar_color': macos_titlebar_color,
|
'macos_titlebar_color': macos_titlebar_color,
|
||||||
'box_drawing_scale': box_drawing_scale,
|
'box_drawing_scale': box_drawing_scale,
|
||||||
|
|||||||
@@ -499,4 +499,7 @@ macos_hide_titlebar no
|
|||||||
# break any Alt+key keyboard shortcuts in your terminal programs, but you
|
# break any Alt+key keyboard shortcuts in your terminal programs, but you
|
||||||
# can use the macOS unicode input technique.
|
# can use the macOS unicode input technique.
|
||||||
macos_option_as_alt yes
|
macos_option_as_alt yes
|
||||||
|
|
||||||
|
# Hide the kitty window from running tasks (alt-tab) on macOS.
|
||||||
|
macos_hide_from_tasks yes
|
||||||
# }}}
|
# }}}
|
||||||
|
|||||||
@@ -45,6 +45,10 @@ def run_app(opts, args):
|
|||||||
with cached_values_for('main') as cached_values:
|
with cached_values_for('main') as cached_values:
|
||||||
w, h = initial_window_size(opts, cached_values)
|
w, h = initial_window_size(opts, cached_values)
|
||||||
window_id = create_os_window(w, h, appname, args.name or args.cls or appname, args.cls or appname, load_all_shaders)
|
window_id = create_os_window(w, h, appname, args.name or args.cls or appname, args.cls or appname, load_all_shaders)
|
||||||
|
if is_macos and opts.macos_hide_from_tasks:
|
||||||
|
from .fast_data_types import macos_set_hide_from_tasks
|
||||||
|
# This needs to be done after creating the OS window as glfw sets the activation policy as well.
|
||||||
|
macos_set_hide_from_tasks()
|
||||||
startup_ctx = init_startup_notification(window_id)
|
startup_ctx = init_startup_notification(window_id)
|
||||||
show_window(window_id)
|
show_window(window_id)
|
||||||
if not is_wayland and not is_macos: # no window icons on wayland
|
if not is_wayland and not is_macos: # no window icons on wayland
|
||||||
|
|||||||
Reference in New Issue
Block a user