Re: [Audacity-devel] Problem with hidden second project window on Windows
A free multi-track audio editor and recorder
Brought to you by:
aosiniao
From: Markus M. <me...@me...> - 2009-09-30 08:23:50
|
Hi Ed, glad to see you volunteering to work on stuff and thank you for your fix. However, your message does not have an attachment. I hope you don't mind when I give you a few suggestions what would be the best way to submit your changes. First, it would make reading and archiving your mailing list email easier if you sent it in text format (rather than HTML format as you do now). Does Yahoo Mail have a preference to change that? If not, what about using an email client like Thunderbird? Second, the preferred way to submit changes would be a diff against the current CVS HEAD. (It does not really make sense to fix bugs in source code downloaded from the website, be it an old version or the current version, because the code in question may have changed a lot since then.) With diff I do not mean an HTML diff or something created by graphical diff tools, but the "unified diff" format used in source code version control. If you use Linux, you can create a diff simply by calling the command "cvs diff -u" on the command line. If you use Windows, you can create a diff with the graphical CVS utility you are using. For example, when you use TortoiseCVS (which I recommend for use on Windows), there's a "Create Patch" command which creates a diff which you can send to the developer list as a simple text file. This makes it easy for us to see which changes you made, plus a developer with write access can then apply your changes in the diff using a simple CVS command. Thanks again for your contributions! Markus Ed Musgrove schrieb: > The case of the invisible project window. > > After reading John and Gale's posts concerning user reports of Audacity > opening and displaying an entry on the taskbar but no project window, I > decided to get my feet wet and to see if I could resolve the issue. > Being a newcomer here, I'm not sure how to present my thoughts on the > problem, the steps I went through to test the existing code base and the > solution that I came to. I did see somewhere a request to use diff to > show the change between the original code and the new code. The example > displayed was not created with the Python 3.1 diff that I use. The > Python version (even in HTML mode) is not very good for this sort of thing. > > I have studied the affected code thoroughly and done exhaustive testing > for all the scenarios that I can imagine in both the original code and > the solution that I am offering. I have attached a report with my notes > on the tests and their results; I include my conclusions and testing > methods. This is large text file and probably only of historical > interest. I would expect at least one senior Audacity programmer to > inspect this report before my solution is accepted. > > Two files will need to be changed: AudacityApp.cpp and Project.cpp. I > have attached copies of both new files. > > My tests show that Audacity can be confused during the application exit > process. This leads to a corrupt configuration file with the result that > the next time Audacity is started (or a new project is initiated by > relaunching Audacity while Audacity is already running) the resulting > project window is located way offscreen (x = -32,000, y = -32,000 give > or take). To understand why this happens one must examine the > application closure modes -- closing the only project window open will > cause the Audacity application to exit; with any number of Audacity > project windows open, selecting the menu item File/Exit of any project > window will cause the application to exit, if only one project window is > open and it is iconized right-clicking to bring up the context menu will > cause the application to exit (there are also obscure methods for the OS > and potentially other programs to send a close message to Audacity > causing it to exit but I did not explore those situations). > > What I found was that there were 2 independent logic chains implemented. > One chain was followed if the Files/Exit or context menu was used, the > other train was followed if the last open project window's close gadget > (the red box with the white X in the top right-hand corner of the > window) was clicked. In one case, projectArray[0] was always used to > determine which window preferences (x & y screen location, width & > height) would be written to the configuration file. In this case, if the > window was iconized default values were used. In the other case, > projectArray[last] was always used and it's iconized state was ignored. > In the 1st case, if multiple project windows were open and project[0] > was iconized the code did not look for a non-iconized window to use for > the configuration file-- while this might not be a bug it might not be > very user friendly. The 2nd case could clearly lead to a bug. > > Since the major difference in the 2 cases were the conditional clauses > and stepping statements that preceded the call to void SaveWindowSize(), > I chose to move all of that code into the SaveWindowSize function. This > allowed me to step through the projectArray looking for a project window > that was not iconized, starting at [0] and counting up until I found > one. If I got through the entire array without finding a non-iconized > project window I used the default built-in to Audacity for project > windows when no configuration values were available. I created a new > static Boolean to determine if the project window location and size have > already been written to preferences because SaveWindowSize might be > called multiple times during the exit process. > Please find attached Invisible.zip which includes a copy of this text, > the aforementioned report and new versions of AudacityApp.cpp and > Project.cpp. I have also included an HTML version of each of the diff > files--am.html (AudacityApp.cpp) and pm.html (Project.cpp) even though I > find them less than useful. > > Hmm...This new version of Yahoo! Mail does not seem to be allowing me > to attach a file. If the attachment fails I will upload Invisible.zip to > my website and post another message with a link. > > -Ed Musgrove > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry® Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9-12, 2009. Register now! > http://p.sf.net/sfu/devconf > > > ------------------------------------------------------------------------ > > _______________________________________________ > audacity-devel mailing list > aud...@li... > https://lists.sourceforge.net/lists/listinfo/audacity-devel |