Merge branch 'macos_hide_from_tasks' of https://github.com/cfal/kitty
This commit is contained in:
@@ -228,6 +228,11 @@ macos_change_titlebar_color(PyObject *self UNUSED, PyObject *val) {
|
|||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
cocoa_set_hide_from_tasks(void) {
|
||||||
|
[NSApp setActivationPolicy:NSApplicationActivationPolicyAccessory];
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
cocoa_set_titlebar_color(void *w)
|
cocoa_set_titlebar_color(void *w)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -321,6 +321,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,
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
#include "glfw-wrapper.h"
|
#include "glfw-wrapper.h"
|
||||||
extern bool cocoa_make_window_resizable(void *w);
|
extern bool cocoa_make_window_resizable(void *w);
|
||||||
extern void cocoa_create_global_menu(void);
|
extern void cocoa_create_global_menu(void);
|
||||||
|
extern void cocoa_set_hide_from_tasks(void);
|
||||||
extern void cocoa_set_titlebar_color(void *w);
|
extern void cocoa_set_titlebar_color(void *w);
|
||||||
|
|
||||||
#if GLFW_KEY_LAST >= MAX_KEY_COUNT
|
#if GLFW_KEY_LAST >= MAX_KEY_COUNT
|
||||||
@@ -375,6 +376,8 @@ create_os_window(PyObject UNUSED *self, PyObject *args) {
|
|||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
cocoa_create_global_menu();
|
cocoa_create_global_menu();
|
||||||
if (OPT(macos_option_as_alt)) glfwSetCocoaTextInputFilter(glfw_window, filter_option);
|
if (OPT(macos_option_as_alt)) glfwSetCocoaTextInputFilter(glfw_window, filter_option);
|
||||||
|
// This needs to be done only after the first window has been created, because glfw only sets the activation policy once upon initialization.
|
||||||
|
if (OPT(macos_hide_from_tasks)) cocoa_set_hide_from_tasks();
|
||||||
#endif
|
#endif
|
||||||
is_first_window = false;
|
is_first_window = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -507,4 +507,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 no
|
||||||
# }}}
|
# }}}
|
||||||
|
|||||||
@@ -372,6 +372,7 @@ PYWRAP1(set_options) {
|
|||||||
S(close_on_child_death, PyObject_IsTrue);
|
S(close_on_child_death, PyObject_IsTrue);
|
||||||
S(macos_option_as_alt, PyObject_IsTrue);
|
S(macos_option_as_alt, PyObject_IsTrue);
|
||||||
S(macos_hide_titlebar, PyObject_IsTrue);
|
S(macos_hide_titlebar, PyObject_IsTrue);
|
||||||
|
S(macos_hide_from_tasks, PyObject_IsTrue);
|
||||||
|
|
||||||
PyObject *chars = PyObject_GetAttrString(opts, "select_by_word_characters");
|
PyObject *chars = PyObject_GetAttrString(opts, "select_by_word_characters");
|
||||||
if (chars == NULL) return NULL;
|
if (chars == NULL) return NULL;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ typedef struct {
|
|||||||
color_type url_color, background, active_border_color, inactive_border_color;
|
color_type url_color, background, active_border_color, inactive_border_color;
|
||||||
double repaint_delay, input_delay;
|
double repaint_delay, input_delay;
|
||||||
bool focus_follows_mouse;
|
bool focus_follows_mouse;
|
||||||
bool macos_option_as_alt, macos_hide_titlebar;
|
bool macos_option_as_alt, macos_hide_titlebar, macos_hide_from_tasks;
|
||||||
int adjust_line_height_px, adjust_column_width_px;
|
int adjust_line_height_px, adjust_column_width_px;
|
||||||
float adjust_line_height_frac, adjust_column_width_frac;
|
float adjust_line_height_frac, adjust_column_width_frac;
|
||||||
float background_opacity;
|
float background_opacity;
|
||||||
|
|||||||
Reference in New Issue
Block a user