This seems like the most sensible thing to do. Alternative would be to
not use XDG directories if ~/.config doesn't exist yet, but this doesn't
seem right, especially if wxCONFIG_USE_XDG is explicitly specified.
Still use the traditional dot file if it already exists, but prefer
using the new location otherwise, i.e. for the new program installation.
Add wxCONFIG_USE_HOME to allow forcing the use of the old location if
really necessary.
Also use the new style as default "old style" of MigrateLocalFile() so
that calling it even when using XDG layout in wxStandardPaths still
works as expected.
Instead of deferring creation of wxPropertyGrid and other controls
to EVT_SIZE handler we can create them when wxPropertyGridManager
is created and its initial size is known.
This way we can avoid using a trick with magic number used as a flag
to determine when to create all controls in OnResize().
Closes#24171.
Passing window size divided by "scale" to CreateWithDIPSize() was wrong
as the resulting bitmap could be too small to cover the entire window
due to rounding errors, e.g. at 200% DPI the right and bottom row/column
was never drawn on if the window size in the corresponding direction was
odd.
This notably fixes their (dis)appearance in dark mode, where we always
draw them ourselves (otherwise we mostly only do it when using
non-default colour).
This was supposed to be "common part of all ctors" but there is just a
single ctor in this class and even this one doesn't really need to call
Bind(), which was the only thing done in Init() since the last commit,
as it can, and should be, called by Create() after successfully creating
the window instead.
No real changes, just a simplification.
Make memory leaks, such as the one fixed by the previous commit,
impossible by making a smart pointer instead of a raw one for this
object.
No real changes.
The pointer may have been already allocated when the code initializing
it in Create() when using dark mode is executed, so unconditionally
reassigning to it leaked memory.
Use the compiler default C++ dialect if it is C++11 or higher and only
explicitly request C++11 if the compiler can't compile a small test
using C++11 features by default.
This prevents from unnecessarily adding -std=c++11 to the compiler flags
under Unix, even with compilers using e.g. C++17 by default.
Unary minus of wxPoint and multiplication with double are implemented
but undocumented. Many of operators that use integers types other
than int remain undocumented though.
The arithmetic operators for wxPoint and wxRealPoint are quite
repetitive and were made by copy-paste from the wxSize operators.
Because of that, some of the names are a bit misleading which this
commit changes. The changes are:
1. replace s/sz with p/pt for point variables (likely 's' comes from
copied code used for wxSize variables)
2. replace 'i' with 'f' for floating point types (likely 'i' comes
from copied code used for integer types)
3. replace 'factor' with 'divisor' for division operations (factors
are the multiplication operands, not division)
We need to do it when using XWayland for the same reasons as we had to
do it in the EGL version when using either XWayland or Wayland directly:
without this, we can block for up to 1 second in glXSwapBuffers() if the
window is hidden, see #23512.
Closes#24163.
Closes#24165.
Do this for consistency with wxSize which already had this operator/()
overload and operator*() in these classes which was already overloaded
for double.
Closes#24185.
Closes#24187.
These have been unused since e95354ec54 (added UTF-16/32-[LB]E conversions; got
rid of wxCharacterSet and simplified and fixed some bugs in remaining code, 2003-09-22)
This can be useful for the existing applications switching to using
XDG-compliant config files location as they can just call this function
on startup to keep using the existing file.
Sometimes it's useful to have some code used only if wxConfig is defined
as wxRegConfig or only if it is defined as wxFileConfig and testing for
these symbols is more clear than testing for the platform (and more
correct, considering that setting wxUSE_CONFIG_NATIVE to 0 may result in
wxFileConfig being used even under Windows).
If saving wxConfig to the file in wxAppConsoleBase::CleanUp() failed,
wxLog messages were logged into a wxLogGui target which was recreated
because wxTheApp is still non-null when CleanUp() is called. However it
is destroyed soon afterwards and showing messages from wxLogGui without
wxTheApp leads to crashes, at least in wxGTK.
To avoid this, we could set wxTheApp to null before calling CleanUp(),
but it's not clear if there is no cleanup code (or something called from
it) which doesn't rely on wxTheApp existence, so instead just flush, and
reset, the log target after calling CleanUp() but before destroying the
application object.
This fixes the crash which could be easily reproduced simply by making
the file used by wxFileConfig not-writeable under Linux.
Use the correct types instead of wxSize which was erroneously used
there ever since a5664fd6ef (Increase interoperability between wxPoint
and wxRealPoint introducing constructors which convert between the two
classes., 2010-06-09).
Closes#23804.
For some completely mysterious reason we don't get the expected mouse
click events when running under AppVeyor, something might be covering
the window and stealing the clicks for itself there.
As there doesn't seem to be anything to do about it, just skip the test
in this case.
Closes#24082.