Welcome Guest.   Make a donation to an author on the site November 28, 2014, 04:59:24 PM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
Your Support Funds this Site: View the Supporter Yearbook.
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: CHS Feature Request: Switch to "New" folder on certain hot-key actions  (Read 2609 times)
superticker
Supporting Member
**
Posts: 138


View Profile WWW Give some DonationCredits to this forum member
« on: September 17, 2012, 10:35:55 AM »

Whenever I add a new clip via CTRL-ALT-C, and the Clipboard Help+Spell window opens, it's not always on the "New" folder as expected. It would be nice if it automatically switched to the "New" folder with this hot-key action.

I'm not so sure, however, if it should switch to the "New" folder with a CTRL-C action alone.  I'll have to think about that.  I think the switching to the "New" folder should only happen when the hot-key action grabs a new clip and presents the CHS window altogether.

There's still a bug present (from a year or so ago) in the CTRL-ALT-C hot key where the clip-capture sound is played, but the new clip isn't actually captured. The work around solution is to use a CTRL-C followed by a CTRL-ALT-C combination to capture clips and bring the CHS window up front. This work around works well.
Logged
mouser
First Author
Administrator
*****
Posts: 33,705



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #1 on: September 17, 2012, 02:12:36 PM »

I know what you mean about wanting it to auto switch to the New folder.. i've gotten bitten by that before.
Let me figure out if it can be done in all cases or if i need an option for some users.

As for the not always capturing -- that sounds like a real bug i haven't seen.. Any more clues about it?
Logged
superticker
Supporting Member
**
Posts: 138


View Profile WWW Give some DonationCredits to this forum member
« Reply #2 on: September 17, 2012, 03:19:45 PM »

As for the not always capturing--that sounds like a real bug i haven't seen.. Any more clues about it?
You worked on this bug before about 1.5 years ago, and the fixes you added did improve it. But occasionally, it still fails. What I can tell you is the capture sound always plays even when CTRL-ALT-C fails to capture anything. I'm usually doing this capturing in my email client (Courier) to correct spelling, although other apps are affected as well. I'm running Windows XP SP3 and CHS 2.11.01.

I'm mentioning this bug now because you'll be looking in this area of the code again when adding the switch to "New" folder feature.

Since the sounds always plays and the CHS window always comes to the front (as expected), I'm now wondering if the clip is put on the Windows clipboard buffer okay, but the clip just occasionally fails to show up in the "New" folder for some reason when CTRL-ALT-C is used? I guess I could try a paste operation upon failure and report back to you. Give it a couple weeks to happen again, then I'll report back.
« Last Edit: September 17, 2012, 03:28:36 PM by superticker » Logged
mouser
First Author
Administrator
*****
Posts: 33,705



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #3 on: September 17, 2012, 03:41:26 PM »

I'd just love any clue if you can find it about when Ctrl+Alt+C fails or a way to reproduce the failure.

Have you tried searching the entire clip database for the text to see if maybe its just going into the wrong group?
Logged
superticker
Supporting Member
**
Posts: 138


View Profile WWW Give some DonationCredits to this forum member
« Reply #4 on: September 17, 2012, 04:05:24 PM »

Have you tried searching the entire clip database for the text to see if maybe its just going into the wrong group?
I'll try that next time it fails. That's an interesting idea.

Since the CTRL-C function works correctly, why not simply have the CTRL-ALT-C function call the CTRL-C function as a subroutine, then open the CHS window with "New" folder selected? In other words, simplify the code to fix the hidden problem.
Logged
mouser
First Author
Administrator
*****
Posts: 33,705



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #5 on: September 17, 2012, 04:21:59 PM »

Quote
Since the CTRL-C function works correctly, why not simply have the CTRL-ALT-C function call the CTRL-C function as a subroutine

well see, that's the confusing thing -- it's not like Ctrl+Alt+C has its own independent code, it should already be doing exactly that, they should be sharing the same code and it's hard for me to understand why Ctrl+Alt+C could fail and not normal Ctrl+C..  But I should look into code more to see if there is something fishy i'm doing that could explain it.
Logged
superticker
Supporting Member
**
Posts: 138


View Profile WWW Give some DonationCredits to this forum member
« Reply #6 on: September 21, 2012, 12:12:14 PM »

