akirakyle / emacs-webkit

An Emacs Dynamic Module for WebKit, aka a fully fledged browser inside emacs
GNU General Public License v3.0
419 stars 24 forks source link

No focused widget error on pgtk emacs #7

Closed bqv closed 3 years ago

bqv commented 3 years ago

Stack trace:

Debugger entered--Lisp error: (webkit-module-no-focused-fixed-widget . "webkit-module-no-focused-fixed-widget")
  webkit--new(#<process webkit> nil)
  (setq webkit--id (webkit--new (make-pipe-process :name "webkit" :buffer buffer :filter 'webkit--filter :noquery noquery) webkit-own-window))
  (save-current-buffer (set-buffer buffer) (webkit-mode) (setq webkit--id (webkit--new (make-pipe-process :name "webkit" :buffer buffer :filter 'webkit--filter :noquery noquery) webkit-own-window)) (setq webkit--buffers (cons buffer webkit--buffers)) (webkit--register-script-message webkit--id "webkit--callback-unfocus") (webkit--add-user-script webkit--id webkit--script) (webkit--add-user-style webkit--id webkit--style) (if url (progn (webkit--load-uri webkit--id url))) (run-hooks 'webkit-new-hook) (switch-to-buffer buffer))
  (let ((buffer (generate-new-buffer (or buffer-name "*webkit*")))) (save-current-buffer (set-buffer buffer) (webkit-mode) (setq webkit--id (webkit--new (make-pipe-process :name "webkit" :buffer buffer :filter 'webkit--filter :noquery noquery) webkit-own-window)) (setq webkit--buffers (cons buffer webkit--buffers)) (webkit--register-script-message webkit--id "webkit--callback-unfocus") (webkit--add-user-script webkit--id webkit--script) (webkit--add-user-style webkit--id webkit--style) (if url (progn (webkit--load-uri webkit--id url))) (run-hooks 'webkit-new-hook) (switch-to-buffer buffer)))
  webkit-new("http://qwant.com/")
  (if (or new-session (not webkit--buffers)) (webkit-new url) (let* ((id (or webkit--id (save-current-buffer (set-buffer (car webkit--buffers)) webkit--id))) (buffer (seq-find #'(lambda (buffer) (save-current-buffer ... ...)) webkit--buffers))) (webkit--load-uri id url) (switch-to-buffer buffer)))
  webkit-browse-url("http://qwant.com/" nil)
  (let ((eww-search-prefix webkit-search-prefix)) (webkit-browse-url (eww--dwim-expand-url url) (eq arg 4)))
  webkit("qwant.com" 1)
  funcall-interactively(webkit "qwant.com" 1)
  command-execute(webkit record)
  counsel-M-x-action("webkit")
  ivy-call()
bqv commented 3 years ago

For clarification, this happened to be over X Forwarding. I feel like that might be the main issue

bqv commented 3 years ago

For further clarification, the forwarding was to an XWayland host, so that might have been a pretty major issue quite understandably anyway

bqv commented 3 years ago

For double unclarification, I get the same error on a direct pgtk wayland session, so ignore the last two comments

akirakyle commented 3 years ago

I think this is related to the other issue you posted in #8, since if you are using tool-bar-mode or menu-bar-mode, this is the module error that should be thrown instead of peculiar error. I need to work on making the GtkWidget tree traversal better anyways, so hopefully that will solve this.

lucaspwbx commented 3 years ago

Error during redisplay: (webkit--adjust-size #<frame Minibuf-1 – Doom Emacs 0x55bb64d98350>) signaled (webkit-module-no-fixed-widget)

tool-bar-mode and menu-bar-mode are disabled

the following is what doom info returns, let me know if I have to provide more debug information

SYSTEM  type       gnu/linux
    config     x86_64-pc-linux-gnu
    shell      /bin/bash
    uname      Linux 5.9.9-arch1-1 #1 SMP PREEMPT Wed, 18 Nov 2020 19:52:04 +0000 x86_64
    path       (~/.npm-global/bin ~/.yarn/bin ~/.config/yarn/global/node_modules/.bin ~/.local/bin /usr/local/bin/nvim/bin ~/apps ~/.gem/ruby/2.6.0/bin ~/.vim/plugged/vim-iced/bin ~/.sdkman/candidates/maven/current/bin ~/.sdkman/candidates/java/current/bin ~/.npm-global/bin ~/.yarn/bin ~/.config/yarn/global/node_modules/.bin ~/.local/bin /usr/local/bin/nvim/bin ~/apps ~/.gem/ruby/2.6.0/bin ~/.vim/plugged/vim-iced/bin /usr/local/sbin /usr/local/bin /usr/bin /usr/lib/jvm/default/bin /opt/oracle/product/18c/dbhomeXE/bin /usr/bin/site_perl /usr/bin/vendor_perl /usr/bin/core_perl ~/.composer/vendor/bin ~/.emacs.d/bin ~/go/bin ~/.composer/vendor/bin ~/.emacs.d/bin ~/go/bin /usr/lib/emacs/28.0.50/x86_64-pc-linux-gnu)
EMACS   dir        ~/.emacs.d/
    version    28.0.50
    build      Nov 10, 2020
    buildopts  --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib --localstatedir=/var --mandir=/usr/share/man --with-gameuser=:games --with-sound=alsa --with-modules --without-gconf --without-gsettings --with-nativecomp --with-x-toolkit=gtk3 --without-xaw3d --without-m17n-flt --with-cairo --without-compress-install 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -g -fuse-ld=gold -g -fuse-ld=gold' CPPFLAGS=-D_FORTIFY_SOURCE=2 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now
    features   XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND GPM DBUS GLIB NOTIFY INOTIFY ACL GNUTLS LIBXML2 FREETYPE HARFBUZZ LIBOTF ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES NATIVE_COMP THREADS LIBSYSTEMD JSON PDUMPER LCMS2
    traits     (batch server-running)
DOOM    dir        ~/.doom.d/
    version    2.0.9
    build      HEAD -> develop c83e5e75e 2020-11-21 14:09:08 -0500
    elc-files  0
    modules    (:completion company ivy :ui doom doom-dashboard doom-quit hl-todo indent-guides modeline nav-flash ophints (popup +defaults) treemacs vc-gutter vi-tilde-fringe window-select :editor (evil +everywhere) fold (format +onsave) multiple-cursors snippets :emacs dired electric undo vc :term vterm :checkers syntax :tools ansible docker (eval +overlay) gist lookup lsp (&nopath +java +python +php +javascript +clojure +web) magit make terraform tmux :lang clojure data emacs-lisp java javascript (latex +latexmk +cdlatex) markdown (org +pandoc) php python sh yaml web :config (default +bindings +smartparens))
    packages   ((pdf-tools) (org-noter) (org-ref) (helm-org-rifle) (company-posframe) (modus-operandi-theme) (modus-vivendi-theme) (org-superstar) (org-roam :recipe (:host github :repo org-roam/org-roam)) (org-roam-bibtex :recipe (:host github :repo org-roam/org-roam-bibtex)) (burly :recipe (:host github :repo alphapapa/burly.el)) (rg) (saveplace-pdf-view) (lsp-mode) (lsp-latex) (lsp-java) (mpv) (evil-leader) (magithub) (command-log-mode) (elfeed) (super-save) (crux) (bm) (annotate) (pkgbuild-mode) (saveplace) (vterm-toggle) (yasnippet-snippets) (company-box) (org-transclusion :recipe (:host github :repo nobiot/org-transclusion :branch main :files (org-transclusion.el))) (pdf-continuous-scroll-mode :recipe (:host github :repo dalanicolai/pdf-continuous-scroll-mode.el :branch master :files (pdf-continuous-scroll-mode.el))) (emacs-webkit :recipe (:host github :repo akirakyle/emacs-webkit :branch main :files (Makefile emacs-module.h evil-collection-webkit.el hints.css hints.js script.js style.css webkit-ace.el webkit-history.el webkit-module.c webkit.el))))
    unpin      (n/a)
    elpa       (vagrant tsc tree-sitter-langs tree-sitter swiper ivy elisp-benchmarks counsel-tramp counsel)
progfolio commented 3 years ago

Confirming error.

tool-bar-mode and menu-bar-mode disabled.

akirakyle commented 3 years ago

Can you try out the latest commit I just pushed f14fabc and see if that fixes this issue?

bqv commented 3 years ago

Works for me. You're a star

bqv commented 3 years ago

I note that this error still happens if there is no gui frame at all, but as that's a separate issue if any, I'll close this

akirakyle commented 3 years ago

Yeah that's the intended error to be thrown when no gui frame and webkit-own-window hasn't been set. There's probably more to be done in making this all graceful.