Author: Jason Last-Update: 2018-08-23 Bug-Debian: https://bugs.debian.org/907029 Forwarded: https://github.com/rosorio/buici-clock/pull/1 Description: Fix showSecondHand --- a/clock.cxx +++ b/clock.cxx @@ -107,7 +107,8 @@ time_t calc_delta (time_t); void draw_dial (Display* display, Visual* visual, Pixmap pixmap, int dx, int dy); void draw_hands (Display* display, Visual* visual, - Pixmap pixmap, int dx, int dy, int seconds); + Pixmap pixmap, int dx, int dy, int seconds, + bool showSecondHand); void draw_dial_shape (Display* display, Pixmap pixmap, int dx, int dy); class WTopLevel : public LWindow { @@ -539,7 +540,7 @@ bool WTopLevel::render (void) _gc, 0, 0, width (), height (), 0, 0); - draw_hands (xdisplay (), xvisual (), pixmap, width (), height (), seconds); + draw_hands (xdisplay (), xvisual (), pixmap, width (), height (), seconds, m_fSecondHand); #if 0 // -- Draw hands --- a/draw.cc +++ b/draw.cc @@ -147,7 +147,8 @@ void draw (void) void draw_hands (Display* display, Visual* visual, - Pixmap pixmap, int dx, int dy, int seconds) + Pixmap pixmap, int dx, int dy, int seconds, + bool showSecondHand) { cairo_surface_t* s = cairo_xlib_surface_create (display, pixmap, visual, dx, dy); @@ -200,6 +201,7 @@ void draw_hands (Display* display, Visua cairo_path_destroy (path); // Second hand + if (showSecondHand){ cairo_save (cr); cairo_rotate (cr, ((2.0*M_PI)*seconds)/60.0); cairo_set_line_width (cr, WIDTH_THIN); @@ -211,6 +213,7 @@ void draw_hands (Display* display, Visua cairo_fill (cr); cairo_restore (cr); } + } cairo_destroy (cr); }