Commit Graph

65067 Commits

Author SHA1 Message Date
Vadim Zeitlin
81c67c3686 Make wxDC::GetPPI() monitor-dependent in wxGTK3
Return the PPI for the display on which the associated window is shown
and not the main display PPI.
2018-11-01 02:02:47 +01:00
Vadim Zeitlin
4ad9cde380 Use the new wxDisplay(wxWindow*) ctor to simplify the code
Make the code simpler and, in a couple of places where the fall back to
the primary display in case wxDisplay::GetFromWindow() returned -1 was
missing, also more correct.
2018-11-01 00:06:34 +01:00
Vadim Zeitlin
f57cb6c1d9 Add wxDisplay(wxWindow*) ctor with fall back on primary display
This is more convenient than calling GetFromWindow() and then checking
its return value.
2018-11-01 00:02:47 +01:00
Vadim Zeitlin
e13df3140f Fall back to display-independent PPI in wxGTK
If we can't determine the display-specific PPI value, use the global one
which seems to be always available (and always equal to 96*96 in my
testing -- but this is what previous versions of wxWidgets returned, so
it's still better than nothing).
2018-10-30 23:43:29 +01:00
Vadim Zeitlin
9f8684c789 Factor out wxDisplayImpl::ComputePPI() helper
No real changes, this is a pure refactoring.
2018-10-30 23:43:29 +01:00
Vadim Zeitlin
68a7cbd08d Use gdk_screen_xxx_mm() as fallback only
Return the "real" PPI value from wxDisplay::GetPPI() in wxGTK and not
the value defined at X11 level which is what these functions seem to
use.
2018-10-30 23:43:29 +01:00
Vadim Zeitlin
1938adb5dc Don't use gdk_screen_xxx_mm() with multiple displays
These functions combine the sizes of all displays and so only return the
correct size when there is only a single display.

This fixes wildly wrong PPI values returned when more than one display
is used.
2018-10-29 18:33:26 +01:00
Vadim Zeitlin
f09b9dbfa2 Add wxDisplayImpl::GetScaleFactor() and implement it for wxGTK
We need to account for the scale factor under GTK+ (and, presumably,
under macOS) to compute the correct PPI value as it must use the number
of physical and not logical pixels.
2018-10-29 18:33:26 +01:00
Vadim Zeitlin
43d2b1db0e Simplify and fix layout of the display sample
Get rid of an unnecessary wxPanel and just create wxBookCtrl containing
pages showing information about the displays directly as a child of
wxFrame.
2018-10-29 17:40:14 +01:00
Vadim Zeitlin
8890a25db3 Merge branch 'setup-h-cmake' of https://github.com/MaartenBent/wxWidgets
Fix issues with generating setup.h.in.

See https://github.com/wxWidgets/wxWidgets/pull/994
2018-10-29 15:18:43 +01:00
Vadim Zeitlin
ea8d65dc83 Merge branch 'cmake_misc' of https://github.com/TcT2k/wxWidgets
CMake documentation improvements and increase MSVC warnings level.

See https://github.com/wxWidgets/wxWidgets/pull/993
2018-10-29 15:16:54 +01:00
Tobias Taschner
18db61d568 Fix MSW wxCheckOsVersion() without manifest
Reimplement wxCheckOsVersion() to use wxGetOsVersion() on windows.

An executable without the Windows 8.1+ compatibility info in a
manifest would not detect the version based on the VerifyVersionInfo()
API previously used.

Closes https://github.com/wxWidgets/wxWidgets/pull/992
2018-10-29 15:15:41 +01:00
Vadim Zeitlin
5d06593ae1 Ensure that wxThread::Pause() suspends the thread immediately
Surprisingly, ::SuspendThread() doesn't actually do it, but only
schedules the thread for suspension in some undetermined near future.
This could result in problems as Pause() could exit, releasing the CS
protecting wxThread internal data in the main thread, and allowing the
worker thread to enter it (e.g. in its TestDestroy()) before being
actually suspended, meaning that the thread got suspended inside a CS,
which resulted in later deadlocks.

Fix this by calling ::GetThreadContext() which is supposed to ensure
that the scheduler does really suspend the thread before it returns (as
it's impossible to get the context of a thread while it's running).

Closes #18137.
2018-10-29 14:55:09 +01:00
Vadim Zeitlin
832f837f75 Merge branch 'macos-configure-cpp'
Use SDK options with cpp too in configure under macOS.

See https://github.com/wxWidgets/wxWidgets/pull/985
2018-10-29 14:47:09 +01:00
Paul Cornett
25a54a9b56 build fix for wxUniversal 2018-10-28 09:16:06 -07:00
Paul Cornett
dd1a6a6d35 Avoid NULL pointer dereference when calling GetScaleFactor() on invalid bitmap with GTK+3 2018-10-28 09:15:33 -07:00
Vadim Zeitlin
5d5654742f Merge branch 'msw-popup'
Reimplement wxPopupWindow using WS_POPUP instead of WS_CHILD window in
wxMSW as the new approach allows using the controls inside the popup
normally, unlike the old one.

See https://github.com/wxWidgets/wxWidgets/pull/986

Closes #18243.
2018-10-27 15:08:22 +02:00
Vadim Zeitlin
79a37a2a65 Don't try to set focus outside of popup window in wxMSW
This will just hide the window immediately, so prefer to ignore the
"focus" argument of Popup() but show the popup instead.

Update the documentation to mention that setting focus outside of popup
is not supported under all platforms.
2018-10-27 15:06:42 +02:00
Vadim Zeitlin
965f890919 Fix regression in wxTopLevelWindowMSW::IsMaximized()
This fixes another bug from 3518f1a7d8
(after the one fixed in 5766280311): if a
window was maximized by user and then hidden, its IsMaximized() returned
false because it examined m_showCmd which didn't have SW_MAXIMIZE value
in this case.

The same was true for IsMinimised() as well.

Fix both problems by updating the value of m_showCmd when hiding the
window.
2018-10-26 04:01:04 +02:00
Vadim Zeitlin
f11849b7e8 Document not completely obvious wxRearrangeList::Set() behaviour
Calling Set() resets the existing items order, which makes sense from
the implementation point of view, but not necessarily expected by the
users.

See #18262.
2018-10-26 01:35:28 +02:00
Maarten Bent
f1cf525944 Add CMake option to set wxDEBUG_LEVEL
It is no use adding it to the generated setup.h because this section is commented out,
so add it as compiler option instead.
The default option is 'Default' in which case no compiler option is added.
2018-10-25 20:46:31 +02:00
Maarten Bent
a02bb61e90 Fix build errors after modifying CMake setup.h.in
Always set a value to ICONV_CONST so it will be defined in setup.h.
Add a check for strtoull to prevent a macro redefined warning.
Link with WebKit framework to fix macOS build with wxUSE_WEBKIT.
2018-10-25 20:46:31 +02:00
Maarten Bent
6363db488f Make CMake setup.h.in an exact copy of setup.h.in
Except use cmakedefine and cmakedefine01 to declare the variables.
2018-10-25 20:46:31 +02:00
Maarten Bent
828c3ce50d Remove duplicate line from update-setup-h
It was intended to be update_osx_setup_h but resulting setup.h.in would not
work because the macOS options are not initialized by configure or CMake.
2018-10-25 20:36:22 +02:00
Stefan Csomor
f257780771 Implement shaped windows closer to other platforms
wxFRAME_SHAPED is not needed anymore under OSX and a shaped window can just have a background color, does not need a paint handler.
2018-10-25 20:13:40 +02:00
Maarten Bent
c41255bd98 Add recent macOS setup.h defines to correct file
It was added to setup.h, not setup_inc.h. Regenerating setup.h would remove the defines.
2018-10-24 19:30:41 +02:00
Tobias Taschner
e285b3dfef Silence harmless MSVC warning (hidden local var) 2018-10-24 10:53:53 +02:00
Tobias Taschner
a52393267a CMake: Enable highest warning level for MSVC
This is not enabled for third party libaries as they are currently
producing too many warnings.
2018-10-24 10:52:47 +02:00
Tobias Taschner
d433aa7821 Include CMake in how to add new sample docs 2018-10-24 10:37:52 +02:00
Tobias Taschner
2ad0c1b7e1 Include CMake in how to add wxUSE_ documentation 2018-10-24 10:30:49 +02:00
Vadim Zeitlin
9562ca2b70 Block child window events propagation beyond wxPopupWindow
Set wxWS_EX_BLOCK_EVENTS to prevent events bubbling up to the popup
parent as it doesn't make much sense.

See #18243.
2018-10-24 02:06:46 +02:00
Vadim Zeitlin
67e51e7b6d Show the reason transparent windows can't be used in shaped sample
IsTransparentBackgroundSupported() may return more information about why
exactly are transparent windows not supported, show it if available.
2018-10-24 01:37:44 +02:00
Stefan Csomor
708a408733 move macOS transparency fix one level up 2018-10-23 21:12:48 +02:00
Stefan Csomor
a94325a76a fix transparency problems on macOS
under mojave any backgroundColor destroys transparency
2018-10-23 21:01:31 +02:00
Stefan Csomor
651e1cd1b5 Supporting newer transparent background API 2018-10-22 22:36:42 +02:00
Stefan Csomor
7dfbe50fc0 fixing proper font rendering color when using emulated bold
when the stroke width is set in macOS (emulated bold), the stroke color was not correctly set - unless text color was black
2018-10-22 17:43:31 +02:00
Stefan Csomor
a69a43bc53 fixing warning for unused param 2018-10-22 16:27:22 +02:00
Vadim Zeitlin
0955143e65 Don't output flags for "adv" library in wx-config
This allows to keep the existing makefiles or configure scripts for
building wxWidgets applications using wx-config unchanged to keep them
working with the existing wxWidgets releases without adding an
unnecessary dependency on the "adv" library when using the latest Git or
3.1.2, when it's released.
2018-10-22 13:59:09 +02:00
Vadim Zeitlin
ef2b015e39 Export CC and similar variables for sub-configure scripts
This is especially important under macOS where we modify CC, CPP and CXX
to use the specified SDK, and it's important to compile the code of 3rd
party libtiff and expat libraries using the same SDK, but also matters
for the other platforms when using non-default CC and CXX values.

By exporting these values we ensure that tiff and expat use the same
compilers and flags as the main libraries linking with them.
2018-10-20 22:58:48 +02:00
Vadim Zeitlin
56c4191168 Reimplement wxPopupWindow as a WS_POPUP window under MSW
Don't use the child window of the desktop window for popup windows under
MSW, while this worked in simplest cases, it didn't allow having
functional controls inside a wxPopupWindow as e.g. wxTextCtrl didn't
accept input it at all if created as a child of such window.

Instead, switch to using a top-level window, with WS_POPUP style, and
fix the problem with the loss of activation by explicitly pretending to
still be active in the owner window when losing activation to our own
popup (thanks to Barmak Shemirani for providing this solution).

Also use an MSW-specific and much simpler implementation of detecting
when the popup should be dismissed in wxPopupTransientWindow: instead of
capturing mouse or tracking focus, just react to activation loss
directly.

Add a wxTextCtrl to the popup in samples/popup to show that editing it
works now.
2018-10-20 22:50:46 +02:00
Vadim Zeitlin
17055fb8c6 Don't assert in focus code for buttons inside a wxPopupWindow
IsTopLevel() returns true for wxPopupWindow, even if it's not a subclass
of wxTopLevelWindow, so GetTLWParentIfNotBeingDeleted() asserted when
called with a button inside a wxPopupWindow.

Just return null from it instead for now. A better solution could be to
return wxNonOwnedWindow from GetTLWParentIfNotBeingDeleted() (which
would need to be renamed to something more suitable) and move the
{Get,Set}TmpDefaultItem() methods into it.
2018-10-20 22:50:46 +02:00
Paul Cornett
35a9f134cc Fix build with wxUSE_UNICODE_UTF8
wxString is not implicitly convertible to const char* in that configuration.
Also, stock IDs work fine with GTK+3 despite being deprecated, so only avoid
them for GTK+4.
2018-10-20 09:58:30 -07:00
Vadim Zeitlin
2242e98a4c Disable the use of liblzma in libtiff if detecting it failed
We only disabled LZMA support in libtiff if --without-liblzma was
explicitly specified, but we need to do it also if liblzma wasn't
detected because libtiff configure might erroneously decide that it's
available under macOS when using -isysroot, which would result in
compilation errors later. And even if there were no such problem, it's
still worth disabling LZMA support explicitly to skip unnecessary
checking for it again in libtiff configure.
2018-10-20 18:14:47 +02:00
Vadim Zeitlin
ccd2862d23 Use SDK options with cpp too in configure under macOS
Otherwise trying to compile and preprocess a file could behave
differently because the format could not find a header existing in the
system due to the use of -isysroot option, confusing configure.
2018-10-20 13:39:27 +02:00
Vadim Zeitlin
51fb57ec07 Merge branch 'doc_platform_restructure' of https://github.com/TcT2k/wxWidgets
Integrate platform build instructions into documentation.

See https://github.com/wxWidgets/wxWidgets/pull/960
2018-10-20 13:31:10 +02:00
Tim Stahlhut
cca0921400 Fix file names in header comments
No real changes, just fix comments containing copy-and-paste typos.

Closes https://github.com/wxWidgets/wxWidgets/pull/984
2018-10-20 13:27:23 +02:00
Lauri Nurmi
b9e813f9d3 Fix ANSI build for GTK+ 2
Operands of the ?: had different types, so add an explicit conversion to
wxString.

Closes https://github.com/wxWidgets/wxWidgets/pull/983
2018-10-20 13:25:45 +02:00
jgehw
b5face97bc Fix QA build options check when wxUSE_DEBUGREPORT==0
Compile this check even if wxDebugReport itself is not used.

Closes https://github.com/wxWidgets/wxWidgets/pull/979
2018-10-20 13:22:16 +02:00
Cătălin Răceanu
88b7ef2fab Fix wxRA_SPECIFY_{ROWS,COLS} handling in wxQt wxRadioBox
Their meanings were previously reversed.

Closes https://github.com/wxWidgets/wxWidgets/pull/978
2018-10-20 13:21:28 +02:00
Vadim Zeitlin
aeb68e9861 Merge branch 'doc_release_web' of https://github.com/TcT2k/wxWidgets
Bring instructions for updating download page after a release up to date
after the latest improvements in the web site repository, see
https://github.com/wxWidgets/website/pull/27

Closes https://github.com/wxWidgets/wxWidgets/pull/973
2018-10-20 13:13:38 +02:00