• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

A generic touchscreen calibration program for X.Org


Commit MetaInfo

修订版c4d1e1159635603fe7b512a95599071914e52afa (tree)
时间2013-02-15 00:31:32
作者Jeff Lasslett <jeff.lasslett@gmai...>
CommiterAndreas Müller

Log Message

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>

更改概述

差异

--- a/src/gui/gtkmm.cpp
+++ b/src/gui/gtkmm.cpp
@@ -204,21 +204,23 @@ void CalibrationArea::redraw()
204204
205205 bool CalibrationArea::on_timer_signal()
206206 {
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+ }
220222 }
221-
223+
222224 return true;
223225 }
224226
--- a/src/gui/x11.cpp
+++ b/src/gui/x11.cpp
@@ -293,13 +293,14 @@ bool GuiCalibratorX11::on_expose_event()
293293
294294 bool GuiCalibratorX11::on_timer_signal()
295295 {
296- time_elapsed += time_step;
297- if (time_elapsed > max_time) {
298- exit(0);
299- }
300-
301296 // 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+
303304 XSetForeground(display, gc, pixel[BLACK]);
304305 XSetLineAttributes(display, gc, clock_line_width,
305306 LineSolid, CapButt, JoinMiter);