Create primary monitor when using wxDisplay default ctor
Previously, the first monitor was created instead and while it was often also the primary one, this wasn't always the case. In particular, this makes wxGetDisplayPPI() always return something reasonable instead of returning (0, 0) when the first monitor is not the primary one, as expected by plenty of code, including our own printing sample, which divides by the values returned from wxGetDisplayPPI() without checking if they're zero.
This commit is contained in:
@@ -37,6 +37,9 @@ public:
|
||||
return m_impls[n];
|
||||
}
|
||||
|
||||
// Return the primary display object, creating it if necessary.
|
||||
wxDisplayImpl* GetPrimaryDisplay();
|
||||
|
||||
// get the total number of displays
|
||||
virtual unsigned GetCount() = 0;
|
||||
|
||||
|
Reference in New Issue
Block a user