[gtk-osx] Patch WebKit2Gtk3 so that WebKitWebProcess doesn't have a dock tile.



commit 9cfa84c41c00350b691dc7725bbec07cba95b2a9
Author: John Ralls <jralls ceridwen us>
Date:   Fri Oct 30 12:53:10 2020 -0700

    Patch WebKit2Gtk3 so that WebKitWebProcess doesn't have a dock tile.

 modulesets-stable/gtk-osx-network.modules          |  1 +
 modulesets-unstable/gtk-osx-network.modules        |  1 +
 modulesets/gtk-osx-network.modules                 |  1 +
 ...KitWebProcess-from-being-in-the-dock-or-p.patch | 80 ++++++++++++++++++++++
 4 files changed, 83 insertions(+)
---
diff --git a/modulesets-stable/gtk-osx-network.modules b/modulesets-stable/gtk-osx-network.modules
index 61412ee..568a119 100644
--- a/modulesets-stable/gtk-osx-network.modules
+++ b/modulesets-stable/gtk-osx-network.modules
@@ -216,6 +216,7 @@
       <patch 
file="https://gitlab.gnome.org/GNOME/gtk-osx/raw/master/patches/patch-webkit2gtk-2282-os-log-availability.diff";
 strip="0"/>
       <patch file="https://gitlab.gnome.org/GNOME/gtk-osx/raw/master/patches/patch-bundle-link-webcore.diff"; 
strip="0"/>
       <patch file="https://gitlab.gnome.org/GNOME/gtk-osx/raw/master/patches/webkit-clang-fixes.patch"; 
strip="0"/>
+      <patch 
file="https://gitlab.gnome.org/GNOME/gtk-osx/raw/master/patches/0001-Prevent-WebKitWebProcess-from-being-in-the-dock-or-p.patch";
 strip="1"/>
     </branch>
     <dependencies>
       <dep package="libwebp"/>
diff --git a/modulesets-unstable/gtk-osx-network.modules b/modulesets-unstable/gtk-osx-network.modules
index e7f7ada..321f74e 100644
--- a/modulesets-unstable/gtk-osx-network.modules
+++ b/modulesets-unstable/gtk-osx-network.modules
@@ -213,6 +213,7 @@
       <patch 
file="https://gitlab.gnome.org/GNOME/gtk-osx/raw/master/patches/patch-webkit2gtk-2282-os-log-availability.diff";
 strip="0"/>
       <patch file="https://gitlab.gnome.org/GNOME/gtk-osx/raw/master/patches/patch-bundle-link-webcore.diff"; 
strip="0"/>
       <patch file="https://gitlab.gnome.org/GNOME/gtk-osx/raw/master/patches/webkit-clang-fixes.patch"; 
strip="0"/>
+      <patch 
file="https://gitlab.gnome.org/GNOME/gtk-osx/raw/master/patches/0001-Prevent-WebKitWebProcess-from-being-in-the-dock-or-p.patch";
 strip="1"/>
     </branch>
     <dependencies>
       <dep package="libwebp"/>
diff --git a/modulesets/gtk-osx-network.modules b/modulesets/gtk-osx-network.modules
index 4030bf9..a0c7208 100644
--- a/modulesets/gtk-osx-network.modules
+++ b/modulesets/gtk-osx-network.modules
@@ -218,6 +218,7 @@
       <patch 
file="https://gitlab.gnome.org/GNOME/gtk-osx/raw/master/patches/patch-webkit2gtk-2282-os-log-availability.diff";
 strip="0"/>
       <patch file="https://gitlab.gnome.org/GNOME/gtk-osx/raw/master/patches/patch-bundle-link-webcore.diff"; 
strip="0"/>
       <patch file="https://gitlab.gnome.org/GNOME/gtk-osx/raw/master/patches/webkit-clang-fixes.patch"; 
strip="0"/>
+      <patch 
file="https://gitlab.gnome.org/GNOME/gtk-osx/raw/master/patches/0001-Prevent-WebKitWebProcess-from-being-in-the-dock-or-p.patch";
 strip="1"/>
     </branch>
     <dependencies>
       <dep package="libwebp"/>
