[webkit-gtk] WebKitWebView Process has Dock and task-switcher icons
jralls at ceridwen.fremont.ca.us
jralls at ceridwen.fremont.ca.us
Thu Oct 29 10:19:11 PDT 2020
> On Oct 28, 2020, at 3:17 PM, Adrian Perez de Castro <aperez at igalia.com> wrote:
>
> Hello!
>
> On Tue, 27 Oct 2020 16:45:50 -0700 jralls at ceridwen.fremont.ca.us wrote:
>
>> In WebKitGtk 2.28.2 when built with GdkQuartz on macOS, the
>> WebKitWebProcesses, one for each GtkWebKitWebView, produce tiles in the dock
>> and the process-switcher (the bar of icons that comes up when you press
>> command-tab) and a menubar. Worse, that's the process that gets focus when
>> you start an application or create a new tab.
>>
>> This is reproducible with the MiniBrowser. It's been observed with both
>> MacPorts and Gtk-OSX builds and there's even an unanswered Stack Overflow
>> question:
>> https://stackoverflow.com/questions/62918922/webkitwebprocess-makes-new-dock-icons.
>>
>> Any ideas on how to suppress this odd behavior?
>
> Not long ago I helped one of the persons working on the Nyxt browser [1] who
> had some idea about how to solve this. It involved adding calls to a Cocoa
> function that would prevent the additional entries in the dock and task
> switcher for the WebKitWebProcess instances launched for each tab.
>
> If you clone their MacPorts repository [2] with Git, there seems to be some
> patches for that. I don't know if there is some better way of achieving the
> same, but it would be nice if we could have a patch for this in the upstream
> repository—it would be great to have a maintainer taking care of keeping
> WebKitGTK working on MacOS, and I am sure that some of us would be glad to
> provide guidance and help out if someone would step up :-)
>
> I hope this helps,
> —Adrián
>
>
> ---
> [1] https://nyxt.atlas.engineer/
> [2] https://source.atlas.engineer/view/repository/macports-port
Thanks very much, it does. I found two files and two patches that together arrange for WebKitWebProcess to call
[NSApp setActivationPolicy: NSApplicationActivationPolicyProhibited]
on startup. It does work. BTW I found that the WebProcess/cocoa code takes a similar approach though it calls [NSApplication _preventDockConnections]
instead. It's declared in Source/WebCore/PAL/pal/spi/mac/NSApplicationSPI.h and not implemented anywhere so I suppose it would be unwise to use it.
As written the patches are unconditional so they're not suitable for upstreaming; that's also true of the other patches needed to get WebKitGtk to build on macOS. The last time I tried to submit patches to WebKitGtk it got bogged down in long and eventually pointless discussions about coding style that resulted in a WebKitGtk developer writing their own changes. While those were no doubt better than the patches I submitted the exercise wasted a great deal of my time and was an experience I'd prefer not to repeat. The patches are available at https://gitlab.gnome.org/GNOME/gtk-osx, https://github.com/macports/macports-ports/blob/master/www/webkit2-gtk/files/, and in the nyxt repo mentioned earlier in this thread. Help yourselves, or not.
Regards,
John Ralls
More information about the webkit-gtk
mailing list