Skip to content

Commit

Permalink
Prevent timeout exit when --no-timeout is used
Browse files Browse the repository at this point in the history
Submitted tias#45

Signed-off-by: Jeff Lasslett <jeff.lasslett@gmail.com>
  • Loading branch information
Jeff Lasslett authored and schnitzeltony committed Feb 14, 2013
1 parent 6ca429f commit c4d1e11
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 20 deletions.
30 changes: 16 additions & 14 deletions src/gui/gtkmm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,21 +204,23 @@ void CalibrationArea::redraw()

bool CalibrationArea::on_timer_signal()
{
time_elapsed += time_step;
if (time_elapsed > max_time) {
exit(0);
}

// Update clock
Glib::RefPtr<Gdk::Window> win = get_window();
if (win) {
const Gdk::Rectangle rect(display_width/2 - clock_radius - clock_line_width,
display_height/2 - clock_radius - clock_line_width,
2 * clock_radius + 1 + 2 * clock_line_width,
2 * clock_radius + 1 + 2 * clock_line_width);
win->invalidate_rect(rect, false);
if (calibrator->get_use_timeout()) {
time_elapsed += time_step;
if (time_elapsed > max_time) {
exit(0);
}

// Update clock
Glib::RefPtr<Gdk::Window> win = get_window();
if (win) {
const Gdk::Rectangle rect(display_width/2 - clock_radius - clock_line_width,
display_height/2 - clock_radius - clock_line_width,
2 * clock_radius + 1 + 2 * clock_line_width,
2 * clock_radius + 1 + 2 * clock_line_width);
win->invalidate_rect(rect, false);
}
}

return true;
}

Expand Down
13 changes: 7 additions & 6 deletions src/gui/x11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,13 +293,14 @@ bool GuiCalibratorX11::on_expose_event()

bool GuiCalibratorX11::on_timer_signal()
{
time_elapsed += time_step;
if (time_elapsed > max_time) {
exit(0);
}

// Update clock
if(calibrator->get_use_timeout()){
if(calibrator->get_use_timeout()) {

time_elapsed += time_step;
if (time_elapsed > max_time) {
exit(0);
}

XSetForeground(display, gc, pixel[BLACK]);
XSetLineAttributes(display, gc, clock_line_width,
LineSolid, CapButt, JoinMiter);
Expand Down

0 comments on commit c4d1e11

Please sign in to comment.