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

Markdown preview shows nothing #1302

Open
Gerhard404 opened this issue Jan 19, 2024 · 16 comments
Open

Markdown preview shows nothing #1302

Gerhard404 opened this issue Jan 19, 2024 · 16 comments

Comments

@Gerhard404
Copy link

I have installed geany-1.38 and the markdown-plugin from Ubuntu-22.04's package repository.

The markdown preview does nothing, at first I thought there's some error with images or something. However, even the most trivial file produces no output.

On another computer, also running Ubuntu-22.04, I was using geany with markdown-preview regularly without any issues. The one major difference is that my current machine uses KDE, whereas the other one used Gnome; but this can't be the reason.

The screenshot below shows the file plus the preview along with the debug messages for good measure.
I see nothing that would give me some hints. The preview remains solidly grey.

geanyError


Here are the debug messages as text

18:16:48.995085: GLib-GIO DEBUG	: _g_io_module_get_default: Found default implementation dconf (DConfSettingsBackend) for ‘gsettings-backend’
18:16:48.999775: GLib-GIO DEBUG	: _g_io_module_get_default: Found default implementation gvfs (GDaemonVfs) for ‘gio-vfs’
18:16:49.020692: Geany INFO		: Geany 1.38, de_AT.UTF-8
18:16:49.020706: Geany INFO		: GTK 3.24.33, GLib 2.72.4
18:16:49.020737: Geany INFO		: OS: Ubuntu 22.04.3 LTS (jammy)
18:16:49.020742: Geany INFO		: System data dir: /usr/share/geany
18:16:49.020748: Geany INFO		: User config dir: /home/gerhard/.config/geany
18:16:49.147635: Geany INFO		: Loaded GTK+ CSS theme '/usr/share/geany/geany.css'
18:16:49.148233: Geany INFO		: Loaded GTK+ CSS theme '/usr/share/geany/geany-3.20.css'
18:16:49.153394: Geany INFO		: System plugin path: /usr/lib/x86_64-linux-gnu/geany
18:16:49.168380: Geany INFO		: Added filetype JSON (64).
18:16:49.168424: Geany INFO		: Added filetype Nim (65).
18:16:49.168431: Geany INFO		: Added filetype Clojure (66).
18:16:49.168438: Geany INFO		: Added filetype Swift (67).
18:16:49.168445: Geany INFO		: Added filetype Meson (68).
18:16:49.168453: Geany INFO		: Added filetype CUDA (69).
18:16:49.168460: Geany INFO		: Added filetype Genie (70).
18:16:49.168466: Geany INFO		: Added filetype Kotlin (71).
18:16:49.168473: Geany INFO		: Added filetype TypeScript (72).
18:16:49.168479: Geany INFO		: Added filetype Groovy (73).
18:16:49.168493: Geany INFO		: Added filetype Arduino (74).
18:16:49.168500: Geany INFO		: Added filetype Graphviz (75).
18:16:49.168506: Geany INFO		: Added filetype Cython (76).
18:16:49.168589: Geany INFO		: Added filetype Scala (77).
18:16:49.189604: Geany INFO		: Loaded libvte from libvte-2.91.so.0
18:16:49.415967: Geany INFO		: Loaded:   /usr/lib/x86_64-linux-gnu/geany/markdown.so (Markdown)
18:16:49.429438: Geany INFO		: /home/gerhard/myGitRepos/Gerhard404/DEM/ReadMe.md : Markdown (UTF-8)
18:16:49.559447: (null) DEBUG	: Name com.canonical.AppMenu.Registrar does not exist on the session bus

That's the template.html file, that the plug-in uses. I have done nothing to it.

<html>
  <head>
    <style type="text/css">
      body {
        font-family: @@font_name@@;
        font-size: @@font_point_size@@pt;
        background-color: @@bg_color@@;
        color: @@fg_color@@;
      }
      code {
        font-family: @@code_font_name@@;
        font-size: @@code_font_point_size@@pt;
      }
    </style>
  </head>
  <body>
    @@markdown@@
  </body>
</html>

@elextr
Copy link
Member

elextr commented Jan 20, 2024

my current machine uses KDE, whereas the other one used Gnome; but this can't be the reason.

I am not saying it is the reason, but it is certainly possible. Markdown preview uses webkit2gtk which uses a lot of the G*1 infrastructure. By its nature that isn't a focus of a KDE distro, so its possible that there are interactions between the G* libraries and the KDE display server. Are you using a Wayland or X11 session?

Footnotes

  1. G* == GTK GIO Glib etc

@Gerhard404
Copy link
Author

Thank you for the response.

geany --version
geany 1.38 (kompiliert am Oct 14 2021 mit GTK 3.24.30, GLib 2.68.4)

Geany says, it's been compiled using GTK 3.24.
I checked webkit2gtk on my system, and the package management reports that I have libwebkit2gtk installed with versions 4.0-37 and 4.1-0.

Could this be a reason, there being no libwebkit2gtk version 3.something?

@elextr
Copy link
Member

elextr commented Jan 22, 2024

The markdown plugin uses libwebkit2gtk 4.0 so that should be ok.

