Code::Blocks

User forums => Help => Topic started by: Commaster on May 21, 2018, 09:32:51 am

Title: wxScintilla and wx2.8
Post by: Commaster on May 21, 2018, 09:32:51 am
Looks like one of the recent wxScintilla merge broke wx2.8 compatibility:

Code: [Select]
src/PlatWX.cpp: In member function ‘void Window::SetPositionRelative(PRectangle, Window)’:
src/PlatWX.cpp:1908:32: error: ‘wxDisplay’ has not been declared
     const int currentDisplay = wxDisplay::GetFromWindow(relativeWin);
                                ^
src/PlatWX.cpp:1909:56: error: ‘wxDisplay’ was not declared in this scope
     const wxRect displayRect = wxDisplay(currentDisplay).GetClientArea();
                                                        ^

Are we officially moving to wx3.0 and above?
Title: Re: wxScintilla and wx2.8
Post by: oBFusCATed on May 21, 2018, 09:48:03 am
Looks like one of the recent wxScintilla merge broke wx2.8 compatibility:

It builds fine for me with wx2.8.12 on gentoo and centos.
It seems the wxDisplay subsystem in your wx build is disabled.

Are we officially moving to wx3.0 and above?
It will be good if we drop wx2.8, but we've not done so yet.
Title: Re: wxScintilla and wx2.8
Post by: Commaster on May 21, 2018, 01:14:48 pm
It seems the wxDisplay subsystem in your wx build is disabled.

Interesting... I haven't touched the build script in ages...
Code: [Select]
../../configure --disable-compat26 --enable-unicode --disable-sys-libs --enable-monolithic --with-gtk=2 --with-jpeg=builtin --with-libpng=builtin --with-regex=builtin --with-tiff=builtin --with-zlib=builtin --with-expat=builtin

Does it need an extra toggle?

(I do have the display.h in the install directory... weird)
Title: Re: wxScintilla and wx2.8
Post by: stahta01 on May 21, 2018, 02:09:43 pm
--enable-display
Title: Re: wxScintilla and wx2.8
Post by: Commaster on May 22, 2018, 09:01:43 pm
I've added that flag, but the setup.h still says
Code: [Select]
#define wxUSE_DISPLAY 0
I'll have to dig into the wx src to figure out why this is happening.

Thanks for the suggestion!  :)
Title: Re: wxScintilla and wx2.8
Post by: oBFusCATed on May 22, 2018, 09:37:53 pm
You can use the patch attached here: http://trac.wxwidgets.org/ticket/18115 (after modifying it to match the source locations in cb's repo).
But generally you want to have wxdisplay working. It will make you're user experience a lot better.
Title: Re: wxScintilla and wx2.8
Post by: stahta01 on May 23, 2018, 12:12:28 am
From wxWidgets configure.in
Code: [Select]
AC_MSG_WARN([Xinerama not found; disabling wxDisplay])

Tim S.
Title: Re: wxScintilla and wx2.8
Post by: stahta01 on May 23, 2018, 12:23:24 am
But generally you want to have wxdisplay working. It will make you're user experience a lot better.

I am guessing this is mostly only true if you have multiple monitors; is this correct?

Tim S.
Title: Re: wxScintilla and wx2.8
Post by: oBFusCATed on May 23, 2018, 01:27:44 am
Nope, it improves experience in single monitor settings.
The the bug from the link happens on a single monitor machine.
Title: Re: wxScintilla and wx2.8
Post by: Commaster on May 23, 2018, 07:53:09 pm
Feels like a bug in the wxWidgets 2.8 branch:

I have Xinerama installed, but the default install path for the .so on *Ubuntu is /usr/lib/x86_64-linux-gnu/.

Debugging the configure script showed, that the search paths for libs are:
Code: [Select]
/usr/local/lib
/usr/local/X11/lib
/usr/local/lib/X11
/usr/local/X11R6/lib
/usr/local/lib/X11R6
/usr/Motif-2.1/lib
/usr/Motif-1.2/lib
/usr/lib/Motif1.2
/usr/dt/lib
/usr/openwin/lib
/usr/lib/Xm
/usr/X11R6/lib
/usr/X11R6.4/lib
/usr/lib/X11R6
/usr/X11/lib
/usr/lib/X11
/usr/XFree86/lib/X11
/usr/pkg/lib
/usr/local/X1R5/lib
/usr/local/lib/X11R5
/usr/X11R5/lib
/usr/lib/X11R5
/usr/local/X11R4/lib
/usr/local/lib/X11R4
/usr/X11R4/lib
/usr/lib/X11R4
/usr/openwin/share/lib
/usr/lib

Basically everywhere BUT the right location. I don't think my shell-script-fu is strong enough to untangle the mess of $SEARCH_LIB.

Also looking at wx3.0+ configure shows that it no longer checks for Xinerama  :-\
Title: Re: wxScintilla and wx2.8
Post by: Commaster on May 23, 2018, 08:06:58 pm
nvm, got it working after this patch for the wx2.8 source:

Code: [Select]
diff --git a/configure b/configure
index f2ba453158..86ede0018a 100755
--- a/configure
+++ b/configure
@@ -24947,9 +24947,9 @@ SEARCH_INCLUDE="\
                               \
     /usr/dt/include           \
     /usr/openwin/include      \
-                              \
+    /usr/include              \
     /usr/include/Xm           \
-                              \
+    /usr/include/x86_64-linux-gnu \
     /usr/X11R6/include        \
     /usr/X11R6.4/include      \
                               \
diff --git a/configure.in b/configure.in
index b73abca3c5..4c9492e7ed 100644
--- a/configure.in
+++ b/configure.in
@@ -2652,9 +2652,9 @@ SEARCH_INCLUDE="\
                               \
     /usr/dt/include           \
     /usr/openwin/include      \
-                              \
+    /usr/include              \
     /usr/include/Xm           \
-                              \
+    /usr/include/x86_64-linux-gnu \
     /usr/X11R6/include        \
     /usr/X11R6.4/include      \
                               \

@oBFusCATed: while you are at it, please add "_T" in the last StartsWith-s in the rev 11411. Cheers.