Skip to content

Commit

Permalink
error catching
Browse files Browse the repository at this point in the history
  • Loading branch information
castle055 committed Dec 1, 2023
1 parent cd89031 commit f9db02d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Binary file modified dist/libcyd_ui.a
Binary file not shown.
7 changes: 5 additions & 2 deletions src/graphics/x11/x11_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ cydui::graphics::window_t* cydui::graphics::create_window(
static int _ig = XInitThreads();

XVisualInfo vinfo;
XMatchVisualInfo(state::get_dpy(), state::get_screen(), 32, TrueColor, &vinfo);
if (0 == XMatchVisualInfo(state::get_dpy(), state::get_screen(), 32, TrueColor, &vinfo)) {
log_task.error("XMatchVisualInfo failed to find a Visual");
}
Colormap cmap = XCreateColormap(state::get_dpy(), state::get_root(), vinfo.visual, AllocNone);
XSetWindowAttributes wa = {
.background_pixel = 0,//ParentRelative,
.border_pixel = 0,
Expand All @@ -64,7 +67,7 @@ cydui::graphics::window_t* cydui::graphics::create_window(
| LeaveWindowMask | EnterWindowMask | PointerMotionMask,
.override_redirect =
override_redirect, // This makes it immutable across workspaces
.colormap = XCreateColormap(state::get_dpy(), state::get_root(), vinfo.visual, AllocNone),
.colormap = cmap,
};
str title_str = title;
str wclass_str = wclass;
Expand Down

0 comments on commit f9db02d

Please sign in to comment.