1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-18 00:50:05 +02:00

Bug 1971 - Linux: Scriptables screenshot command only grab a small rectangle of window

This commit is contained in:
James Crook 2018-09-05 18:31:04 +01:00
parent f61989e922
commit 1ecff6d5db
2 changed files with 14 additions and 2 deletions

View File

@ -143,6 +143,16 @@ wxTopLevelWindow *ScreenshotCommand::GetFrontWindow(AudacityProject *project)
wxWindow *front = NULL; wxWindow *front = NULL;
wxWindow *proj = wxGetTopLevelParent(project); wxWindow *proj = wxGetTopLevelParent(project);
// JKC: The code below is no longer such a good idea.
// We now have options to directly capture toolbars, effects, preferences.
// We now also may have more than one dialog open, so who is to say
// which one we want to capture? Additionally, as currently written,
// it may capture the screenshot dialog itself (on Linux)
// IF we still keep this code in future, it needs a rethink.
// Possibly as well as the kWindow options, we should offer kDialog options,
// which attempt to do what this once did.
#if 0
// This is kind of an odd hack. There's no method to enumerate all // This is kind of an odd hack. There's no method to enumerate all
// possible windows, so we search the whole screen for any windows // possible windows, so we search the whole screen for any windows
// that are not this one and not the given Audacity project and // that are not this one and not the given Audacity project and
@ -156,13 +166,14 @@ wxTopLevelWindow *ScreenshotCommand::GetFrontWindow(AudacityProject *project)
wxWindow *win = wxFindWindowAtPoint(wxPoint(x, y)); wxWindow *win = wxFindWindowAtPoint(wxPoint(x, y));
if (win) { if (win) {
win = wxGetTopLevelParent(win); win = wxGetTopLevelParent(win);
if (win != mIgnore && win != proj) { if (win != mIgnore && win != proj && win->IsShown()) {
front = win; front = win;
break; break;
} }
} }
} }
} }
#endif
if (!front || !front->IsTopLevel()) { if (!front || !front->IsTopLevel()) {
return (wxTopLevelWindow *)proj; return (wxTopLevelWindow *)proj;

View File

@ -78,7 +78,7 @@ public:
nCaptureWhats nCaptureWhats
}; };
ScreenshotCommand(){ mbBringToTop=true;}; ScreenshotCommand(){ mbBringToTop=true;mIgnore=NULL;};
// CommandDefinitionInterface overrides // CommandDefinitionInterface overrides
IdentInterfaceSymbol GetSymbol() override {return SCREENSHOT_PLUGIN_SYMBOL;}; IdentInterfaceSymbol GetSymbol() override {return SCREENSHOT_PLUGIN_SYMBOL;};
wxString GetDescription() override {return _("Takes screenshots.");}; wxString GetDescription() override {return _("Takes screenshots.");};
@ -103,6 +103,7 @@ public:
private: private:
// May need to ignore the screenshot dialog // May need to ignore the screenshot dialog
// Appears not to be used anymore.
wxWindow *mIgnore; wxWindow *mIgnore;
bool mBackground; bool mBackground;