Compare commits

...

8 Commits

Author SHA1 Message Date
Dmitry Vedenko
837669d3fa
Fixes typo in the comment 2021-06-17 17:48:35 +03:00
Dmitry Vedenko
e42d7f7365 Fix accsessibility for 64bit Windows applications 2021-06-17 15:11:43 +03:00
Dmitry Vedenko
6e53bf2f92 Use _get_errno instead of _get_doserrno.
Also, reset errno before calling wxRename, so previous errors do not affect the result.
2021-06-17 15:10:39 +03:00
Stefan Csomor
07e7d832c7 Avoid infinite recursion between wxStockGDI and wxSystemSettions
There was a possible recursion from wxStockGDI::GetFont to
wxSystemSettings::GetFont and back, resolve by using direct font
creation, adding fixed system font.
2020-12-02 16:32:18 -05:00
Paul Kulchenko
58ad95e798 Fix copy to clipboard by flushing the updated data. (#1623) 2020-12-02 16:32:18 -05:00
Leland Lucius
84e3f51eff Revert "Remove patch to msw/setup0.h"
This reverts commit 8284f68298344dd76db86e4dbac4376b642afdfe.
2020-07-24 16:51:29 -05:00
Leland Lucius
8284f68298 Remove patch to msw/setup0.h
This will restore default wxDEBUG_LEVEL handling on Windows.
2020-07-24 10:53:29 -05:00
Leland Lucius
027494baf6 Add an Audacity identifier to the version string 2020-07-05 13:28:44 -05:00
7 changed files with 40 additions and 19 deletions

View File

@ -26,7 +26,8 @@ enum wxOSXSystemFont
wxOSX_SYSTEM_FONT_MINI,
wxOSX_SYSTEM_FONT_MINI_BOLD,
wxOSX_SYSTEM_FONT_LABELS,
wxOSX_SYSTEM_FONT_VIEWS
wxOSX_SYSTEM_FONT_VIEWS,
wxOSX_SYSTEM_FONT_FIXED
};

View File

@ -29,7 +29,7 @@
#define wxMINOR_VERSION 1
#define wxRELEASE_NUMBER 3
#define wxSUBRELEASE_NUMBER 0
#define wxVERSION_STRING wxT("wxWidgets 3.1.3")
#define wxVERSION_STRING wxT("wxWidgets 3.1.3 (Audacity)")
/* nothing to update below this line when updating the version */
/* ---------------------------------------------------------------------------- */
@ -48,12 +48,12 @@
#define wxMAKE_VERSION_STRING(x, y, z) \
wxSTRINGIZE(x) wxSTRINGIZE(y) wxSTRINGIZE(z)
#define wxMAKE_VERSION_DOT_STRING(x, y, z) \
wxSTRINGIZE(x) "." wxSTRINGIZE(y) "." wxSTRINGIZE(z)
wxSTRINGIZE(x) "." wxSTRINGIZE(y) "." wxSTRINGIZE(z) " (Audacity)"
#define wxMAKE_VERSION_STRING_T(x, y, z) \
wxSTRINGIZE_T(x) wxSTRINGIZE_T(y) wxSTRINGIZE_T(z)
#define wxMAKE_VERSION_DOT_STRING_T(x, y, z) \
wxSTRINGIZE_T(x) wxT(".") wxSTRINGIZE_T(y) wxT(".") wxSTRINGIZE_T(z)
wxSTRINGIZE_T(x) wxT(".") wxSTRINGIZE_T(y) wxT(".") wxSTRINGIZE_T(z) wxT(" (Audacity)")
/* these are used by src/msw/version.rc and should always be ASCII, not Unicode */
#define wxVERSION_NUM_STRING \

View File

