Skip to content

Commit

Permalink
Fix segfault when out_to_x = false. (#455)
Browse files Browse the repository at this point in the history
This resolves #454.
  • Loading branch information
brndnmtthws committed Jan 23, 2018
1 parent abd0be5 commit 562c737
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions src/conky.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2076,20 +2076,24 @@ static void main_loop(void)
sigaddset(&newmask, SIGUSR1);
#endif

#ifdef BUILD_X11
#ifdef BUILD_XSHAPE
/* allow only decorated windows to be given mouse input */
int major_version, minor_version;
if (!XShapeQueryVersion(display, &major_version, &minor_version)) {
NORM_ERR("Input shapes are not supported");
} else {
if (own_window.get(*state) &&
(own_window_type.get(*state) != TYPE_NORMAL ||
(TEST_HINT(own_window_hints.get(*state), HINT_UNDECORATED)))) {
XShapeCombineRectangles(display, window.window, ShapeInput, 0, 0,
NULL, 0, ShapeSet, Unsorted);
if (out_to_x.get(*state)) {
/* allow only decorated windows to be given mouse input */
int major_version, minor_version;
if (!XShapeQueryVersion(display, &major_version, &minor_version)) {
NORM_ERR("Input shapes are not supported");
} else {
if (own_window.get(*state) &&
(own_window_type.get(*state) != TYPE_NORMAL ||
(TEST_HINT(own_window_hints.get(*state), HINT_UNDECORATED)))) {
XShapeCombineRectangles(display, window.window, ShapeInput, 0, 0,
NULL, 0, ShapeSet, Unsorted);
}
}
}
#endif /* BUILD_XSHAPE */
#endif /* BUILD_X11 */

last_update_time = 0.0;
next_update_time = get_time() - fmod(get_time(), active_update_interval());
Expand Down

0 comments on commit 562c737

Please sign in to comment.