1 // SPDX-FileCopyrightText: Copyright 2012 Intel Corporation
2 // SPDX-License-Identifier: BSD-2-Clause
6 #include "wcore_error.h"
8 #include "x11_display.h"
9 #include "x11_wrappers.h"
12 x11_display_init(struct x11_display
*self
, const char *name
)
14 self
->xlib
= wrapped_XOpenDisplay(name
);
16 wcore_errorf(WAFFLE_ERROR_UNKNOWN
, "XOpenDisplay failed");
20 self
->xcb
= wrapped_XGetXCBConnection(self
->xlib
);
22 wcore_errorf(WAFFLE_ERROR_UNKNOWN
, "XGetXCBConnection failed");
23 wrapped_XCloseDisplay(self
->xlib
);
27 self
->screen
= DefaultScreen(self
->xlib
);
33 x11_display_teardown(struct x11_display
*self
)
38 int error
= wrapped_XCloseDisplay(self
->xlib
);
40 wcore_errorf(WAFFLE_ERROR_UNKNOWN
, "XCloseDisplay failed");