@ -1133,20 +1133,28 @@ wxRenameFile(const wxString& file1, const wxString& file2, bool overwrite)
if ( wxRename (file1, file2) == 0 )
return true;
#else
// Normal system call
//
// For explanation, see: (warning...based mostly on observed behavior)
// http://bugzilla.audacityteam.org/show_bug.cgi?id=1266
// https://github.com/audacity/audacity/pull/94
// Normal system call
//
// For explanation, see: (warning...based mostly on observed behavior)
// http://bugzilla.audacityteam.org/show_bug.cgi?id=1266
// https://github.com/audacity/audacity/pull/94
unsigned long doserrno = 0;
for (int i = 0; i < 2000; i++)
{
// Clear errno before calling wxRename
_set_errno(0);
if ( wxRename (file1, file2) == 0 )
return true;
unsigned long doserrno;
_get_doserrno(&doserrno);
if (doserrno != ERROR_ACCESS_DENIED && (doserrno != ERROR_ALREADY_EXISTS || exists))
// In the future - we should implement this differenly:
// https://reviews.llvm.org/D13647#eeab044e
errno_t err = 0;
_get_errno(&err);
if (err != EACCES && (err != EEXIST || exists))
break;
wxMilliSleep(1);
}
#endif

View File

@ -3559,10 +3559,14 @@ wxWindowMSW::MSWHandleMessage(WXLRESULT *result,
#if wxUSE_ACCESSIBILITY
case WM_GETOBJECT:
{
//WPARAM dwFlags = (WPARAM) (DWORD) wParam;
LPARAM dwObjId = (LPARAM) (DWORD) lParam;
if (dwObjId == (LPARAM)OBJID_CLIENT && GetOrCreateAccessible())
// As per MSDN example - the correct way to compare this values
// is to cast them both to DWORD
// https://docs.microsoft.com/en-us/windows/win32/winauto/reuse-existing-pointers-to-objects
// For the lParam - sign extension happens, as LPARM is a signed integer.
// OBJID_CLIENT is defined as ((LONG)0xFFFFFFFC), we cast it DWORD so no warning is generated
// In the original code, however, it was sign extended as well, as we were comparing against signed
// 64-bit value.
if ((DWORD)lParam == (DWORD)OBJID_CLIENT && GetOrCreateAccessible())
{
processed = true;
rc.result = LresultFromObject(IID_IAccessible, wParam, (IUnknown*) GetAccessible()->GetIAccessible());

View File

@ -60,7 +60,11 @@ void wxClipboard::Clear()
bool wxClipboard::Flush()
{
return false;
wxCHECK_MSG( m_open, false, wxT("clipboard not open") );
wxOSXPasteboard::GetGeneralClipboard()->Flush();
return true;
}
bool wxClipboard::Open()
@ -105,6 +109,8 @@ bool wxClipboard::AddData( wxDataObject *data )
data->WriteToSink(wxOSXPasteboard::GetGeneralClipboard());
Flush();
m_data = data;
return true;

View File

@ -471,6 +471,8 @@ wxFont::wxFont(wxOSXSystemFont font)
case wxOSX_SYSTEM_FONT_VIEWS:
uifont = kCTFontViewsFontType;
break;
case wxOSX_SYSTEM_FONT_FIXED:
uifont = kCTFontUIFontUserFixedPitch;
default:
break;
}

View File

@ -196,7 +196,7 @@ wxFont wxSystemSettingsNative::GetFont(wxSystemFont index)
case wxSYS_DEVICE_DEFAULT_FONT :
case wxSYS_DEFAULT_GUI_FONT :
{
return *wxSMALL_FONT ;
return wxFont(wxOSX_SYSTEM_FONT_SMALL) ;
} ;
break ;
case wxSYS_OEM_FIXED_FONT :
@ -204,7 +204,7 @@ wxFont wxSystemSettingsNative::GetFont(wxSystemFont index)
case wxSYS_SYSTEM_FIXED_FONT :
default :
{
return *wxNORMAL_FONT ;
return wxFont(wxOSX_SYSTEM_FONT_FIXED) ;
} ;
break ;