akirakyle / emacs-webkit

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

webkit not show. #12

Closed tumashu closed 4 years ago

tumashu commented 4 years ago

Hello, I have try emacs-webkit, compile and require is no problem, but when I use webkit command to open www.baidu.com, the webpage is not showed, does emacs need enable some feature?

I use native-comp branch at the moment, the below is my build.sh

#!/bin/bash

cd ${HOME}/emacs/emacs.git

git clean -df
git checkout feature/native-comp
git pull

make clean

date=$(date +%Y%m%d)

./configure --prefix="${HOME}/emacs/emacs28-gtk-${date}" --with-nativecomp
make
make install
tumashu commented 4 years ago

when I set (setq webkit-own-window t), I can see a emacs webkit window, but the size is very small.

tumashu commented 4 years ago

图片

edgar-vincent commented 4 years ago

I have the exact same problem running this native comp build on Arch Linux.

akirakyle commented 4 years ago

Can you try running with make debug and posting the stdout from that?

xircon commented 4 years ago

Same here too, Archlinuxcn build of native comp. This is probably not what you want:

make debug
cc -shared -std=c99 -Wall -Wextra -Wno-unused-parameter -O3 -fpic  `pkg-config --cflags gtk+-3.0 webkit2gtk-4.0 --libs webkit2gtk-4.0` -DDEBUG -g -o webkit-module.so webkit-module.c

But I tried!!!

tumashu commented 4 years ago
Compilation started.
init webkit-module
window 0x55b32e142290 focused 1
widget 0x55b32e145190; fixed 0; type GtkBox
widget 0x55b32e1452f0; fixed 0; type GtkBox
widget 0x55b32e146130; fixed 1; type EmacsFixed
moving 0x55b3343607e0 to from (nil) to 0x55b32e146130
moving 0x55b3343607e0 to window_id 0x3a00146
window 0x55b32e142290 focused 1
window 0x55b32f77e290 focused 0
window 0x55b32e3daa50 focused 0
moving 0x55b3343607e0 to window_id 0x3a00146
window 0x55b32e142290 focused 1
window 0x55b32f77e290 focused 0
window 0x55b32e3daa50 focused 0
https://ss1.bdstatic.com/5eN1bjq8AAUYm2zgoY3K/r/www/cache/static/protocol/https/global/js/all_async_search_6ab4848.js:189:551: CONSOLE LOG 每一个星球都有一个驱动核心,
每一种思想都有影响力的种子。
感受世界的温度,
年轻的你也能成为改变世界的动力,
百度珍惜你所有的潜力。
你的潜力,是改变世界的动力!

https://ss1.bdstatic.com/5eN1bjq8AAUYm2zgoY3K/r/www/cache/static/protocol/https/global/js/all_async_search_6ab4848.js:189:658: CONSOLE LOG %c百度2021校园招聘简历投递:https://talent.baidu.com/external/baidu/campus.html color:red

----------------- I type "f" or "b" -------------------------

moving 0x55b3343607e0 to window_id 0x3a00146
window 0x55b32e142290 focused 1
window 0x55b32f77e290 focused 0
window 0x55b32e3daa50 focused 0
moving 0x55b3343607e0 to window_id 0x3a00146
window 0x55b32e142290 focused 1
window 0x55b32f77e290 focused 0
window 0x55b32e3daa50 focused 0
moving 0x55b3343607e0 to window_id 0x3a00146
window 0x55b32e142290 focused 1
window 0x55b32f77e290 focused 0
window 0x55b32e3daa50 focused 0
moving 0x55b3343607e0 to window_id 0x3a00146
window 0x55b32e142290 focused 1
window 0x55b32f77e290 focused 0
window 0x55b32e3daa50 focused 0
moving 0x55b3343607e0 to window_id 0x3a00146
window 0x55b32e142290 focused 1
window 0x55b32f77e290 focused 0
window 0x55b32e3daa50 focused 0
moving 0x55b3343607e0 to window_id 0x3a00146
window 0x55b32e142290 focused 1
window 0x55b32f77e290 focused 0
window 0x55b32e3daa50 focused 0
tumashu commented 4 years ago

图片

