Add the option 'msw.native-dialogs-pmdpi' that will always show the native msw dialogs
as per monitor dpi aware, even when there are displays with different dpi.
Don't define operators for wx types in global scope.
This results in much better error messages when the compiler gives an
error about failing to resolve a call to some operator in user code
because it doesn't list all the wx-defined operators as candidates. In
practice, this cuts down error messages from 500 (!) lines to 2 with
gcc.
See #24190.
It is not necessary (nor beneficial) to derive these classes: wxQtActionGroup,
wxQtAction and wxQtShortcutHandler from wxQtSignalHandler ( which is intended
for use exclusively with wxWindow handlers only ).
This was probably done unintentionally in 8ccbd7e95d (Implement
operator/=(int) and operator*=(int) for wxPoint and wxRealPoint.,
2024-01-04) and results in warnings from clang.
In portable code CreateWithLogicalSize() must be used when its arguments
are logical coordinates, e.g. window sizes, so using CreateWithDIPSize()
was wrong and resulted in missized bitmaps in high DPI under MSW.
These functions behave in exactly the same way in this port, but using
CreateWithLogicalSize() seems to be more clear, as we're passing it the
coordinates in logical pixels (e.g. window sizes etc) and not DIPs.
No real changes.
This function should be used instead of CreateWithDIPSize() in portable
code, the latter is currently often used to do what this function is
doing, but this only works correctly in wxOSX and wxGTK3 but not wxMSW.
We can't rely on file /sys/power/state always existing, so just skip the
test (with a warning) instead of failing it if it does not exist, as is
the case at least under s390x and seemingly other non-desktop platforms.
Closes#24197.
Co-authored-by: Cliff Zhao <qzhao@suse.com>
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.
Add the errors logged by various file functions called from this
function to the returned error message instead of letting wxLog show
them as usual because it may be necessary to show an interactive message
box, asking the user about the action to take, if migrating the existing
file failed, and it is poor UI to show both the message box from wxLog
and this message box at the same time -- so avoid showing the former.
As not defining operator<<() overload taking wxScopedCharBuffer in the
global scope prevents it from being considered as an overload resolution
candidate (which is, of course, the whole point), it also prevents it
from being used for the classes convertible to it, such as wxCharBuffer,
so we need to define operator<<() overloaded for the latter explicitly
too.
We also need a new wxScopedCharTypeBufferStreamSupport helper in order
to define different operators inside different specializations of
wxScopedCharTypeBuffer<>.
Add new wxDECLARE_VARIANT_OBJECT_EXPORTED() macro defining these
operators as friend functions inside the class declaration and replace
all uses of DECLARE_VARIANT_OBJECT_EXPORTED() inside the core library
with the new macro to avoid defining any operator<<() overloads in the
global scope.
Also add wxIMPLEMENT_VARIANT_OBJECT() for consistency, even though it is
not really needed.