Merge branch 'macos_hide_from_tasks' of https://github.com/cfal/kitty

This commit is contained in:
Kovid Goyal 2018-04-27 08:19:32 +05:30
commit 0f06bf1bdb
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
6 changed files with 14 additions and 1 deletions

View File

@ -228,6 +228,11 @@ macos_change_titlebar_color(PyObject *self UNUSED, PyObject *val) {
Py_RETURN_NONE;
}
void
cocoa_set_hide_from_tasks(void) {
[NSApp setActivationPolicy:NSApplicationActivationPolicyAccessory];
}
void
cocoa_set_titlebar_color(void *w)
{

View File

@ -321,6 +321,7 @@ type_map = {
'initial_window_width': positive_int,
'initial_window_height': positive_int,
'macos_hide_titlebar': to_bool,
'macos_hide_from_tasks': to_bool,
'macos_option_as_alt': to_bool,
'macos_titlebar_color': macos_titlebar_color,
'box_drawing_scale': box_drawing_scale,

View File

@ -9,6 +9,7 @@
#include "glfw-wrapper.h"
extern bool cocoa_make_window_resizable(void *w);
extern void cocoa_create_global_menu(void);
extern void cocoa_set_hide_from_tasks(void);
extern void cocoa_set_titlebar_color(void *w);
#if GLFW_KEY_LAST >= MAX_KEY_COUNT
@ -375,6 +376,8 @@ create_os_window(PyObject UNUSED *self, PyObject *args) {
#ifdef __APPLE__
cocoa_create_global_menu();
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
is_first_window = false;
}

View File

@ -507,4 +507,7 @@ macos_hide_titlebar no
# break any Alt+key keyboard shortcuts in your terminal programs, but you
# can use the macOS unicode input technique.
macos_option_as_alt yes
# Hide the kitty window from running tasks (alt-tab) on macOS.
macos_hide_from_tasks no
# }}}

View File

@ -372,6 +372,7 @@ PYWRAP1(set_options) {
S(close_on_child_death, PyObject_IsTrue);
S(macos_option_as_alt, PyObject_IsTrue);
S(macos_hide_titlebar, PyObject_IsTrue);
S(macos_hide_from_tasks, PyObject_IsTrue);
PyObject *chars = PyObject_GetAttrString(opts, "select_by_word_characters");
if (chars == NULL) return NULL;

View File

@ -23,7 +23,7 @@ typedef struct {
color_type url_color, background, active_border_color, inactive_border_color;
double repaint_delay, input_delay;
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;
float adjust_line_height_frac, adjust_column_width_frac;
float background_opacity;