diff --git a/patches/0001-Prevent-WebKitWebProcess-from-being-in-the-dock-or-p.patch 
b/patches/0001-Prevent-WebKitWebProcess-from-being-in-the-dock-or-p.patch
new file mode 100644
index 0000000..44c6686
--- /dev/null
+++ b/patches/0001-Prevent-WebKitWebProcess-from-being-in-the-dock-or-p.patch
@@ -0,0 +1,80 @@
+From 338ef8630d4aa8c15d33e66f438bc5862d4dc930 Mon Sep 17 00:00:00 2001
+From: John Ralls <jralls ceridwen us>
+Date: Thu, 29 Oct 2020 18:30:08 -0700
+Subject: [PATCH] Prevent WebKitWebProcess from being in the dock or process
+ switcher.
+
+Thanks to the Nyxt browser project, https://nyxt.atlas.engineer/.
+---
+ Source/WebKit/PlatformGTK.cmake                               |  4 ++++
+ Source/WebKit/WebProcess/gtk/NSApplicationActivationPolicy.h  |  4 ++++
+ Source/WebKit/WebProcess/gtk/NSApplicationActivationPolicy.mm | 10 ++++++++++
+ Source/WebKit/WebProcess/gtk/WebProcessMainGtk.cpp            |  2 ++
+ 4 files changed, 20 insertions(+)
+ create mode 100644 Source/WebKit/WebProcess/gtk/NSApplicationActivationPolicy.h
+ create mode 100644 Source/WebKit/WebProcess/gtk/NSApplicationActivationPolicy.mm
+
+diff --git a/Source/WebKit/PlatformGTK.cmake b/Source/WebKit/PlatformGTK.cmake
+index f6abc65..7214829 100644
+--- a/Source/WebKit/PlatformGTK.cmake
++++ b/Source/WebKit/PlatformGTK.cmake
+@@ -32,6 +32,10 @@ list(APPEND WebKit_UNIFIED_SOURCE_LIST_FILES
+     "SourcesGTK.txt"
+ )
+ 
++find_library(APPKIT_FRAMEWORK NAMES AppKit)
++target_link_libraries(WebKit PRIVATE ${APPKIT_FRAMEWORK})
++list(APPEND WebKit_SOURCES WebProcess/gtk/NSApplicationActivationPolicy.mm)
++
+ list(APPEND WebKit_MESSAGES_IN_FILES
+     UIProcess/ViewGestureController.messages.in
+ 
+diff --git a/Source/WebKit/WebProcess/gtk/NSApplicationActivationPolicy.h 
b/Source/WebKit/WebProcess/gtk/NSApplicationActivationPolicy.h
+new file mode 100644
+index 0000000..7285942
+--- /dev/null
++++ b/Source/WebKit/WebProcess/gtk/NSApplicationActivationPolicy.h
+@@ -0,0 +1,4 @@
++
++// This is the C "trampoline" function that will be used
++// to invoke a specific Objective-C method FROM C++
++void SetActivationPolicyProhibited ();
+diff --git a/Source/WebKit/WebProcess/gtk/NSApplicationActivationPolicy.mm 
b/Source/WebKit/WebProcess/gtk/NSApplicationActivationPolicy.mm
+new file mode 100644
+index 0000000..ce1d75c
+--- /dev/null
++++ b/Source/WebKit/WebProcess/gtk/NSApplicationActivationPolicy.mm
+@@ -0,0 +1,10 @@
++#include "config.h"
++#import "NSApplicationActivationPolicy.h"
++#import <AppKit/AppKit.h>
++
++// C "trampoline" function to invoke Objective-C method
++void SetActivationPolicyProhibited ()
++{
++    [NSApp setActivationPolicy: NSApplicationActivationPolicyProhibited];
++    return;
++}
+diff --git a/Source/WebKit/WebProcess/gtk/WebProcessMainGtk.cpp 
b/Source/WebKit/WebProcess/gtk/WebProcessMainGtk.cpp
+index 6a4a822..5b4064f 100644
+--- a/Source/WebKit/WebProcess/gtk/WebProcessMainGtk.cpp
++++ b/Source/WebKit/WebProcess/gtk/WebProcessMainGtk.cpp
+@@ -33,6 +33,7 @@
+ #include <gtk/gtk.h>
+ #include <libintl.h>
+ #include <libsoup/soup.h>
++#include "NSApplicationActivationPolicy.h"
+ 
+ #if PLATFORM(X11)
+ #include <X11/Xlib.h>
+@@ -58,6 +59,7 @@ public:
+ 
+         bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR);
+         bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
++        SetActivationPolicyProhibited ();
+ 
+         return true;
+     }
+-- 
+2.2.2
+


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]