mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-25 09:48:09 +02:00
Automatically adjust cell height when DPI changes
DPI changes are detected as a change in the ration of the window size to the framebuffer size. I dont know how reliable that is. Possiblly Fix #77
This commit is contained in:
@@ -373,6 +373,15 @@ PYWRAP1(viewport_for_window) {
|
||||
return Py_BuildValue("iiII", 400, 400, global_state.cell_width, global_state.cell_height);
|
||||
}
|
||||
|
||||
PYWRAP1(set_dpi_from_os_window) {
|
||||
id_type os_window_id = PyLong_AsUnsignedLongLong(args);
|
||||
WITH_OS_WINDOW(os_window_id)
|
||||
set_dpi_from_os_window(os_window);
|
||||
Py_RETURN_TRUE;
|
||||
END_WITH_OS_WINDOW
|
||||
Py_RETURN_FALSE;
|
||||
}
|
||||
|
||||
PYWRAP1(mark_os_window_for_close) {
|
||||
id_type os_window_id;
|
||||
int yes = 1;
|
||||
@@ -476,6 +485,7 @@ static PyMethodDef module_methods[] = {
|
||||
MW(set_logical_dpi, METH_VARARGS),
|
||||
MW(pt_to_px, METH_O),
|
||||
MW(pt_to_px_ceil, METH_O),
|
||||
MW(set_dpi_from_os_window, METH_O),
|
||||
MW(add_tab, METH_O),
|
||||
MW(add_window, METH_VARARGS),
|
||||
MW(update_window_title, METH_VARARGS),
|
||||
|
||||
Reference in New Issue
Block a user