Also 1.38 is two years old, if you can build Geany and plugins maybe try Geany 2.0 because I'm not sure when the plugin was switched to that version of libwebkit2gtk, but I suspect it might have been after 1.38.

Edit: no it was changed to 4.0 6 years ago, my, doesn't time fly.

@Gerhard404
Copy link
Author

Gerhard404 commented Jan 22, 2024

I now have compiled geany from sources, however the Markdown plug-in doesn't appear to be included.
Since geany-plugins is a separate repo, do I need to compile the plug-ins separately?
If yes, where do I put them, and how do I tell geany about them?

Sorry, if the questions are very basic.


Simply compiling the plug-ins made them appear next time I launched gedit.

The markdown plugin is there, but still doesn't show anything.

17:38:54.655003: GLib-GIO DEBUG	: _g_io_module_get_default: Found default implementation dconf (DConfSettingsBackend) for ‘gsettings-backend’
17:38:54.660132: GLib-GIO DEBUG	: _g_io_module_get_default: Found default implementation gvfs (GDaemonVfs) for ‘gio-vfs’
17:38:54.682639: Geany INFO		: Geany 2.0, unknown
17:38:54.682672: Geany INFO		: GTK 3.24.33, GLib 2.72.4
17:38:54.682751: Geany INFO		: OS: Ubuntu 22.04.3 LTS (jammy)
17:38:54.682759: Geany INFO		: System data dir: /usr/local/share/geany
17:38:54.682769: Geany INFO		: User config dir: /home/gerhard/.config/geany
17:38:54.838228: Geany INFO		: Loaded GTK+ CSS theme '/usr/local/share/geany/geany.css'
17:38:54.842630: Geany INFO		: System plugin path: /usr/local/lib/geany
17:38:54.849375: Geany INFO		: Added filetype JSON (65).
17:38:54.849393: Geany INFO		: Added filetype Nim (66).
17:38:54.849401: Geany INFO		: Added filetype Clojure (67).
17:38:54.849407: Geany INFO		: Added filetype Swift (68).
17:38:54.849415: Geany INFO		: Added filetype Meson (69).
17:38:54.849426: Geany INFO		: Added filetype CUDA (70).
17:38:54.849433: Geany INFO		: Added filetype Genie (71).
17:38:54.849439: Geany INFO		: Added filetype Kotlin (72).
17:38:54.849445: Geany INFO		: Added filetype TypeScript (73).
17:38:54.849451: Geany INFO		: Added filetype Groovy (74).
17:38:54.849457: Geany INFO		: Added filetype Arduino (75).
17:38:54.849463: Geany INFO		: Added filetype Graphviz (76).
17:38:54.849468: Geany INFO		: Added filetype Cython (77).
17:38:54.849475: Geany INFO		: Added filetype Scala (78).
17:38:54.894323: Geany INFO		: Loaded libvte from libvte-2.91.so.0
17:38:54.915870: Geany INFO		: /home/gerhard/myGitRepos/Gerhard404/DEM/ReadMe.md : Markdown (UTF-8)
17:38:55.039709: (null) DEBUG	: Name com.canonical.AppMenu.Registrar does not exist on the session bus

17:38:58.619106: Geany INFO		: Added 40 plugin(s) in '/usr/local/lib/geany'.
17:38:58.636006: Gtk CRITICAL	: gtk_widget_get_preferred_width_for_height: assertion 'height >= 0' failed
17:39:03.976488: Geany INFO		: Loaded:   /usr/local/lib/geany/markdown.so (Markdown)

If I lauch geany from the command line, I see some errors:

KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Keine Berechtigung
Failed to create GBM buffer of size 801x536: Keine Berechtigung
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Keine Berechtigung
Failed to create GBM buffer of size 801x536: Keine Berechtigung
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Keine Berechtigung
Failed to create GBM buffer of size 801x536: Keine Berechtigung
Failed to create EGL images for DMABufs with file descriptors -1, -1 and -1

Any ideas what they could mean?
"Keine Berechtigung" means no permission.

@elextr
Copy link
Member

elextr commented Jan 22, 2024

Google says DRM_IOCTL_MODE_CREATE_DUMB failed messages are a bug in webkit2gtk that is fixed in a newer version (4.0-41 googling webkit bugzilla), so I guess you may need to wait for that to get into your distro. Interestingly it works here with 4.0-37 but on Cinnamon not KDE.

Just to confirm those messages are from markdown, first launch Geany from the command line with default configuration by geany -c /tmp/does_not_exist and see what messages show, then enable only the markdown plugin and see what messages show1, then open a markdown file and see that the DRM_IOCTL_MODE_CREATE_DUMB messages show.

Also you could see if the webhelper plugin has the same issues, it uses webkit2gtk as well.

Footnotes

  1. ignore the raft of messages when the plugin manager is opened, they are harmless and due to GTK ignoring its own stability guarantees.

@Gerhard404
Copy link
Author

I opened geany geany -c /tmp/foo, with foo not existing. I created a new markdown file, saved it and then opened the markdown-plugin. The error messages do indeed pop up, when the markdown plugin is active.

KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Keine Berechtigung
Failed to create GBM buffer of size 378x479: Keine Berechtigung
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Keine Berechtigung
Failed to create GBM buffer of size 378x479: Keine Berechtigung
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Keine Berechtigung
Failed to create GBM buffer of size 378x479: Keine Berechtigung
Failed to create EGL images for DMABufs with file descriptors -1, -1 and -1

Yes, webhelper also produced those error messages.

(geany:7774): WebHelper-WARNING **: 12:59:01.995: Failed to load configuration: Datei oder Verzeichnis nicht gefunden
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Keine Berechtigung
Failed to create GBM buffer of size 1321x260: Keine Berechtigung
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Keine Berechtigung
Failed to create GBM buffer of size 1321x260: Keine Berechtigung
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Keine Berechtigung
Failed to create GBM buffer of size 1321x260: Keine Berechtigung
Failed to create EGL images for DMABufs with file descriptors -1, -1 and -1

@elextr
Copy link
Member

elextr commented Jan 23, 2024

Ok, that indeed looks like its the webkit2gtk bug. So you only need to wait for your distro to provide the fixed version.

@themanyone
Copy link

Until they fix webkit.

WEBKIT_DISABLE_DMABUF_RENDERER=1 geany ...
or use export

From wailsapp/wails#2977 (comment) Oct 13, 2023

@rdipardo
Copy link

rdipardo commented Feb 2, 2024

Ok, that indeed looks like its the webkit2gtk bug. So you only need to wait for your distro to provide the fixed version.

Debian-based distros may not be so lucky until this RC bug is resolved: https://bugs.debian.org/1061406

Basically what @jbicha said already, but now the autoremoval clock is ticking for geany-plugins.

@elextr
Copy link
Member

elextr commented Feb 3, 2024

The situation is summarised here, and the current status is:

  • Webhelper, nobody has tested the Webhelper PR Various small WebHelper improvements #1295 which includes the switch to Webkit 4.1, so I guess it has no users who care, so it should not configure on Debian (and other distros) and not get built when old Webkit is removed
  • Markdown, nobody has provided a copy of the build patch (no code changes) from Various small WebHelper improvements #1295, so again it should not configure on Debian (and other distros) and not get built when old Webkit is removed
  • Updatechecker, really only useful on Windows (or Macos????) where the Geany project provides the binaries, so Debian should be disabling it as it doesn't look at their repositories (porting to libsoup3 will depend on its availability on those platforms)
  • Geniuspaste, has had no actual functionality changes for seven years, maybe its because it "just works" (oh look, a flying pig ;-) or because it has no users, anyway "somebody" needs to contribute a PR porting to Libsoup3, and until then it should not configure on Debian (and other distros) and not get built when old Libsoup2 is removed

As Geany-plugins is a collection, each plugin individually enables or disables based on availability of its dependencies during configure, so Debian should not have to do anything to have those plugins not build as above.

It should be noted that those on LTS distros (like me) do not have Libsoup3 available, and therefore not Webkit 4.1, so we can't test #1295 or provide any other PRs, but I really doubt that all geany contributors are on LTS distros, so until "somebody" contributes the patches those plugins will not get distributed, and maybe that will trigger contributions.

@jbicha
Copy link

jbicha commented Feb 3, 2024

@elextr Which distro version are you using? If your distro doesn't have libsoup3, then it probably does not have a version of webkitgtk that gets security updates. :(

For Ubuntu (click the diff link), I wrote a simple patch to switch Markdown to webkitgtk 4.1, added the proposed webhelper webkit 4.1 patch, and disabled the other 2 plugins.

@elextr
Copy link
Member

elextr commented Feb 4, 2024

@jbicha Ubuntu says 20.04 LTS has standard support until April 2025, so users would expect security updates, but for webkit2gtk they may not come from upstream if its not supporting it anymore.

Edit: although webkit2gtk 4.1 is API compatible with webkit2gtk 4.0, libsoup3 is not API compatible with libsoup2, so LTS precludes it replacing libsoup2 since it would require updating all dependent software, so that precludes wibkit2gtk 4.1 which uses libsoup3.

@jbicha
Copy link

jbicha commented Feb 4, 2024

Ubuntu 20.04 LTS no longer is supported by the webkitgtk project. Ubuntu Security also does not offer security support for webkitgtk for Ubuntu 20.04 LTS.

@jbicha
Copy link

jbicha commented Feb 4, 2024

I suggest adding a configure option for webkitgtk 4.0 / 4.1 defaulting to the 4.1 option. If 4.1 is selected, then it disables the plugins that are not supported yet.

@jbicha
Copy link

jbicha commented Feb 4, 2024

I wouldn't worry too much about the geany-plugins autoremoval warning in Debian. If the Maintainer does not act in time, I can do a non-maintainer upload to apply the same adjustments I did for Ubuntu.

@elextr
Copy link
Member

elextr commented Feb 4, 2024

It would be better to make PRs here so its available to all distros, not just specific ones. As I said it needs somebody to test it who has libsoup3/webkit 4.1 and somebody who has the old version to check that still falls back if the distro does not have the newer versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants