Setup proper WM lifecycle and xcb bindings
This commit is contained in:
+12
-9
@@ -1,15 +1,18 @@
|
||||
open Ctypes
|
||||
open Foreign
|
||||
|
||||
module Void = struct
|
||||
type t
|
||||
module Atom = struct
|
||||
let _xcb_intern_atom =
|
||||
foreign "xcb_intern_atom"
|
||||
(ptr Types.Connection.typ @-> uint8_t @-> uint16_t @-> string
|
||||
@-> returning Types.Cookie.Atom.typ)
|
||||
|
||||
let typ : t structure typ = structure "xcb_void_cookie_t"
|
||||
let sequence = field typ "sequence" uint32_t
|
||||
let () = seal typ
|
||||
let intern conn only_if_exists name =
|
||||
_xcb_intern_atom conn
|
||||
(Unsigned.UInt8.of_int (if only_if_exists then 1 else 0))
|
||||
(Unsigned.UInt16.of_int (String.length name))
|
||||
name
|
||||
|
||||
let _xcb_change_window_attributes_checked =
|
||||
foreign "xcb_change_window_attributes_checked"
|
||||
(ptr Connection.typ @-> uint32_t @-> uint32_t @-> ptr uint32_t
|
||||
@-> returning typ)
|
||||
let wm_protocols conn = intern conn true "WM_PROTOCOLS"
|
||||
let wm_delete_window conn = intern conn false "WM_DELETE_WINDOW"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user