Remove unnecessary wxUSE_DISPLAY preprocessor checks
Most of the methods of wxDisplay are always available, they just only support primary display when wxUSE_DISPLAY==0, so there is no need to check for wxUSE_DISPLAY before using them as they already contain the only possible fallback anyhow and such checks are useless. This incidentally closes #18115, due to removing "#if wxUSE_DISPLAY" around wx/display.h inclusion.
This commit is contained in:
@@ -44,9 +44,7 @@
|
|||||||
#include "wx/textwrapper.h"
|
#include "wx/textwrapper.h"
|
||||||
#include "wx/modalhook.h"
|
#include "wx/modalhook.h"
|
||||||
|
|
||||||
#if wxUSE_DISPLAY
|
|
||||||
#include "wx/display.h"
|
#include "wx/display.h"
|
||||||
#endif
|
|
||||||
|
|
||||||
extern WXDLLEXPORT_DATA(const char) wxDialogNameStr[] = "dialog";
|
extern WXDLLEXPORT_DATA(const char) wxDialogNameStr[] = "dialog";
|
||||||
|
|
||||||
@@ -873,11 +871,7 @@ int wxStandardDialogLayoutAdapter::DoMustScroll(wxDialog* dialog, wxSize& window
|
|||||||
wxSize minWindowSize = dialog->GetSizer()->GetMinSize();
|
wxSize minWindowSize = dialog->GetSizer()->GetMinSize();
|
||||||
windowSize = dialog->GetSize();
|
windowSize = dialog->GetSize();
|
||||||
windowSize = wxSize(wxMax(windowSize.x, minWindowSize.x), wxMax(windowSize.y, minWindowSize.y));
|
windowSize = wxSize(wxMax(windowSize.x, minWindowSize.x), wxMax(windowSize.y, minWindowSize.y));
|
||||||
#if wxUSE_DISPLAY
|
|
||||||
displaySize = wxDisplay(wxDisplay::GetFromWindow(dialog)).GetClientArea().GetSize();
|
displaySize = wxDisplay(wxDisplay::GetFromWindow(dialog)).GetClientArea().GetSize();
|
||||||
#else
|
|
||||||
displaySize = wxGetClientDisplayRect().GetSize();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int flags = 0;
|
int flags = 0;
|
||||||
|
|
||||||
|
@@ -905,20 +905,13 @@ bool wxTopLevelWindowMSW::ShowFullScreen(bool show, long style)
|
|||||||
// change our window style to be compatible with full-screen mode
|
// change our window style to be compatible with full-screen mode
|
||||||
updateStyle.Apply();
|
updateStyle.Apply();
|
||||||
|
|
||||||
wxRect rect;
|
// resize to the size of the display containing us, falling back to the
|
||||||
#if wxUSE_DISPLAY
|
// primary one
|
||||||
// resize to the size of the display containing us
|
|
||||||
int dpy = wxDisplay::GetFromWindow(this);
|
int dpy = wxDisplay::GetFromWindow(this);
|
||||||
if ( dpy != wxNOT_FOUND )
|
if ( dpy == wxNOT_FOUND )
|
||||||
{
|
dpy = 0;
|
||||||
rect = wxDisplay(dpy).GetGeometry();
|
|
||||||
}
|
const wxRect rect = wxDisplay(dpy).GetGeometry();
|
||||||
else // fall back to the main desktop
|
|
||||||
#endif // wxUSE_DISPLAY
|
|
||||||
{
|
|
||||||
// resize to the size of the desktop
|
|
||||||
wxCopyRECTToRect(wxGetWindowRect(::GetDesktopWindow()), rect);
|
|
||||||
}
|
|
||||||
|
|
||||||
SetSize(rect);
|
SetSize(rect);
|
||||||
|
|
||||||
|
@@ -1953,17 +1953,11 @@ void Window::SetTitle(const char *s) {
|
|||||||
|
|
||||||
// Returns rectangle of monitor pt is on
|
// Returns rectangle of monitor pt is on
|
||||||
PRectangle Window::GetMonitorRect(Point pt) {
|
PRectangle Window::GetMonitorRect(Point pt) {
|
||||||
wxRect rect;
|
|
||||||
if (! wid) return PRectangle();
|
if (! wid) return PRectangle();
|
||||||
#if wxUSE_DISPLAY
|
|
||||||
// Get the display the point is found on
|
// Get the display the point is found on
|
||||||
int n = wxDisplay::GetFromPoint(wxPoint(wxRound(pt.x), wxRound(pt.y)));
|
int n = wxDisplay::GetFromPoint(wxPoint(wxRound(pt.x), wxRound(pt.y)));
|
||||||
wxDisplay dpy(n == wxNOT_FOUND ? 0 : n);
|
wxDisplay dpy(n == wxNOT_FOUND ? 0 : n);
|
||||||
rect = dpy.GetGeometry();
|
return PRectangleFromwxRect(dpy.GetGeometry());
|
||||||
#else
|
|
||||||
wxUnusedVar(pt);
|
|
||||||
#endif
|
|
||||||
return PRectangleFromwxRect(rect);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user