Lost keyboard focus after import (Ubuntu) [patch]
Forum rules
Audacity 1.3.x is now obsolete. Please use the current Audacity 2.x.x package for your distribution or compile Audacity from the source code.
Audacity 1.3.x is now obsolete. Please use the current Audacity 2.x.x package for your distribution or compile Audacity from the source code.
Lost keyboard focus after import (Ubuntu) [patch]
I experience a loss of keyboard focus after importing tracks. (Ubuntu 10.10, Audacity 1.3.12/SVN HEAD)
How to reproduce:
1) Import (SHIFT+CTRL+I) an audio file (e.g., a flac file).
2) Press SPACE to start playing the imported track.
Expected result: The track should start playing.
Actual result: Nothing happens at all.
3) Press CTRL + A to select all.
Expected result: The whole track should be selected.
Actual result: Nothing happens at all.
4) Press SHIFT+CTRL+I to import another audio file.
Expected result: The import dialog should come up.
Actual result: Nothing happens at all.
100 % reproducible.
I have come up with a small patch (to SVN HEAD) that explicitly sets focus to the track panel after import. That solves the problem for me. I have not tested on other platforms than Ubuntu 64-bit.
--
Cheers,
Per Ångström
How to reproduce:
1) Import (SHIFT+CTRL+I) an audio file (e.g., a flac file).
2) Press SPACE to start playing the imported track.
Expected result: The track should start playing.
Actual result: Nothing happens at all.
3) Press CTRL + A to select all.
Expected result: The whole track should be selected.
Actual result: Nothing happens at all.
4) Press SHIFT+CTRL+I to import another audio file.
Expected result: The import dialog should come up.
Actual result: Nothing happens at all.
100 % reproducible.
I have come up with a small patch (to SVN HEAD) that explicitly sets focus to the track panel after import. That solves the problem for me. I have not tested on other platforms than Ubuntu 64-bit.
--
Cheers,
Per Ångström
- Attachments
-
- track-focus-after-import-patch.txt
- A small patch against current SVN HEAD to explicitly set focus to the track panel after importing a track.
- (288 Bytes) Downloaded 127 times
Re: Lost keyboard focus after import (Ubuntu) [patch]
No reaction at all. What did I do wrong?
Re: Lost keyboard focus after import (Ubuntu) [patch]
I can reproduce the same in Audacity 1.3.12beta from the official Debian package on x86 (32 bits).
I remember I experienced something similar some time ago. I think I posted it somewhere here on the forum... but that was a long time ago I doubt I'll found that thread again
I remember I experienced something similar some time ago. I think I posted it somewhere here on the forum... but that was a long time ago I doubt I'll found that thread again
Include as much details as you can in your post (Audacity version, Operating System, Equipment used, etc).
Please post your question in the appropriate forum (regarding audacity version and operating system).
Please post your question in the appropriate forum (regarding audacity version and operating system).
Re: Lost keyboard focus after import (Ubuntu) [patch]
Thanks autark. I've applied the patch and it's working fine.
The bug does not appear to be listed on Bugzilla, so I'll add it along with your patch.
I'll also bring it to the attention of the developers as it looks like an issue that can be cleared very quickly.
If you think that you might be fixing other bugs, it might be worth you signing up on the developers mailing list, then you can post patches to them directly.
https://lists.sourceforge.net/lists/lis ... city-devel
The bug does not appear to be listed on Bugzilla, so I'll add it along with your patch.
I'll also bring it to the attention of the developers as it looks like an issue that can be cleared very quickly.
If you think that you might be fixing other bugs, it might be worth you signing up on the developers mailing list, then you can post patches to them directly.
https://lists.sourceforge.net/lists/lis ... city-devel
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
Re: Lost keyboard focus after import (Ubuntu) [patch]
The bug report is here: http://bugzilla.audacityteam.org/show_bug.cgi?id=294
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
Re: Lost keyboard focus after import (Ubuntu) [patch]
The patch works nicely on Ubuntu 10.10 (32-bit), but unfortunately it breaks things on other platforms.autark wrote:I have come up with a small patch (to SVN HEAD) that explicitly sets focus to the track panel after import. That solves the problem for me. I have not tested on other platforms than Ubuntu 64-bit.
On Windows the problem does not occur. If focus prior to import a control in the toolbar or the selection bar, then the focus is returned to that control. With this patch, focus is moved away from where it was (which is where focus should be).
It looks like what is needed is a way to return focus to wherever it was prior to import. If I get any more information about this I'll post it here.
Re: Lost keyboard focus after import (Ubuntu) [patch]
As I am on Windows7 the patch is not easily read due to CR/Linefeed issues but I think it is adding the set focus line--just a single addition of one line of code. As this reportedly causes problems on Windows it could easily be conditionally compiled:
As I only compile on Win7 I cannot thoroughly test this.
Code: Select all
}
GetDirManager()->FillBlockfilesCache();
#if defined( __WXGTK__ )//I've also seen # if defined(__linux__)
mTrackPanel->SetFocus();
#endif
return true;
}
Re: Lost keyboard focus after import (Ubuntu) [patch]
Thanks Edgar.
This is the original patch - hopefully easier to read:
so your new patch would be like this?
What does "#if defined( __WXGTK__ )" do?
Do you have a Bugzilla account Edgar?
This is the original patch - hopefully easier to read:
Code: Select all
Index: src/Project.cpp
===================================================================
--- src/Project.cpp (revision 10843)
+++ src/Project.cpp (working copy)
@@ -3400,6 +3400,7 @@
}
GetDirManager()->FillBlockfilesCache();
+ mTrackPanel->SetFocus();
return true;
}
Code: Select all
Index: src/Project.cpp
===================================================================
--- src/Project.cpp (revision 10843)
+++ src/Project.cpp (working copy)
@@ -3400,6 +3400,7 @@
}
GetDirManager()->FillBlockfilesCache();
+ #if defined( __WXGTK__ )//I've also seen # if defined(__linux__)
+ mTrackPanel->SetFocus();
+ #endif
return true;
}
Do you have a Bugzilla account Edgar?
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
Re: Lost keyboard focus after import (Ubuntu) [patch]
Just been notified of an update to Bug 294. I see you do have an accountsteve wrote: Do you have a Bugzilla account Edgar?
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
Re: Lost keyboard focus after import (Ubuntu) [patch]
It will only compile the code between '#if' and '#endif', if '__WXGTK__' is defined (somewhere else before in the code).steve wrote:What does "#if defined( __WXGTK__ )" do?
For example:
Code: Select all
#define HELLO
#if defined(HELLO)
printf("Hello!");
#endifIf you comment out the first line:
Code: Select all
// #define HELLO
#if defined(HELLO)
printf("Hello!");
#endifThis is common practice, for example, when writing code for different architectures when some part of the code only applies to a certain architecture.
Include as much details as you can in your post (Audacity version, Operating System, Equipment used, etc).
Please post your question in the appropriate forum (regarding audacity version and operating system).
Please post your question in the appropriate forum (regarding audacity version and operating system).