mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-06-26 02:41:54 +00:00
Wrap request attention API and expose to python
This commit is contained in:
parent
4d0459df95
commit
3352b8e572
2 changed files with 13 additions and 2 deletions
|
|
@ -1032,8 +1032,8 @@ def set_active_window(os_window_id: int, tab_id: int, window_id: int) -> None:
|
|||
pass
|
||||
|
||||
|
||||
def ring_bell(os_window_id: int = 0) -> None:
|
||||
pass
|
||||
def ring_bell(os_window_id: int = 0) -> None: ...
|
||||
def request_attention(os_window_id: int) -> None: ...
|
||||
|
||||
|
||||
def concat_cells(cell_width: int, cell_height: int, is_32_bit: bool, cells: Tuple[bytes, ...], bgcolor: int = 0) -> bytes:
|
||||
|
|
|
|||
11
kitty/glfw.c
11
kitty/glfw.c
|
|
@ -2167,6 +2167,16 @@ ring_bell(PyObject *self UNUSED, PyObject *args) {
|
|||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static PyObject*
|
||||
request_attention(PyObject *self UNUSED, PyObject *args) {
|
||||
unsigned long long os_window_id;
|
||||
if (!PyArg_ParseTuple(args, "K", &os_window_id)) return NULL;
|
||||
OSWindow *w = os_window_for_id(os_window_id);
|
||||
if (w && w->handle) glfwRequestWindowAttention(w->handle);
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
|
||||
static PyObject*
|
||||
get_content_scale_for_window(PYNOARG) {
|
||||
OSWindow *w = global_state.callback_os_window ? global_state.callback_os_window : global_state.os_windows;
|
||||
|
|
@ -2913,6 +2923,7 @@ static PyMethodDef module_methods[] = {
|
|||
METHODB(macos_cycle_through_os_windows, METH_O),
|
||||
METHODB(get_content_scale_for_window, METH_NOARGS),
|
||||
METHODB(ring_bell, METH_VARARGS),
|
||||
METHODB(request_attention, METH_VARARGS),
|
||||
METHODB(toggle_fullscreen, METH_VARARGS),
|
||||
METHODB(toggle_maximized, METH_VARARGS),
|
||||
METHODB(change_os_window_state, METH_VARARGS),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue