michaelforney / swc

a library for making a simple Wayland compositor
MIT License
626 stars 53 forks source link

Implement xdg_popup #61

Open michaelforney opened 4 years ago

michaelforney commented 4 years ago

Originally reported in https://github.com/michaelforney/velox/issues/37.

swc needs to implement (stubs at least) xdg_popup in xdg_shell.get_popup, otherwise it will crash when clients call requests on the popup object.

ianbeyst commented 4 years ago

If you're interested, I did some basic work on this a while back in my fork of the repository. I think the quality of the implementation is quite low, but maybe I can scrounge together a pull request if you give me some pointers how to improve? I'm not at all at home in this kind of programming, it was mostly educational. It does seem functional. I also have a basic subsurface functionality, firefox works! but quite glitchy...

ianbeyst commented 4 years ago

Here's the relevant commit: xdg-shell implementation

michaelforney commented 4 years ago

I'm definitely interested in such a pull request! On first glance, it looks like a really good start.

@bqv was also interested in helping out with this.

bqv commented 4 years ago

This looks great! I'm happy to test and help tweak it. At least seeing it helps me understand how everything fits together.

ianbeyst commented 4 years ago

@bqv maybe you can start by checking if the changes in the commit I linked work for you? Also, @sdsddsd1, does using the linked commit fix your issues? If they do, I can just clean up the code a bit and make a pull request. Else please share what still goes wrong, then I can see if I can find some time to work on it in the near future and fix it.

sdsddsd1 commented 4 years ago

Thanks for working on this! By now I could test qt5-based browsers. I have tested qutebrowser and falkon. Its Qt5.15.

ianbeyst commented 4 years ago

Did you checkout commit 86be336 I linked above, or did you use the most recent commit from the branch? Because after that commit I started working on subsurfaces, in the process of which I introduced some glitches that seem familiar to what you're describing. In any case, I'll try to reproduce these issues and see if I can fix them.

sdsddsd1 commented 4 years ago

I rarely work with branches other than master. So lets just verify if I am on the same page:

git clone https://github.com/ianbeyst/swc.git
git checkout 86be336e59c9adc3771fb15bd590d39469d52d05
make
...

Webkit2gtk works. No crashes. Right click on links works pretty reproduceable. When I miss a link I have to hit escape to "reset" right click to be able to open the context menu again. Sometimes the contextmenu is a little out of place.

Qt5 is still as my post before. The contextmenu appears very rarely. Falkon becomes unresponsive.

Edit: I was indeed on the latest commit before.

bqv commented 4 years ago

@ianbeyst I've been running the tip of your branch for a day or two, I've noticed zero popup-related crashes, and your subsurface patch gets firefox vaguely running for me too!

It does however turn firefox into a disco-style seizure prompt, so that perhaps needs more work.

One thing I've noticed at least in my case, is that the context menus don't appear to pop up at all anywhere - presumably the issue you just described for @sdsddsd1

ianbeyst commented 4 years ago

@bqv: Yes, the disco-style seizure glitch is due to the subsurface double-buffering with a blank buffer, which I couldn't figure out why that's happening (yet). I'll try to find some time this weekend to work on reproducing all of these issues and seeing if I can fix them. Thanks for the bug testing everybody!