Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Counter display does not count down #52

Closed
VictorEijkhout opened this issue Jul 26, 2012 · 11 comments
Closed

Counter display does not count down #52

VictorEijkhout opened this issue Jul 26, 2012 · 11 comments
Labels

Comments

@VictorEijkhout
Copy link

Regularly, the counter display fails to count down: it gets stuck at pretty much the time it comes up.

The actual blocking does expire, presumably after the time specified.

OS X Lion, SelfControl 1.4.

@VictorEijkhout
Copy link
Author

The counter display also fails to disappear after the block resolves: I have to Exit and restart SelfControl.

@henrik242
Copy link

This was discussed in #36, but a solution was never found. I have a feeling that this is related to use of Spaces. Are you using Spaces, @VictorEijkhout?

@VictorEijkhout
Copy link
Author

On Aug 14, 2012, at 7:29 AM, henrik242 wrote:

This was discussed in #36, but a solution was never found. I have a feeling that this is related to use of Spaces. Are you using Spaces, Victor?

Yes. Very much.

Victor.

@cstigler
Copy link
Member

Hm, I'll take a look at this when I get a chance, if anybody has an idea for what could be going wrong here please let me know. I don't use Spaces at all, so I'm not familiar with how it works behind the scenes.

@longouyang
Copy link

I also have this problem on Lion and I don't use Spaces.

(Also, on Lion, Spaces is superseded by Mission Control, which AFAIK can't easily be disabled, since that's what implements full-screen mode for apps)

@ilTofa
Copy link
Contributor

ilTofa commented Nov 6, 2012

I see this one on Mountail Lion (10.8.2).
It is reproducible always (at least on my machine):

  1. press "Start"
  2. while "Loading" is shown (it's around 12 secs on my machine with a quite long list of blocks) change space OR have SelfControl lose the focus.
    If you don't have the app lose focus before as "loading" disappears (and the timer countdown starts) all works normally.
    The app works also when the timer is freezed so it's not so critical. If someone can point me to the relevant part of code I can try to fix it myself...
    I checked issue Fix freezing bug and more changes #36, that sent me to the issue Countdown hangs on OS X 10.7 Lion #15 (or something like that) that was marked "fixed" so probably it's not the same issue.
    (Thank you for the app, in any case!)

@rilian
Copy link

rilian commented Nov 6, 2012

@ilTofa i am experiencing exactly same issue - if SelfControl loses focus after start click, and timer is not yet shown, timer gets stuck

@mathew-hall
Copy link
Contributor

I've taken a look at it and it's due to the timer being created from a dialog it seems.

If the window doesn't have focus, scheduleTimerWithTimeInterval returns NULL instead of a timer and the updateTimerDisplay method in TimerController only gets called once. There's a kludgy fix to it in mathew-hall/selfcontrol@fa60308dd8, but it could be done far more elegantly - I'm a Cocoa novice.

@ilTofa
Copy link
Contributor

ilTofa commented Nov 26, 2012

@mathew-hall The fix seems to work. If we can limit the app to 10.6 an simpler fix is to use GDC and wrap the offending call into a dispatch_async(dispatch_get_main_queue(),^ { ... } ); call.

as in

   timerUpdater_ = [NSTimer timerWithTimeInterval: 1.0 target: self selector: @selector(updateTimerDisplay:) userInfo: nil repeats: YES];
});

in place of row 87-91 of TimerWindowController.m If we have to respect 10.5- compatibility, your fix is absolutely OK (IMHO). I think this is the case, you could make a pull request.

cstigler added a commit that referenced this issue Dec 7, 2012
* git://github.com/mathew-hall/selfcontrol:
  Kludgy fix to #52
@cstigler
Copy link
Member

cstigler commented Dec 7, 2012

Wow, thanks to both of you for catching that. I wouldn't have guessed that timers would fail in other threads, weird.

@mathew-hall Your fix looks fine to me! We do need to support 10.5 still. I merged your commit, thanks.

@VictorEijkhout
Copy link
Author

I just updated to 1.4.4

Sometimes it works fine, but I've also managed to get it to a beachball state where just a white box shows up for the counter display.

Here's to hoping this screenshot transfers....

[cid:7946D8AD-0AF7-4425-9DFF-5AE3CB985012@tacc.utexas.edu]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants