#1 2009-04-18 18:46

traycerb
Member
Registered: 2009-03-16
Posts: 10

"Reset of events" affects other Shutter windows

When I have 2 shutter sessions running, a reset of an  event in Shutter #1 causes a reset of the same condition in Shutter #2.  Read below for the full story, but here's the short-story picture version:

shutterxp3.jpg


The long story:  I wanted some way to have a visual/audio warning prior to a starting sleep (initiated by user-inactivity), but also wanted some way I could wave off the impending sleep just by moving my mouse (instead of having to click on "restart actions").  See http://www.den4b.com/forum/viewtopic.php?id=617

I hit on the idea that I could just have 2 shutter sessions accomplish this.  Say I wanted to sleep after 10 minutes of user activity.  I setup Shutter #1 to play a message/sound at 9 minutes of inactivity, and then (automatically) reset the action (for next time).  Shutter #2 is setup to sleep at 10 minutes.  What I was expecting is, after the warnings, I could either choose to wave off the sleep by moving the mouse (which would reset both inactivity timers), or let it pass, after which the computer sleeps.

The problem is when Shutter #1 activity timer resets, it also resets Shutter #2's activity timer, ensuring sleep never happens.  I don't think this is the intended action, as the inactivity timers are independent themselves (if you start them separately, their values differ slightly).  It makes more sense (to me, IMHO) that the sessions are independent (though I can see uses for having each "session" share triggers).

Last edited by traycerb (2009-04-18 18:52)

Offline

#2 2009-04-22 21:12

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,374

Re: "Reset of events" affects other Shutter windows

From the picture I can see that both instances of Shutter are running "User Inactive" event, which is very odd. Two instances of Shutter do not communicate with each other, and your assumption that the instance #2 gets affected by the dialog in the instance #1 is wrong.

The event is called "User Inactive", it gets reset when user starts using a keyboard or a mouse. Of course, if you click or press "Ok" button in that dialog - then any running "User Inactive" events will get reset. On the other hand, if you let it go without making any activity and wait until the message timer runes out by it-self, you'll see that the instance #2 will not get reset.

Offline

#3 2009-04-22 23:14

traycerb
Member
Registered: 2009-03-16
Posts: 10

Re: "Reset of events" affects other Shutter windows

heh.  you're a hard man to convince.  wink   so i made a video (first time doing this, so let's see if it works):

http://s245.photobucket.com/albums/gg79 … utter4.flv

hmmm...the link is buggy in firefox (photobucket's website, probably).  To see it clearly, view "Full Size", then (instead of pressing PLAY or REPLAY) drag the slider just a bit.  THEN press play.

Is there some special way to instantiate multiple versions of shutter?  I just double-click shutter.exe twice.  Oh, and if it makes a difference, I'm on XP/sp3.

ADDENDUM: I should say that I've worked around this temporarily by using shutter to give the warning, and using different freeware program to do the actual shutdown.  works in a limited fashion, as only inactivity can be monitored (e.g. not inactivity and cpu idle), so an all shutter solution would be better smile

EDIT #2:  An obvious observation, but I bet the inactivity reset issue is probably traceable to inactivity.dll.

Last edited by traycerb (2009-04-25 05:30)

Offline

#4 2009-05-16 01:34

traycerb
Member
Registered: 2009-03-16
Posts: 10

Re: "Reset of events" affects other Shutter windows

den4b, were you ever able to see the video or replicate my findings?

I'm curious to know if this is reproducible or not...

Offline

#5 2009-05-16 11:38

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,374

Re: "Reset of events" affects other Shutter windows

I found the problem. It is in fact traced back to Inactivity.dll, like you thought.

Inactivity.dll library was written a long time ago and I don't even remember when was the last time I looked at it, until now of course. The problem rose from running more than 1 instance of User Inactivity event. Several instances of the event would be counteracting each other at the point when they start and stop monitoring user inactivity. Anyway, this issue should be fixed now.

Please try latest dev version: ShutterBeta.zip

Offline

#6 2009-05-16 21:36

traycerb
Member
Registered: 2009-03-16
Posts: 10

Re: "Reset of events" affects other Shutter windows

Hmmm...don't think I'm seeing the correct behavior.

If I have multiple instances, after Shutter #1's event triggers, it performs its action, but can't reset the event, and it continues to repeat its action (e.g. repeating Message Boxes or Sounds).

This continues until Shutter #2 (really, the last instance of shutter started) has its event triggered, it performs its action, and then it resets the event for both Shutter instances.

If I add a 3rd Shutter, Shutter #2 acts like Shutter #1.

I think they still share the same inactivity timer somehow.

Anyway, sorry to make you hack through old code.  No fun for sure.  Probably worth another donation on my end; not much, but enough to buy a decent pint (of which I hear Ireland has wink)

Offline

#7 2010-04-27 13:00

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,374

Re: "Reset of events" affects other Shutter windows

I have revisited this problem and was able to better understand the problem you were having. Let me explain...

The very first instance of Shutter initializes the starting point for inactivity timer (the last known point of user's activity). Every other consequent instance do not initialize the inactivity timer, so every timer will have exactly the same starting point which was set by the first instance. When one of the instances got restarted it still had that initial starting point, meaning that it will instantly have a large inactivity period which is already longer that the one specified by the event, which causes the event to trigger immediately.

I have modified the timer in such a way that now every instance of Shutter will have an individual starting point.

The latest development version should work as you expected: ShutterBeta.zip

Offline

#8 2010-04-30 07:06

traycerb
Member
Registered: 2009-03-16
Posts: 10

Re: "Reset of events" affects other Shutter windows

update is really appreciated den4b.  still having some issues though:  the error is now that the instance of shutter which had focus last resets the timer for all instances when it resets the timer for itself.

e.g. if i have 3 shutters (all set to restart after trigger), with #3 being most recently focused, then #1 and #2 countdown fine, and reset fine, but #3 resets all shutters.  If I give #1 focus, it becomes the one that resets all instances.  curious to know if you can duplicate this, or it's a problem on my end.

Offline

#9 2010-05-02 19:07

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,374

Re: "Reset of events" affects other Shutter windows

I've done some more work on it. With the latest development version I cannot reproduce your issue.

The actions I have taken are preemptive. It is very difficult to find the exact source of the problem because of the nature of the process of tracking user inactivity which involves hooking into Windows API and injecting code into processes - making debugging a nightmare.

If you are still experiencing some issues I will need to know your exact configuration, including list of events and actions.

Offline

#10 2010-07-14 02:29

pavelabra
Member
From: USA
Registered: 2010-07-13
Posts: 1

Re: "Reset of events" affects other Shutter windows

I think it is better to use one shutter at a time.

Offline

Board footer

Powered by FluxBB