#[
  discard xcb_grab_pointer( p.conn
                            , 0
                            , p.window
                            , uint16 XCB_EVENT_MASK_BUTTON_RELEASE or
                                     XCB_EVENT_MASK_BUTTON_MOTION or
                                     XCB_EVENT_MASK_POINTER_MOTION_HINT
                            , uint8 XCB_GRAB_MODE_ASYNC
                            , uint8 XCB_GRAB_MODE_ASYNC
                            , p.window
                            , XCB_NONE
                            , XCB_CURRENT_TIME
                            )
]#

#  // Simple fix for 1:1 pixel aspect ratio.
# 	if (viewport.width > viewport.height)
# 	{
# 		viewport.x += 0.5f * (viewport.width - viewport.height);
# 		viewport.width = viewport.height;
# 	}
# 	else if (viewport.height > viewport.width)
# 	{
# 		viewport.y += 0.5f * (viewport.height - viewport.width);
# 		viewport.height = viewport.width;
# 	}
#  for t in scene.shapes.mitems:
#   if t.camera.updated: rec.vk_device.updateCamera(t, ( rec.swapchain.current_extent.width div 
#                                                  rec.swapchain.current_extent.height
#                                            )   )

# p.mouse = xcb_query_pointer_reply( p.conn
  #                                  , xcb_query_pointer(p.conn, p.window)
  #                                  , cast[ptr ptr xcb_generic_error_t](Z)
  #                                  )