tumashu commented 4 years ago
Loading 0%...
id: webkit--callback-progress; message: 10.000000
Loading 10%...
id: webkit--callback-uri; message: about:blank
id: webkit--callback-progress; message: 100.000000
Loading 100%...
id: webkit--load-finished; message: 
id: webkit--callback-progress; message: 10.000000
Loading 10%...
id: webkit--callback-progress; message: 30.000000
Loading 30%...
id: webkit--callback-uri; message: https://www.baidu.com/
id: webkit--callback-title; message: 百度一下,你就知道
Error during redisplay: (webkit--adjust-size #<frame *webkit* - GNU Emacs at debian 0x5615f06aeae0>) signaled (webkit-module-no-fixed-widget)
Error during redisplay: (webkit--adjust-size #<frame 百度一下,你就知道 - GNU Emacs at debian 0x5615f06aeae0>) signaled (webkit-module-no-fixed-widget)
tumashu commented 4 years ago
init webkit-module
window 0x55c452f06290 focused 1
widget 0x55c452f08190; fixed 0; type GtkBox
widget 0x55c452f082f0; fixed 0; type GtkBox
widget 0x55c452f09130; fixed 1; type EmacsFixed
moving 0x55c462b19130 to from (nil) to 0x55c452f09130
moving 0x55c462b19130 to window_id 0x3a00146
window 0x55c452f06290 focused 1
window 0x55c45375e300 focused 0
window 0x55c45317ea70 focused 0
moving 0x55c462b19130 to window_id 0x3a00146
window 0x55c452f06290 focused 1
window 0x55c45375e300 focused 0
window 0x55c45317ea70 focused 0
moving 0x55c462b19130 to window_id 0x3a00146
window 0x55c452f06290 focused 1
window 0x55c45375e300 focused 0
window 0x55c45317ea70 focused 0
https://ss1.bdstatic.com/5eN1bjq8AAUYm2zgoY3K/r/www/cache/static/protocol/https/global/js/all_async_search_efe1dcc.js:189:551: CONSOLE LOG 每一个星球都有一个驱动核心,
每一种思想都有影响力的种子。
感受世界的温度,
年轻的你也能成为改变世界的动力,
百度珍惜你所有的潜力。
你的潜力,是改变世界的动力!

https://ss1.bdstatic.com/5eN1bjq8AAUYm2zgoY3K/r/www/cache/static/protocol/https/global/js/all_async_search_efe1dcc.js:189:658: CONSOLE LOG %c百度2021校园招聘简历投递:https://talent.baidu.com/external/baidu/campus.html color:red
moving 0x55c462b19130 to window_id 0x3a00146
window 0x55c452f06290 focused 1
window 0x55c45375e300 focused 0
window 0x55c45317ea70 focused 0
moving 0x55c462b19130 to window_id 0x3a00146
window 0x55c452f06290 focused 1
window 0x55c45375e300 focused 0
window 0x55c45317ea70 focused 0
webkit
Wrote /home/feng/.emacs.d/recentf
Error during redisplay: (webkit--adjust-size #<frame *webkit* - GNU Emacs at debian 0x55c452dc1cc0>) signaled (webkit-module-no-fixed-widget)
id: webkit--callback-uri; message: about:blank
id: webkit--callback-progress; message: 10.000000
Loading 10%...
id: webkit--callback-uri; message: https://www.baidu.com/
id: webkit--callback-progress; message: 0.000000
Loading 0%...
id: webkit--callback-progress; message: 10.000000
Loading 10%...
id: webkit--callback-uri; message: about:blank
id: webkit--callback-progress; message: 100.000000
Loading 100%...
id: webkit--load-finished; message: 
id: webkit--callback-progress; message: 10.000000
Loading 10%...
id: webkit--callback-progress; message: 30.000000
Loading 30%...
id: webkit--callback-uri; message: https://www.baidu.com/
id: webkit--callback-title; message: 百度一下,你就知道
Error during redisplay: (webkit--adjust-size #<frame *webkit* - GNU Emacs at debian 0x55c452dc1cc0>) signaled (webkit-module-no-fixed-widget)
Error during redisplay: (webkit--adjust-size #<frame 百度一下,你就知道 - GNU Emacs at debian 0x55c452dc1cc0>) signaled (webkit-module-no-fixed-widget)
id: webkit--callback-progress; message: 86.755780
Loading 87%...
id: webkit--callback-progress; message: 89.844583
Loading 90%...
id: webkit--callback-progress; message: 100.000000
Loading 100%...
id: webkit--load-finished; message: 
Added to /home/feng/.emacs.d/webkit-history
Error during redisplay: (webkit--adjust-size #<frame 百度一下,你就知道 - GNU Emacs at debian 0x55c452dc1cc0>) signaled (webkit-module-no-fixed-widget) [2 times]
Mark set [2 times]
yqu212 commented 4 years ago

I have the same issue as @tumashu but on emacs master branch.

emacs 28.0.50 master branch spacemacs develop branch Arch Linux on WSL webkit2gtk

akirakyle commented 4 years ago

Hmmm alright I'll spin up an arch linux vm to see if I can reproduce this there.

yqu212 commented 4 years ago

Thanks.

tumashu commented 4 years ago

I use debian stable :-)

yqu212 commented 4 years ago

Maybe this issue is related to #7 .

akirakyle commented 4 years ago

So I wasn't able to reproduce on debian stable. Could you see if you still get this issue with emacs -Q?

akirakyle commented 4 years ago

Oh wait, disregard that, I am able to reproduce. I had gotten so used to always building --with-pgtk, I forgot you all are running --with-x

This is interesting, previously when I had tested --with-x, it had just suffered the flickering issue that affects xwidgets but this doesn't seem to even be rendering. Alas the horrors of Emacs on X. It may be related to #7, in which case it should hopefully be straightforward to fix, but if it turns out to be something with how Emacs abuses handles gtk with x11, then it may be much harder to diagnose the issue. Given that pgtk just landed upstream, my motivation to debug X bugs will probably continue to lessen.

inigoserna commented 4 years ago

First all, thanks for this awesome work.

I observed this behaviour in my X/gtk builds, no matter the branch (master or nativecomp), but it works perfectly with the pgtk branch. It often happens to me with xwidget-webkit as well, so I think you are right on your assumptions regarding emacs interaction with X/gtk..

Btw, I'm using Fedora 33 so it doesn't look this is a distro package problem either.

edgar-vincent commented 4 years ago

I can confirm that the issue doesn't appear when using emacs-native-comp-git-enhanced on Arch Linux (which is compiled with pgtk support enabled).

xircon commented 4 years ago

emacs-native-comp-git-enhanced fixes webkit, but breaks my hyper keybindings, so is a no go I am afraid :(

akirakyle commented 4 years ago

@xircon that sounds like a bug in pgtk, you might want to report it to https://github.com/masm11/emacs, or maybe create an emacs bug report? Now that pgtk is in an upstream branch I'm not sure where @masm11 wants bug reports to go.

akirakyle commented 4 years ago

I think I fixed this issue, so emacs --with-x should now display webkit, albeit probably with the same flickering behavior that currently plagues xwidgets on x. Can you all confirm that this is the case?

tumashu commented 4 years ago

wow, I will try next week, I have faced flickering too in debian stable, xwidget and EAF, if emacs-webkit has the same problem, maybe xserver' problem, maybe we should try a newer verson of xserver

yqu212 commented 4 years ago

@akirakyle Yes. Emacs displays webkit now, but it also begins to flicker.

inigoserna commented 4 years ago

I think I fixed this issue, so emacs --with-x should now display webkit, albeit probably with the same flickering behavior that currently plagues xwidgets on x. Can you all confirm that this is the case?

I can confirm that it works now but, as you said, with lots of flickering.

Master and nativecomp branches, on Fedora 33.

Thanks!

tumashu commented 4 years ago
I can confirm that it works now but, as you said, with lots of flickering.

my emacs too, but if emacs lost focus, it do not flickering,

tumashu commented 4 years ago

I think the flickering is: switch to emacs -> switch to webkit -> switch to emacs ....

yqu212 commented 4 years ago

If there are any keyboard input, I can see the cursor on a blank emacs webkit buffer and webkit flickers at the same time. So I agree with @tumashu that the flickering is about focus.

akirakyle commented 4 years ago

Let's move this discussion on the flickering to #18 since it looks like the original bug for this issue is fixed. I just posted an update on the flickering issue there.

tumashu commented 4 years ago

good idea