Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(118)

Issue 1035001: Fix off-by-one bug for the negative transition in XIdle::AddIdleTimeout, which (Closed)

Created:
10 years, 9 months ago by davidjames
Modified:
9 years, 4 months ago
Reviewers:
Daniel Erat
CC:
chromium-os-reviews_chromium.org
Visibility:
Public.

Description

Fix off-by-one bug for the negative transition in XIdle::AddIdleTimeout, which causes mouse and keyboard movements by the user to sometimes be missed. Add unit test to verify correct behavior. BUG=none TEST=included

Patch Set 1 #

Patch Set 2 : Minor formatting adjustments. Update comments. #

Total comments: 3

Patch Set 3 : Update to address Dan's comments #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+71 lines, -22 lines) Patch
M src/platform/power_manager/SConstruct View 1 chunk +1 line, -1 line 1 comment Download
M src/platform/power_manager/xidle.h View 1 3 chunks +5 lines, -3 lines 0 comments Download
M src/platform/power_manager/xidle.cc View 1 2 2 chunks +9 lines, -8 lines 1 comment Download
M src/platform/power_manager/xidle-example.cc View 1 2 chunks +5 lines, -1 line 2 comments Download
M src/platform/power_manager/xidle_unittest.cc View 1 2 1 chunk +51 lines, -9 lines 2 comments Download

Messages

Total messages: 5 (0 generated)
davidjames
10 years, 9 months ago (2010-03-16 04:04:19 UTC) #1
Daniel Erat
I saved more comments but Rietveld lost them. http://codereview.chromium.org/1035001/diff/16001/17003 File src/platform/power_manager/xidle.cc (right): http://codereview.chromium.org/1035001/diff/16001/17003#newcode33 src/platform/power_manager/xidle.cc:33: if ...
10 years, 9 months ago (2010-03-16 04:29:25 UTC) #2
davidjames
Dan, thank you for your patience! I really appreciate your help on this. I've addressed ...
10 years, 9 months ago (2010-03-16 17:43:47 UTC) #3
Daniel Erat
LGTM http://codereview.chromium.org/1035001/diff/24001/25001 File src/platform/power_manager/SConstruct (right): http://codereview.chromium.org/1035001/diff/24001/25001#newcode42 src/platform/power_manager/SConstruct:42: test_env.Append(LIBS=['gtest','Xtst']) nit: add a space after the comma ...
10 years, 9 months ago (2010-03-16 21:40:00 UTC) #4
davidjames
10 years, 9 months ago (2010-03-16 22:27:09 UTC) #5
http://codereview.chromium.org/1035001/diff/24001/25005
File src/platform/power_manager/xidle_unittest.cc (right):

http://codereview.chromium.org/1035001/diff/24001/25005#newcode31
src/platform/power_manager/xidle_unittest.cc:31: XTestFakeMotionEvent(display,
0, 0, 0, 0);
On 2010/03/16 21:40:01, Daniel Erat wrote:
> i think that this will warp the user's pointer to (0, 0) if they're running
this
> with their real X server, right?  that seems like it may be undesirable.  does
> XTestFakeRelativeMotionEvent(display, 0, 0, 0, 0) also trigger the alarm?

Aha, good catch. I didn't notice the warping because I was running with a fake X
server. The fake relative motion event is, in fact, good enough to trigger the
alarm. I committed the change with all the fixes you suggested (including the
relative motion event change).

Powered by Google App Engine
This is Rietveld 408576698