Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem with wxmaxima under fedora fc29 #1113

Closed
MiKapl opened this issue Apr 25, 2019 · 23 comments
Closed

problem with wxmaxima under fedora fc29 #1113

MiKapl opened this issue Apr 25, 2019 · 23 comments

Comments

@MiKapl
Copy link

MiKapl commented Apr 25, 2019

There is a problem with wxmaxima 19.03.1 under fedora fc29 (wxWidgets: 3.0.4
Unicode support, Maxima Version: 5.42.1, x86_64-redhat-linux-gnu, Lisp: SBCL 1.4.6-2.fc29) after the last fedora updates (wxmaxima used to work fine before, maxima and xmaxima still work fine). If I load a worksheet, only the first few lines are shown. It is not possible to choose cells with the mouse on the underpart of the worksheet. I compiled newer versions of maxima than provided with fedora 29 from source with the same result. Are there known issues with wxWidgets or with other supporting programs that could cause this bug?

@gunterkoenigsmann
Copy link
Member

My computer is still compiling wxWidgets 3.1.3 with GTK3... ...but another thing has been reported: Do you happen to use the proprietary NVIDIA drivers?

@scx
Copy link
Collaborator

scx commented Apr 26, 2019

@MiKapl

Could you try RPM from COPR and/or Flatpak package?
https://copr.fedorainfracloud.org/coprs/scx/wxMaxima
https://github.com/scx/wxmaxima-flatpak

RPM

dnf copr enable scx/wxMaxima
dnf install wxMaxima

Flatpak

flatpak remote-add --if-not-exists "flathub" "https://dl.flathub.org/repo/flathub.flatpakrepo"
flatpak install https://dl.flathub.org/build-repo/2578/io.github.wxmaxima_developers.wxMaxima.flatpakref

There are also two alternative variants:

@gunterkoenigsmann
Copy link
Member

Ok... ...on my Ubuntu with intel graphics wxWidgets 3.1/gtk+3 works fine.

Which is bad news: Resolving problems one cannot reproduce is hard - so I need many more hints at the problem. Question Nr 2 (After the nVidia one): Is only the first page of the worksheet displayed? Or is even the first page not displayed correctly? And could we get a ScreenShot?

@MiKapl
Copy link
Author

MiKapl commented Apr 26, 2019

I installed wxMaxima-19.04.3-1.el7.x86_64 from copr and get:

$ wxmaxima: Symbol `_ZN12wxTextBuffer6ms_eofE' has different size in shared object, consider re-linking
09:42:40: Warning: Mismatch between the program and library build versions detected.
The library used 3.0 (wchar_t,compiler with C++ ABI 1013,wx containers,compatible with 2.8),
and your program used 3.0 (wchar_t,compiler with C++ ABI 1002,wx containers,compatible with 2.8).

@MiKapl
Copy link
Author

MiKapl commented Apr 26, 2019

I don't use the proprietary NVIDIA driver

@MiKapl
Copy link
Author

MiKapl commented Apr 26, 2019

I just tried the version from https://github.com/scx/wxmaxima-flatpak/tree/wxgtk2. That works for me!

@scx
Copy link
Collaborator

scx commented Apr 26, 2019

@MiKapl

I installed wxMaxima-19.04.3-1.el7.x86_64 from copr and get:

$ wxmaxima: Symbol `_ZN12wxTextBuffer6ms_eofE' has different size in shared object, consider re-linking
09:42:40: Warning: Mismatch between the program and library build versions detected.
The library used 3.0 (wchar_t,compiler with C++ ABI 1013,wx containers,compatible with 2.8),
and your program used 3.0 (wchar_t,compiler with C++ ABI 1002,wx containers,compatible with 2.8).

Wait, did you tried to use package for EL7 on Fedora 29? But why? I provided a repo for Fedora 28-31 as well.
Anyway, I am glad that flatpak package works for you.

@MiKapl
Copy link
Author

MiKapl commented Apr 26, 2019

