From ea59668704de4dcf7a8575c0a907499272d6da5c Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Mon, 11 Feb 2002 12:13:14 +0000 Subject: [PATCH 1/1] Linking now git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14125 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/x11/install.txt | 2 +- docs/x11/readme.txt | 3 ++- samples/minimal/minimal.cpp | 2 +- src/common/event.cpp | 2 ++ src/x11/app.cpp | 11 +++++++++-- src/x11/popupwin.cpp | 2 +- src/x11/toplevel.cpp | 2 +- src/x11/window.cpp | 3 ++- 8 files changed, 19 insertions(+), 8 deletions(-) diff --git a/docs/x11/install.txt b/docs/x11/install.txt index 4ef2f1f0d5..4d8e8ac9dc 100644 --- a/docs/x11/install.txt +++ b/docs/x11/install.txt @@ -43,7 +43,7 @@ COMPILING USING CONFIGURE If you compile wxWindows on Linux for the first time and don't like to read install instructions just do (in the base dir): -> ./configure --with-x11 --with-universal +> ./configure --with-x11 > make > su > make install diff --git a/docs/x11/readme.txt b/docs/x11/readme.txt index 0835381fdf..5c49da7398 100644 --- a/docs/x11/readme.txt +++ b/docs/x11/readme.txt @@ -16,7 +16,8 @@ Information on how to install can be found in the file install.txt, but if you cannot wait, this should work on many systems: -./configure --with-x11 --with-universal +./configure --with-x11 --disable-shared --with-x11 --with-debug_flag --enable-log --with-debug_info --enable-debug --without-threads --without-sockets -without-odbc -with-libjpeg --enable-debug_cntxt --disable-no_rtti" + make su make install diff --git a/samples/minimal/minimal.cpp b/samples/minimal/minimal.cpp index e5eb0633d1..5ba383e3c3 100644 --- a/samples/minimal/minimal.cpp +++ b/samples/minimal/minimal.cpp @@ -35,7 +35,7 @@ // ---------------------------------------------------------------------------- // the application icon (under Windows and OS/2 it is in resources) -#if defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXMAC__) || defined(__WXMGL__) +#if defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXMAC__) || defined(__WXMGL__) || defined(__WXX11__) #include "mondrian.xpm" #endif diff --git a/src/common/event.cpp b/src/common/event.cpp index 97d84b676c..c81e168b15 100644 --- a/src/common/event.cpp +++ b/src/common/event.cpp @@ -728,6 +728,8 @@ bool wxEvtHandler::ProcessEvent(wxEvent& event) info = CLASSINFO(wxWindowMSW); # elif defined(__WXGTK__) info = CLASSINFO(wxWindowGTK); +# elif defined(__WXX11__) + info = CLASSINFO(wxWindowX11); # elif defined(__WXMGL__) info = CLASSINFO(wxWindowMGL); # elif defined(__WXPM__) diff --git a/src/x11/app.cpp b/src/x11/app.cpp index b1e8fa532b..d011651a88 100644 --- a/src/x11/app.cpp +++ b/src/x11/app.cpp @@ -598,6 +598,9 @@ void wxApp::DeletePendingObjects() // Create an application context bool wxApp::OnInitGui() { + if (!wxAppBase::OnInitGui()) + return FALSE; + // TODO: parse argv and get display to pass to XOpenDisplay Display* dpy = XOpenDisplay(NULL); m_initialDisplay = (WXDisplay*) dpy; @@ -643,8 +646,12 @@ Window wxGetWindowParent(Window window) { Window parent, root = 0; unsigned int noChildren = 0; - if (XQueryTree((Display*) wxGetDisplay(), window, & root, & parent, - NULL, & noChildren)) + Window* children = NULL; + int res = XQueryTree((Display*) wxGetDisplay(), window, & root, & parent, + & children, & noChildren); + if (children) + XFree(children); + if (res) return parent; else return (Window) 0; diff --git a/src/x11/popupwin.cpp b/src/x11/popupwin.cpp index 9294a5d7e2..e442728bde 100644 --- a/src/x11/popupwin.cpp +++ b/src/x11/popupwin.cpp @@ -61,7 +61,7 @@ bool wxPopupWindow::Create( wxWindow *parent, int style ) XWMHints wm_hints; long xattributes_mask = - CWEventMask | + CWOverrideRedirect | CWBorderPixel | CWBackPixel; xattributes.background_pixel = BlackPixel( xdisplay, xscreen ); xattributes.border_pixel = BlackPixel( xdisplay, xscreen ); diff --git a/src/x11/toplevel.cpp b/src/x11/toplevel.cpp index 9c7086524d..c8e8b8f4a8 100644 --- a/src/x11/toplevel.cpp +++ b/src/x11/toplevel.cpp @@ -93,7 +93,7 @@ bool wxTopLevelWindowX11::Create(wxWindow *parent, XWMHints wm_hints; long xattributes_mask = - CWEventMask | + CWOverrideRedirect | CWBorderPixel | CWBackPixel; xattributes.background_pixel = BlackPixel( xdisplay, xscreen ); xattributes.border_pixel = BlackPixel( xdisplay, xscreen ); diff --git a/src/x11/window.cpp b/src/x11/window.cpp index 5e15ddd3a2..6914ada32d 100644 --- a/src/x11/window.cpp +++ b/src/x11/window.cpp @@ -147,7 +147,8 @@ bool wxWindowX11::Create(wxWindow *parent, wxWindowID id, Window window = XCreateSimpleWindow(wxGlobalDisplay(), parentWindow, x, y, w, h, 0, m_backgroundColour.AllocColour(wxGlobalDisplay()), - m_foregroundColour.AllocColour(wxGlobalDisplay())); + m_foregroundColour.AllocColour(wxGlobalDisplay())); + m_mainWidget = (WXWindow) window; // Select event types wanted XSelectInput(wxGlobalDisplay(), window, -- 2.45.2