DomTerm icon indicating copy to clipboard operation
DomTerm copied to clipboard

problems on WebKit/WebKitGtk

Open PerBothner opened this issue 4 years ago • 1 comments

WebKit-based browsers (at least WebKitGtk) have some extra issues. This affects Gnome Web (Epiphany), Wry, WebView.

  • Neither beforeunload or pagehide event is fired on window close, which means we don't send CLOSE-SESSION to the backend. This makes it harder to cleanly shutdown - we can't distinguish window-close from connection failure. The work-around is to close the session when the WebSocket connection closes. A possible fix is to detect whether the brower-application exited. If using a custom titlebar, we can catch click on the (custom) close button.

  • The toggle-minimize command doesn't work due to this issue.

  • Gtk defaults to "overlay scrollbars". These save space but make it impossible to click in the rightmost column. Either disable overlay scrollbars (gtk_scrolled_window_set_overlay_scrolling); add extra padding on the right; or make sure nothing needs to be clicked in the right column (including rethinking shell-integration show/hide buttons).

    Setting GTK_OVERLAY_SCROLLING=0 works for Gtk3 (but is supposedly ignored for Gtk4). This is now done automatically for wry and webview front-ends.

  • setDragImage doesn't handle the x-offset and y-offset arguments correctly.

    This has been fixed upstream but may take a while to percolate to distributions.

PerBothner avatar Sep 10 '21 22:09 PerBothner

The following used to be a problem, but appears to be fixed in webkitgtk-2.34.5 / appleWebKit:-605.1.15:

  • Setting white-space: pre doesn't work if an ancestor is contenteditable. See bug report. Instead, the data is wrapped. This means insertSimpleOutput doesn't realize it needs to insert a soft line-break.

    It seems to work to not set contenteditable on the topNode. I believe it was set as a partial (Chrome-specific) work-around for the lack use 'user-select: contain` in info-widgets. It might be better to use an iframe for each info-widget - but correctly sizing the widgets is more complicated.

PerBothner avatar Feb 19 '22 23:02 PerBothner

I removed this sub-issue. The fix has made it to Fedora 37, at least.

  • setDragImage doesn't handle the x-offset and y-offset arguments correctly. This has been fixed upstream but may take a while to percolate to distributions.

PerBothner avatar Feb 05 '23 21:02 PerBothner

I removed this sub-issue. Fixed (for Wry front-end) by having the front-end detect window-close, and communicate with the server.

  • Neither beforeunload or pagehide event is fired on window close, which means we don't send CLOSE-SESSION to the backend. This makes it harder to cleanly shutdown - we can't distinguish window-close from connection failure. The work-around is to close the session when the WebSocket connection closes. A possible fix is to detect whether the brower-application exited. If using a custom titlebar, we can catch click on the (custom) close button.

PerBothner avatar Feb 05 '23 22:02 PerBothner

This sub-issue is also fixed now:

  • The toggle-minimize command doesn't work due to this issue.

PerBothner avatar Feb 06 '23 22:02 PerBothner

I think this is working well enough now to close the issue. There are still things to fix - most critically we don't have proper menubar support on macOS.

PerBothner avatar Feb 06 '23 23:02 PerBothner