Sorry I installed the wrong repo. I tried it again with the fc29 version but this one shows the same bug: only the first few lines of a worksheet are shown.

The flatpak version is great since there are no problems with the gui but the help browser does not work as it should and I have problems to load packages like 'draw'.

Will you create and offer a complete rpm from the flatpak wxgtk2 version?

@scx
Copy link
Collaborator

scx commented Apr 27, 2019

@MiKapl

Will you create and offer a complete rpm from the flatpak wxgtk2 version?

It should be doable. I will try and let you know when I finish it.

@scx
Copy link
Collaborator

scx commented Apr 27, 2019

@MiKapl

Will you create and offer a complete rpm from the flatpak wxgtk2 version?

Done. You should now be able to install wxMaxima-gtk2-19.04.3-2.fc29.x86_64 from COPR repo.

dnf copr enable scx/wxMaxima && dnf install wxMaxima

You can switch between preferred versions using update-alternatives:

update-alternatives --config wxMaxima

Alternatively, you can just uninstall the gtk+3 version:

dnf remove wxMaxima-gtk3

or just run the gtk+2 version from command line:

wxmaxima-gtk2

@MiKapl
Copy link
Author

MiKapl commented Apr 27, 2019

Thanks a lot for your help but the problem is still there. I now have the following versions:

  • from flatpak: if I run flatpak run io.github.wxmaxima_developers.wxMaxima the gui works fine
  • from copr: both installed versions wxmaxima-gtk2 and wxmaxima-gtk3 show the same bug: If I try for example for i thru 100 do display(i!); I see the correct first page of the results, but if I scroll further down results are cut off. I cannot enter further input cells (see screenshot).

I'm confused since I thought that the copr gtk2 version is the same as the one in flatpak.

wxmaxima_problem

@scx
Copy link
Collaborator

scx commented Apr 27, 2019

@MiKapl

I'm confused since I thought that the copr gtk2 version is the same as the one in flatpak.

Well, not exactly, because RPM packages use Maxima and Lisp from distribution repo (EPEL or Fedora, where SBCL is default Lisp implementation), while Flatpak packages use built-in deps (Maxima 5.42.1 and ECL 16.1.3).

You can try to replace maxima-runtime-sbcl by maxima-runtime-ecl. Although if xmaxima works fine, then the problem should be somewhere else...

@gunterkoenigsmann

Any idea?

@scx
Copy link
Collaborator

scx commented Apr 27, 2019

@MiKapl

To display long numbers try: EditConfigureWorksheetMaximum displayed number of digits2147483647 (or just something >= 1000).

@gunterkoenigsmann
Copy link
Member

If scrolling is involved the problem most probably has to do with PrepareDC in Worksheet.cpp. seems like Ubuntu and ArchLinux differ in something affecting where or if this command is needed.

@MiKapl
Copy link
Author

MiKapl commented Apr 27, 2019

I tried '-l ecl' in the wxmaxima options to use maxima with ecl but this didn't make a difference.

I have no problem with long numbers. My loop for i thru 100 do display(i!); went up to 100, but the display stops earlier (in my screenshot at 61! depending on how far I try to scroll down).

The bug must be somewhere in the discrepancy between the flatpack and copr packages and not in gtk2 - gtk3?

@jose-matos
Copy link

FWIW I am the in the loop and interested in having this problem fixed in Fedora repos.

@scx feel free to submit patches and/or apply to comaintain the Fedora package.

@jose-matos
Copy link

The problem can more or less be explained like this.
When the cursor is at the begin of the notebook all the page is showed. As soon as you start to scroll the area that is displayed begins to shrink proportionally to the the scroll.

Even although we talk about scroll this problem happens as long as you move the cursor down. It will happen if you use the cursor keys (down...) or PageDown.

As an example if I use the cursor keys to move from the last visible line and go down then I only see more or less half of the next page.

FWIW the problem is that the text is not displayed, even although it is there. The height of the scroll bar shows that there is more document bellow, we just do not see it.

Testing it I have also found out that this problem does not occur if a single cell is larger and it does not fit the screen, if we scroll down inside the cell we see its content. But we do not see cell (e.g. the output of that cell).

