Refactoring to allow using kitty in other projects

This commit is contained in:
Kovid Goyal
2017-10-21 12:10:42 +05:30
parent ff35bd61a8
commit 09c723380c
3 changed files with 47 additions and 15 deletions

View File

@@ -34,6 +34,7 @@ def _get_config_dir():
config_dir = _get_config_dir()
del _get_config_dir
defconf = os.path.join(config_dir, 'kitty.conf')
class ViewportSize:
@@ -116,4 +117,11 @@ def selection_clipboard_funcs():
return ans
def x11_window_id(window):
lib = glfw_lib()
lib.glfwGetX11Window.restype = ctypes.c_int32
lib.glfwGetX11Window.argtypes = [ctypes.c_void_p]
return lib.glfwGetX11Window(window.window_id())
iswayland = not isosx and hasattr(glfw_lib(), 'glfwGetWaylandDisplay')