Have you tried searching the entire clip database for the text to see if maybe its just going into the wrong group?
I'll try that next time it fails. That's an interesting idea.
The problem occurred again, and the new clip isn't present even after searching the entire database. But I did try pasting what was in the current Windows clipboard buffer and, to my surprise, it's not the new clip. Rather, it's the previous clip in the New folder.

So there are several possibilities here:  One is that the new clip was never captured at all by the CTRL-ALT-C operation. Instead, the previous clip was copied from the New folder to the Windows clipboard buffer instead when the captured sound was played.

The other possibility is that the new clip is placed on the Windows clipboard buffer okay, but then immediately overwritten by the last clip in the New folder when the captured sound was played.

Do you have any other questions?

What confuses me is why this failure is non-deterministic so it can't be easily reproduced?  It's as if there's some kind of race condition that occasionally is met, but only rarely. Are there two asynchronous Windows events that are colliding with each other 10% of the time?  Perhaps you need a semaphore to keep these two asynchronous Windows events from accessing the same shared resource simultaneously.

I see this kind of thing with device drivers because they service many "incoming" (outside) asynchronous requests, but not so much with OS-events within applications.
Logged
mouser
First Author
Administrator
*****
Posts: 33,705



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #7 on: September 24, 2012, 08:41:09 AM »

Quote
One is that the new clip was never captured at all by the CTRL-ALT-C operation.

It just occurred to me that this seems to confirm why this is failing, and it has to do with how Ctrl+Alt+C needs to operate.. It needs to send a simulated Ctrl+C keypress to the active window to trigger the capture, after which it shows the CHS window etc.

So in fact this operates very differently from normal Ctrl+C, which windows handles and then INFORMS CHS about via an event after the fact.

It could be that when its sending the simulated Ctrl+C keypress, it's getting tripped up over the alt key still being held down, or over losing focus in the active window -- that's the kind of thing that could happen unpredictably.

Let me go through the code now that I realize that, and look for places where it might mess up.

As a minimum first step, I can have Ctrl+Alt+C process only make the copying sound when it actually succeeds in simulating a ctrl+C copy to the clipboard prior to triggering -- that will at least give us an audible clue when it KNOWS it failed to capture the last clip.  I suspect though that now that i know the problem, I should be able to fix it.
Logged
superticker
Supporting Member
**
Posts: 138


View Profile WWW Give some DonationCredits to this forum member
« Reply #8 on: September 24, 2012, 10:22:43 AM »

Quote
One is that the new clip was never captured at all by the CTRL-ALT-C operation.
It could be that when its sending the simulated Ctrl+C keypress, it's getting tripped up over the alt key still being held down, or over losing focus in the active window--that's the kind of thing that could happen unpredictably.
Perhaps you could "temporarily" add a timed delay between the simulated CTRL-C and the next operation to see if that fixes it.  If it does, then you've discovered where the race condition is.  Once you know that, you can design a callback completion routine so you don't need the timed delay.

Also, rather than using a callback routine, you could replace the timed delay with a semaphore guard.
« Last Edit: September 24, 2012, 10:29:22 AM by superticker » Logged
mouser
First Author
Administrator
*****
Posts: 33,705



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #9 on: October 19, 2012, 10:03:19 AM »

I'm trying a fix in the new version about to some out, let me know if you notice any improvement.
Logged
superticker
Supporting Member
**
Posts: 138


View Profile WWW Give some DonationCredits to this forum member
« Reply #10 on: October 19, 2012, 10:28:23 AM »

I'm trying a fix in the new version about to some out, let me know if you notice any improvement.
Yes, I'll check for the race condition. But I may need to run it for a week or two before I can say for sure if it actually went away. With these nondeterministic problems, it's hard to be sure.
Logged
mouser
First Author
Administrator
*****
Posts: 33,705



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #11 on: October 19, 2012, 10:29:33 AM »

Understood.
Logged
superticker
Supporting Member
**
Posts: 138


View Profile WWW Give some DonationCredits to this forum member
« Reply #12 on: November 29, 2012, 11:45:31 AM »

I'm trying a fix in the new version about to some out, let me know if you notice any improvement.
Yes, I'll check for the race condition. But I may need to run it for a week or two before I can say for sure if it actually went away. With these nondeterministic problems, it's hard to be sure.
I can now confirm that the new-clip sound is played when the CTRL-ALT-C fails to capture the new clip with version 2.17.1. But it's also worth noting that this now occurs very rarely (under WinXP 32-bit). Something must have changed to reduce the affect of this race condition.
Logged
Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.033s | Server load: 0.01 ]