I hope that this makes sense.

@MiKapl
Copy link
Author

MiKapl commented May 1, 2019

Stimulated by your "purely speculative go at [#1113]" I just erased line 401 PrepareDC(dc); from src/Worksheet.cpp in the source of wxmaxima-Version-19.04.3. Then I compiled with

mkdir -p build; cd build; cmake3 ..; cmake3 --build .

The resulting file in ./src/wxmaxima works without the above described bug!!
Thanks a lot for your help!

@gunterkoenigsmann
Copy link
Member

Thanks a lot for your debugging. Seems like in this place every linux distribution and every combination of wxGtk and Gtk can differ from each other => It's easy to introduce bugs here and nearly impossible to test for them as each test would require a different version of a different linux distri. This is especially true as Ubuntu and ArchLinux with the same wxWidgets version and configuration behave differently.

gunterkoenigsmann added a commit that referenced this issue May 1, 2019
… a windows PC. If it works there I will make a new official release with the bugfix.
@jose-matos
Copy link

I can confirm that the fix also works on Fedora 30, and so I am updating the 19.04.3 release with this patch for Fedora 28 to 30. :-)

@scx
Copy link
Collaborator

scx commented May 4, 2019

@jose-matos

I've just updated my RPM packages to version 19.05.0.
https://copr.fedorainfracloud.org/coprs/scx/wxMaxima/build/903367/
I can confirm that this resolves the problem.

This required creating a small patch. It has already been upstreamed.
f48196c
#1122
#1121

I don't know if my current RPM SPEC meets Fedora Policy/Packaging Guidelines. It is basically based on SPEC from Fedora, but recently I decided to provide two frontends: not only gtk+3, but also gtk+2.
Anyway, I encountered a problem with compat-wxGTK3-gtk2 on EL7, because it is some kind of broken since removal of webkitgtk package. Could you do something about it? I've already reported it on the Red Hat Bugzilla, but I'm afraid that this may be ignored.
https://bugzilla.redhat.com/show_bug.cgi?id=1703864

@scx
Copy link
Collaborator

scx commented May 4, 2019

Unfortunately, the last update (19.05.0) has broken the program under wxWidgets 3.1 (3.1.2).

It doesn't now correctly display the area when scrolling.

Example input:

for i thru 100 do display(i!);

Result:
wxMaxima_19.05.0_wxWidgets-3.1.png

The error does not occur in wxWidgets 3.0 (versions 3.0.2 and 3.0.4 were tested, the second one with both toolkits: gtk+2 and gtk+3).

I can also confirm that this error did not occur in the previous version (19.04.3).

@scx
Copy link
Collaborator

scx commented May 4, 2019

Temporary patch:

diff --git a/src/Worksheet.cpp b/src/Worksheet.cpp
index 7c63e4b..1fb6158 100644
--- a/src/Worksheet.cpp
+++ b/src/Worksheet.cpp
@@ -405,6 +405,10 @@ void Worksheet::OnPaint(wxPaintEvent &WXUNUSED(event))
 #ifdef __WXGTK__
 #ifndef __WXGTK3__
   PrepareDC(dc);
+#else
+#if wxCHECK_VERSION(3, 1, 0)
+  PrepareDC(dc);
+#endif
 #endif
 #else
   PrepareDC(dc);

This patch fixes the bug on GNOME 3.32 runtime in Flatpak when using wxGTK3 3.1.2.

It applies only to wxGTK3 in wxWidgets 3.1, so it shouldn't break anything else.
Please keep in mind that all major Linux distribution use wxWidgets 3.0 by default. This includes EL, Fedora, SLE, openSUSE, Ubuntu LTS and Debian stable. Moreover, there is no wxGTK31 in the official Fedora repos.
However, this version may be used by some bleeding edge distributions, such as Arch or Gentoo. And to be honest, I don't have time to test it on every single distro.

scx added a commit to scx/wxmaxima that referenced this issue May 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants