Return null from wxGetX11Display() when using Wayland
Returning Wayland display pointer as XDisplay was really confusing and resulted in more weird crashes than just using null pointer directly.
This commit is contained in:
parent
bac0aa0e83
commit
400ce8b582
1 changed files with 11 additions and 6 deletions
|
|
@ -763,19 +763,24 @@ void WXDLLIMPEXP_CORE wxGetMousePosition( int* x, int* y );
|
|||
wxDisplayType type;
|
||||
};
|
||||
WXDLLIMPEXP_CORE wxDisplayInfo wxGetDisplayInfo();
|
||||
|
||||
inline struct _XDisplay *wxGetX11Display()
|
||||
{
|
||||
const auto& info = wxGetDisplayInfo();
|
||||
return info.type == wxDisplayX11 ? (_XDisplay*)info.dpy : nullptr;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __X__
|
||||
WXDLLIMPEXP_CORE WXDisplay *wxGetDisplay();
|
||||
WXDLLIMPEXP_CORE bool wxSetDisplay(const wxString& display_name);
|
||||
WXDLLIMPEXP_CORE wxString wxGetDisplayName();
|
||||
#endif // X or GTK+
|
||||
|
||||
// use this function instead of the functions above in implementation code
|
||||
inline struct _XDisplay *wxGetX11Display()
|
||||
{
|
||||
return (_XDisplay *)wxGetDisplay();
|
||||
}
|
||||
inline struct _XDisplay *wxGetX11Display()
|
||||
{
|
||||
return (_XDisplay *)wxGetDisplay();
|
||||
}
|
||||
#endif // X
|
||||
|
||||
#endif // X11 || wxGTK
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue