A generic touchscreen calibration program for X.Org
修订版 | c4d1e1159635603fe7b512a95599071914e52afa (tree) |
---|---|
时间 | 2013-02-15 00:31:32 |
作者 | Jeff Lasslett <jeff.lasslett@gmai...> |
Commiter | Andreas Müller |
Prevent timeout exit when --no-timeout is used
Submitted https://github.com/tias/xinput_calibrator/pull/45
Signed-off-by: Jeff Lasslett <jeff.lasslett@gmail.com>
@@ -204,21 +204,23 @@ void CalibrationArea::redraw() | ||
204 | 204 | |
205 | 205 | bool CalibrationArea::on_timer_signal() |
206 | 206 | { |
207 | - time_elapsed += time_step; | |
208 | - if (time_elapsed > max_time) { | |
209 | - exit(0); | |
210 | - } | |
211 | - | |
212 | - // Update clock | |
213 | - Glib::RefPtr<Gdk::Window> win = get_window(); | |
214 | - if (win) { | |
215 | - const Gdk::Rectangle rect(display_width/2 - clock_radius - clock_line_width, | |
216 | - display_height/2 - clock_radius - clock_line_width, | |
217 | - 2 * clock_radius + 1 + 2 * clock_line_width, | |
218 | - 2 * clock_radius + 1 + 2 * clock_line_width); | |
219 | - win->invalidate_rect(rect, false); | |
207 | + if (calibrator->get_use_timeout()) { | |
208 | + time_elapsed += time_step; | |
209 | + if (time_elapsed > max_time) { | |
210 | + exit(0); | |
211 | + } | |
212 | + | |
213 | + // Update clock | |
214 | + Glib::RefPtr<Gdk::Window> win = get_window(); | |
215 | + if (win) { | |
216 | + const Gdk::Rectangle rect(display_width/2 - clock_radius - clock_line_width, | |
217 | + display_height/2 - clock_radius - clock_line_width, | |
218 | + 2 * clock_radius + 1 + 2 * clock_line_width, | |
219 | + 2 * clock_radius + 1 + 2 * clock_line_width); | |
220 | + win->invalidate_rect(rect, false); | |
221 | + } | |
220 | 222 | } |
221 | - | |
223 | + | |
222 | 224 | return true; |
223 | 225 | } |
224 | 226 |
@@ -293,13 +293,14 @@ bool GuiCalibratorX11::on_expose_event() | ||
293 | 293 | |
294 | 294 | bool GuiCalibratorX11::on_timer_signal() |
295 | 295 | { |
296 | - time_elapsed += time_step; | |
297 | - if (time_elapsed > max_time) { | |
298 | - exit(0); | |
299 | - } | |
300 | - | |
301 | 296 | // Update clock |
302 | - if(calibrator->get_use_timeout()){ | |
297 | + if(calibrator->get_use_timeout()) { | |
298 | + | |
299 | + time_elapsed += time_step; | |
300 | + if (time_elapsed > max_time) { | |
301 | + exit(0); | |
302 | + } | |
303 | + | |
303 | 304 | XSetForeground(display, gc, pixel[BLACK]); |
304 | 305 | XSetLineAttributes(display, gc, clock_line_width, |
305 | 306 | LineSolid, CapButt, JoinMiter); |