diff --git a/include/wx/unix/utilsx11.h b/include/wx/unix/utilsx11.h index e3019acc67..498b22f061 100644 --- a/include/wx/unix/utilsx11.h +++ b/include/wx/unix/utilsx11.h @@ -67,6 +67,13 @@ public: wxX11Display() { m_dpy = XOpenDisplay(NULL); } ~wxX11Display() { if ( m_dpy ) XCloseDisplay(m_dpy); } + // Pseudo move ctor: steals the open display from the other object. + explicit wxX11Display(wxX11Display& display) + { + m_dpy = display.m_dpy; + display.m_dpy = NULL; + } + operator Display *() const { return m_dpy; } // Using DefaultRootWindow() with an object of wxX11Display class doesn't