What could cause a webView in a gnome-shell extension to not pick up on mouse pointer motion?

I’ve been trying to solve this issue, and I’m just hoping for someone with some expertise to maybe be able to point me in the right direction because I feel like I’ve tried everything; I am by no means experienced working with GJS, although I’ve read a lot of documentation in the last couple days.

this is my question on stack overflow with code, I will try to be as concise as possible in summarizing the question here.

I have a gnome-shell extension which, when a St.bin classed button in the tool bar is pressed, creates a top level, undecorated, Gtk.Window object and adds a WebKit2.WebView to it, then shows it.
The webview reacts as expected to keyboard input, and websites react when the mouse pointer passes over the edge of the window, however it seems the webview is not picking up events related to pointer movement inside the window, scrolling, or clicking/mouse button.

Every similar code sample I’ve seen online would seem to suggest that a webview inside a window should work with no further configuration, it should at least scroll according to the documentation. I have tried using in-between containers like EventBox or Frame, or calling widget.connect to an event with no success. At this point I suspect the mouse events are not propagating to the webview widget because of some specific quirk of how gnome-shell extensions are run differently form apps, but this is conjecture on my part.

I am at my wit’s end, and would be deeply appreciative if anyone could recommend an approach to try or some example of a similar case to look into. Most related guides seem to either open the webView inside an appWIndow, or only have popupMenu elements for extensions.

Are you trying to use gtk from the gnome-shell process itself? That’s not supported and could lead to issues like the one you described. If you want to use gtk you’d have to start a separate process from your extension.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.