summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO22
-rw-r--r--PKGBUILD20
-rw-r--r--meta_clip_effect.c114
-rw-r--r--rounded_corners.patch266
-rw-r--r--shader.h126
-rw-r--r--shell_blur_effect.patch92
6 files changed, 366 insertions, 274 deletions
diff --git a/.SRCINFO b/.SRCINFO
index a248e7f29594..7dbcc2d01e7c 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = mutter-rounded
pkgdesc = A window manager for GNOME, with rounded corners patch (integrate mr1441)
- pkgver = 41.5
- pkgrel = 1
+ pkgver = 42.0
+ pkgrel = 0.1
url = https://gitlab.gnome.org/GNOME/mutter
install = mutter.install
arch = x86_64
@@ -34,29 +34,29 @@ pkgbase = mutter-rounded
depends = graphene
depends = libxkbfile
depends = libsysprof-capture
- provides = libmutter-9.so
+ provides = libmutter-10.so
provides = mutter
conflicts = mutter
options = debug
- source = mutter-rounded::git+https://gitlab.gnome.org/GNOME/mutter.git#commit=17926e941d67867911c462737f4d013adb55e4d6
+ source = mutter-rounded::git+https://gitlab.gnome.org/GNOME/mutter.git#commit=9249aba72a5c4454894c08735a4963ca1665e34d
source = mutter_settings::git+https://github.com/yilozt/mutter-rounded-setting
source = rounded_corners.patch
source = shell_blur_effect.patch
source = meta_clip_effect.c
source = meta_clip_effect.h
source = shader.h
- source = https://gitlab.gnome.org/GNOME/gnome-shell/-/raw/41.5/src/shell-blur-effect.h
- source = https://gitlab.gnome.org/GNOME/gnome-shell/-/raw/41.5/src/shell-blur-effect.c
+ source = https://gitlab.gnome.org/GNOME/gnome-shell/-/raw/42.0/src/shell-blur-effect.h
+ source = https://gitlab.gnome.org/GNOME/gnome-shell/-/raw/42.0/src/shell-blur-effect.c
source = mr1441.patch
sha256sums = SKIP
sha256sums = SKIP
- sha256sums = 675b2e8e07ed0cd29578a4f4a5c251d52477848e1edcff68be5d96e0530c637a
- sha256sums = 895f35f5e8a458c71b4312061cf7d2b0108a3c6df4b0324ab342c5a3576ee09a
- sha256sums = dc4279ec3c0995ba9a9ee3ecd581376140c78089a058863dea0bd9ec7894dc49
+ sha256sums = 8d68c4924abb6841c94cf4fefc5b36ecab451b3bdc45fb81ef9adcb8d3b2cfe2
+ sha256sums = 369390774cf8607f9033a077e0ac76113ffc1c0997627949e087c757a5f41844
+ sha256sums = a78e0bdbf4d0b5c8c0f83ede60b531bf0d5d616bfee30293a1f27d32d738dbc6
sha256sums = 2ec553a260497f0ac0180512201c9819b10159a15fcbc6d5007932d8e2a44844
- sha256sums = 644ab34d1c6eebe8d632b3b26a993a2b9f8a5b58c821758c50eef1cdd0b7cc0c
+ sha256sums = f818921dd63cf592663817280c7481eae0852854dd4cd8865ac5fe92423c6fd5
sha256sums = 8fb024306843153b28db2f5347775ef7e8add1dd846345148a572ad5336e168b
- sha256sums = d58056b5028e1cf02a029036792f52e3429bd5f71a9403b5be93d95a7ba8252a
+ sha256sums = 5093c7afd6ad66c0ee9fa1565ef61109f5edf958d1d32789a34ab41d0112771d
sha256sums = cf99896763558258f489ff0e9a1e8001f716d63b06366f740e044cc72a71d3e7
pkgname = mutter-rounded
diff --git a/PKGBUILD b/PKGBUILD
index 71a6309b733c..55ca8925704c 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -8,8 +8,8 @@
# Contributor: Michael Kanis <mkanis_at_gmx_dot_de>
pkgname=mutter-rounded
-pkgver=41.5
-pkgrel=1
+pkgver=42.0
+pkgrel=0.1
pkgdesc="A window manager for GNOME, with rounded corners patch (integrate mr1441)"
url="https://gitlab.gnome.org/GNOME/mutter"
arch=(x86_64)
@@ -21,12 +21,12 @@ depends=(dconf gobject-introspection-runtime gsettings-desktop-schemas
makedepends=(gobject-introspection git egl-wayland meson xorg-server
wayland-protocols sysprof)
checkdepends=(xorg-server-xvfb python-dbusmock wireplumber)
-provides=(libmutter-9.so mutter)
+provides=(libmutter-10.so mutter)
conflicts=(mutter)
install=mutter.install
options=(debug)
-_commit=17926e941d67867911c462737f4d013adb55e4d6 # tags/41.5^0
+_commit=9249aba72a5c4454894c08735a4963ca1665e34d # tag/42.0^0
_mutter_src="$pkgname::git+https://gitlab.gnome.org/GNOME/mutter.git#commit=$_commit"
_shell_blur_h_src="https://gitlab.gnome.org/GNOME/gnome-shell/-/raw/${pkgver}/src/shell-blur-effect.h"
_shell_blur_c_src="https://gitlab.gnome.org/GNOME/gnome-shell/-/raw/${pkgver}/src/shell-blur-effect.c"
@@ -51,13 +51,13 @@ source=("$_mutter_src"
)
sha256sums=('SKIP'
'SKIP'
- '675b2e8e07ed0cd29578a4f4a5c251d52477848e1edcff68be5d96e0530c637a'
- '895f35f5e8a458c71b4312061cf7d2b0108a3c6df4b0324ab342c5a3576ee09a'
- 'dc4279ec3c0995ba9a9ee3ecd581376140c78089a058863dea0bd9ec7894dc49'
+ '8d68c4924abb6841c94cf4fefc5b36ecab451b3bdc45fb81ef9adcb8d3b2cfe2'
+ '369390774cf8607f9033a077e0ac76113ffc1c0997627949e087c757a5f41844'
+ 'a78e0bdbf4d0b5c8c0f83ede60b531bf0d5d616bfee30293a1f27d32d738dbc6'
'2ec553a260497f0ac0180512201c9819b10159a15fcbc6d5007932d8e2a44844'
- '644ab34d1c6eebe8d632b3b26a993a2b9f8a5b58c821758c50eef1cdd0b7cc0c'
+ 'f818921dd63cf592663817280c7481eae0852854dd4cd8865ac5fe92423c6fd5'
'8fb024306843153b28db2f5347775ef7e8add1dd846345148a572ad5336e168b'
- 'd58056b5028e1cf02a029036792f52e3429bd5f71a9403b5be93d95a7ba8252a'
+ '5093c7afd6ad66c0ee9fa1565ef61109f5edf958d1d32789a34ab41d0112771d'
'cf99896763558258f489ff0e9a1e8001f716d63b06366f740e044cc72a71d3e7')
pkgver() {
@@ -73,7 +73,7 @@ prepare() {
cp $srcdir/*.[ch] $srcdir/$pkgname/src
patch -p1 < $srcdir/rounded_corners.patch
patch -p1 < $srcdir/shell_blur_effect.patch
- patch -p1 < $srcdir/mr1441.patch
+ # patch -p1 < $srcdir/mr1441.patch
# Make tests run
sed -i '/catchsegv/d' meson.build
diff --git a/meta_clip_effect.c b/meta_clip_effect.c
index 931bd7222695..6f3f488fd13b 100644
--- a/meta_clip_effect.c
+++ b/meta_clip_effect.c
@@ -8,6 +8,15 @@ typedef struct {
CoglPipeline *pipeline;
ClutterActor *actor;
cairo_rectangle_int_t bounds;
+
+ int bounds_uniform;
+ int clip_radius_uniform;
+ int inner_bounds_uniform;
+ int inner_clip_radius_uniform;
+ int pixel_step_uniform;
+ int skip_uniform;
+ int border_width_uniform;
+ int border_brightness_uniform;
} MetaClipEffectPrivate;
G_DEFINE_TYPE_WITH_PRIVATE(MetaClipEffect, meta_clip_effect, CLUTTER_TYPE_OFFSCREEN_EFFECT)
@@ -109,6 +118,24 @@ meta_clip_effect_init(MetaClipEffect *self)
priv->pipeline = cogl_pipeline_copy (klass->base_pipeline);
priv->actor = NULL;
+
+ // get location of uniforms from shader
+ priv->bounds_uniform =
+ cogl_pipeline_get_uniform_location(priv->pipeline, "bounds");
+ priv->clip_radius_uniform =
+ cogl_pipeline_get_uniform_location(priv->pipeline, "clip_radius");
+ priv->inner_bounds_uniform =
+ cogl_pipeline_get_uniform_location(priv->pipeline, "inner_bounds");
+ priv->inner_clip_radius_uniform =
+ cogl_pipeline_get_uniform_location(priv->pipeline, "inner_clip_radius");
+ priv->pixel_step_uniform =
+ cogl_pipeline_get_uniform_location(priv->pipeline, "pixel_step");
+ priv->skip_uniform =
+ cogl_pipeline_get_uniform_location(priv->pipeline, "skip");
+ priv->border_width_uniform =
+ cogl_pipeline_get_uniform_location(priv->pipeline, "border_width");
+ priv->border_brightness_uniform =
+ cogl_pipeline_get_uniform_location(priv->pipeline, "border_brightness");
}
MetaClipEffect *meta_clip_effect_new(void)
@@ -143,82 +170,34 @@ meta_clip_effect_set_bounds(MetaClipEffect *effect,
clutter_actor_get_size(priv->actor, &w, &h);
- int location_skip =
- cogl_pipeline_get_uniform_location(priv->pipeline, "skip");
- int location_bounds =
- cogl_pipeline_get_uniform_location(priv->pipeline, "bounds");
- int location_corner_centers_1 =
- cogl_pipeline_get_uniform_location(priv->pipeline, "corner_centers_1");
- int location_corner_centers_2 =
- cogl_pipeline_get_uniform_location(priv->pipeline, "corner_centers_2");
- int location_inner_bounds =
- cogl_pipeline_get_uniform_location(priv->pipeline, "inner_bounds");
- int location_inner_corner_centers_1 =
- cogl_pipeline_get_uniform_location(priv->pipeline, "inner_corner_centers_1");
- int location_inner_corner_centers_2 =
- cogl_pipeline_get_uniform_location(priv->pipeline, "inner_corner_centers_2");
- int location_pixel_step =
- cogl_pipeline_get_uniform_location(priv->pipeline, "pixel_step");
- int location_border_width =
- cogl_pipeline_get_uniform_location(priv->pipeline, "border_width");
- int location_border_brightness =
- cogl_pipeline_get_uniform_location(priv->pipeline, "border_brightness");
-
-
float bounds[] = { x1, y1, x2, y2 };
- float corner_centers_1[] = {
- x1 + radius,
- y1 + radius,
- x2 - radius,
- y1 + radius
- };
- float corner_centers_2[] = {
- x2 - radius,
- y2 - radius,
- x1 + radius,
- y2 - radius
- };
- float inner_bounds[] = { x1 + border, y1 + border, x2 - border, y2 - border };
- float inner_corner_centers_1[] = {
- x1 + radius,
- y1 + radius,
- x2 - radius,
- y1 + radius
- };
- float inner_corner_centers_2[] = {
- x2 - radius,
- y2 - radius,
- x1 + radius,
- y2 - radius
- };
+ float inner_bounds[] = { x1 + border, y1 + border, x2 - border, y2 - border };
+ float inner_radius = radius - border;
+ if (inner_radius < 0.0f) {
+ inner_radius = 0.0f;
+ }
float pixel_step[] = { 1. / w, 1. / h };
cogl_pipeline_set_uniform_float(priv->pipeline,
- location_bounds,
+ priv->bounds_uniform,
4, 1, bounds);
+ cogl_pipeline_set_uniform_1f(priv->pipeline,
+ priv->clip_radius_uniform,
+ radius);
cogl_pipeline_set_uniform_float(priv->pipeline,
- location_corner_centers_1,
- 4, 1, corner_centers_1);
- cogl_pipeline_set_uniform_float(priv->pipeline,
- location_corner_centers_2,
- 4, 1, corner_centers_2);
- cogl_pipeline_set_uniform_float(priv->pipeline,
- location_inner_bounds,
+ priv->inner_bounds_uniform,
4, 1, inner_bounds);
+ cogl_pipeline_set_uniform_1f(priv->pipeline,
+ priv->inner_clip_radius_uniform,
+ inner_radius);
cogl_pipeline_set_uniform_float(priv->pipeline,
- location_inner_corner_centers_1,
- 4, 1, inner_corner_centers_1);
- cogl_pipeline_set_uniform_float(priv->pipeline,
- location_inner_corner_centers_2,
- 4, 1, inner_corner_centers_2);
- cogl_pipeline_set_uniform_float(priv->pipeline,
- location_pixel_step,
+ priv->pixel_step_uniform,
2, 1, pixel_step);
- cogl_pipeline_set_uniform_1i(priv->pipeline, location_skip, 0);
- cogl_pipeline_set_uniform_1f(priv->pipeline, location_border_width, border);
- cogl_pipeline_set_uniform_1f(priv->pipeline, location_border_brightness, brightness);
+ cogl_pipeline_set_uniform_1i(priv->pipeline, priv->skip_uniform, 0);
+ cogl_pipeline_set_uniform_1f(priv->pipeline, priv->border_width_uniform, border);
+ cogl_pipeline_set_uniform_1f(priv->pipeline, priv->border_brightness_uniform, brightness);
}
void
@@ -228,10 +207,7 @@ meta_clip_effect_skip(MetaClipEffect *effect)
g_return_if_fail(priv->pipeline && priv->actor);
- int location_skip =
- cogl_pipeline_get_uniform_location(priv->pipeline, "skip");
-
- cogl_pipeline_set_uniform_1i(priv->pipeline, location_skip, 1);
+ cogl_pipeline_set_uniform_1i(priv->pipeline, priv->skip_uniform, 1);
}
void
diff --git a/rounded_corners.patch b/rounded_corners.patch
index cba8116b706f..82b583f64e22 100644
--- a/rounded_corners.patch
+++ b/rounded_corners.patch
@@ -1,8 +1,8 @@
diff --git a/data/org.gnome.mutter.gschema.xml.in b/data/org.gnome.mutter.gschema.xml.in
-index 23fa9f3ad..7ad3f3f35 100644
+index c014b749f..f5f77c05d 100644
--- a/data/org.gnome.mutter.gschema.xml.in
+++ b/data/org.gnome.mutter.gschema.xml.in
-@@ -2,6 +2,84 @@
+@@ -10,6 +10,84 @@
<schema id="org.gnome.mutter" path="/org/gnome/mutter/"
gettext-domain="@GETTEXT_DOMAIN@">
@@ -88,12 +88,12 @@ index 23fa9f3ad..7ad3f3f35 100644
<default>'Super_L'</default>
<summary>Modifier to use for extended window management operations</summary>
diff --git a/src/compositor/compositor-private.h b/src/compositor/compositor-private.h
-index 580618e48..f62de1924 100644
+index d3b3145a3..e11efb9f6 100644
--- a/src/compositor/compositor-private.h
+++ b/src/compositor/compositor-private.h
-@@ -82,6 +82,8 @@ gboolean meta_compositor_is_switching_workspace (MetaCompositor *compositor);
-
- MetaLaters * meta_compositor_get_laters (MetaCompositor *compositor);
+@@ -77,6 +77,8 @@ gboolean meta_compositor_is_switching_workspace (MetaCompositor *compositor);
+ void meta_compositor_grab_begin (MetaCompositor *compositor);
+ void meta_compositor_grab_end (MetaCompositor *compositor);
+void meta_compositor_update_blur_behind(MetaCompositor *compositor);
+
@@ -101,7 +101,7 @@ index 580618e48..f62de1924 100644
* This function takes a 64 bit time stamp from the monotonic clock, and clamps
* it to the scope of the X server clock, without losing the granularity.
diff --git a/src/compositor/compositor.c b/src/compositor/compositor.c
-index 9cdd39c15..c55366fb2 100644
+index 1576ce551..dec3d63d5 100644
--- a/src/compositor/compositor.c
+++ b/src/compositor/compositor.c
@@ -85,6 +85,8 @@
@@ -113,7 +113,7 @@ index 9cdd39c15..c55366fb2 100644
enum
{
PROP_0,
-@@ -618,6 +620,10 @@ meta_compositor_add_window (MetaCompositor *compositor,
+@@ -512,6 +514,10 @@ meta_compositor_add_window (MetaCompositor *compositor,
* before we first paint.
*/
priv->windows = g_list_append (priv->windows, window_actor);
@@ -124,7 +124,7 @@ index 9cdd39c15..c55366fb2 100644
sync_actor_stacking (compositor);
}
-@@ -664,6 +670,7 @@ meta_compositor_queue_frame_drawn (MetaCompositor *compositor,
+@@ -558,6 +564,7 @@ meta_compositor_queue_frame_drawn (MetaCompositor *compositor,
MetaWindowActor *window_actor = meta_window_actor_from_window (window);
meta_window_actor_queue_frame_drawn (window_actor, no_delay_frame);
@@ -132,7 +132,7 @@ index 9cdd39c15..c55366fb2 100644
}
void
-@@ -995,6 +1002,20 @@ meta_compositor_sync_stack (MetaCompositor *compositor,
+@@ -889,6 +896,20 @@ meta_compositor_sync_stack (MetaCompositor *compositor,
sync_actor_stacking (compositor);
@@ -153,7 +153,7 @@ index 9cdd39c15..c55366fb2 100644
top_window_actor = get_top_visible_window_actor (compositor);
if (priv->top_window_actor == top_window_actor)
-@@ -1025,7 +1046,17 @@ meta_compositor_sync_window_geometry (MetaCompositor *compositor,
+@@ -919,7 +940,17 @@ meta_compositor_sync_window_geometry (MetaCompositor *compositor,
changes = meta_window_actor_sync_actor_geometry (window_actor, did_placement);
if (changes & META_WINDOW_ACTOR_CHANGE_SIZE)
@@ -171,7 +171,7 @@ index 9cdd39c15..c55366fb2 100644
}
static void
-@@ -1191,6 +1222,45 @@ meta_compositor_get_property (GObject *object,
+@@ -1085,6 +1116,45 @@ meta_compositor_get_property (GObject *object,
}
}
@@ -217,7 +217,7 @@ index 9cdd39c15..c55366fb2 100644
static void
meta_compositor_init (MetaCompositor *compositor)
{
-@@ -1221,6 +1291,8 @@ meta_compositor_constructed (GObject *object)
+@@ -1115,6 +1185,8 @@ meta_compositor_constructed (GObject *object)
priv->laters = meta_laters_new (compositor);
@@ -226,8 +226,8 @@ index 9cdd39c15..c55366fb2 100644
G_OBJECT_CLASS (meta_compositor_parent_class)->constructed (object);
}
-@@ -1246,6 +1318,8 @@ meta_compositor_dispose (GObject *object)
- g_clear_pointer (&priv->feedback_group, clutter_actor_destroy);
+@@ -1134,6 +1206,8 @@ meta_compositor_dispose (GObject *object)
+
g_clear_pointer (&priv->windows, g_list_free);
+ meta_prefs_remove_listener(prefs_changed_cb, compositor);
@@ -235,7 +235,7 @@ index 9cdd39c15..c55366fb2 100644
G_OBJECT_CLASS (meta_compositor_parent_class)->dispose (object);
}
-@@ -1579,3 +1653,20 @@ meta_compositor_get_laters (MetaCompositor *compositor)
+@@ -1477,3 +1551,20 @@ meta_compositor_get_laters (MetaCompositor *compositor)
return priv->laters;
}
@@ -257,10 +257,10 @@ index 9cdd39c15..c55366fb2 100644
+ }
+}
diff --git a/src/compositor/meta-window-actor-private.h b/src/compositor/meta-window-actor-private.h
-index adae06547..eea31fa41 100644
+index 138ce2c83..abcd695a9 100644
--- a/src/compositor/meta-window-actor-private.h
+++ b/src/compositor/meta-window-actor-private.h
-@@ -102,4 +102,15 @@ void meta_window_actor_update_regions (MetaWindowActor *self);
+@@ -106,4 +106,15 @@ void meta_window_actor_update_regions (MetaWindowActor *self);
gboolean meta_window_actor_can_freeze_commits (MetaWindowActor *self);
@@ -277,7 +277,7 @@ index adae06547..eea31fa41 100644
+void meta_window_actor_update_blur_window_opacity (MetaWindowActor *self);
#endif /* META_WINDOW_ACTOR_PRIVATE_H */
diff --git a/src/compositor/meta-window-actor-wayland.c b/src/compositor/meta-window-actor-wayland.c
-index bdc5c5a53..4e8418334 100644
+index 468229751..eefd9c26b 100644
--- a/src/compositor/meta-window-actor-wayland.c
+++ b/src/compositor/meta-window-actor-wayland.c
@@ -24,10 +24,36 @@
@@ -317,8 +317,8 @@ index bdc5c5a53..4e8418334 100644
};
G_DEFINE_TYPE (MetaWindowActorWayland, meta_window_actor_wayland, META_TYPE_WINDOW_ACTOR)
-@@ -88,18 +114,54 @@ meta_window_actor_wayland_rebuild_surface_tree (MetaWindowActor *actor)
- &traverse_data);
+@@ -104,18 +130,54 @@ meta_window_actor_wayland_get_topmost_surface (MetaWindowActor *actor)
+ return NULL;
}
+static void
@@ -372,7 +372,7 @@ index bdc5c5a53..4e8418334 100644
}
static void
-@@ -115,10 +177,287 @@ meta_window_actor_wayland_queue_frame_drawn (MetaWindowActor *actor,
+@@ -131,10 +193,287 @@ meta_window_actor_wayland_queue_frame_drawn (MetaWindowActor *actor,
{
}
@@ -660,7 +660,7 @@ index bdc5c5a53..4e8418334 100644
}
static void
-@@ -149,12 +488,29 @@ meta_window_actor_wayland_can_freeze_commits (MetaWindowActor *actor)
+@@ -165,12 +504,29 @@ meta_window_actor_wayland_can_freeze_commits (MetaWindowActor *actor)
return FALSE;
}
@@ -690,10 +690,11 @@ index bdc5c5a53..4e8418334 100644
g_autoptr (GList) children = NULL;
GList *l;
-@@ -167,7 +523,19 @@ meta_window_actor_wayland_dispose (GObject *object)
+@@ -183,7 +539,19 @@ meta_window_actor_wayland_dispose (GObject *object)
child_actor != CLUTTER_ACTOR (surface_actor))
clutter_actor_remove_child (CLUTTER_ACTOR (window_actor), child_actor);
}
+-
+
+ g_clear_pointer (&actor_wayland->shape_region, cairo_region_destroy);
+ g_clear_pointer (&actor_wayland->shadow_clip, cairo_region_destroy);
@@ -702,7 +703,7 @@ index bdc5c5a53..4e8418334 100644
+ g_clear_pointer (&actor_wayland->focused_shadow, meta_shadow_unref);
+ g_clear_pointer (&actor_wayland->unfocused_shadow, meta_shadow_unref);
+ g_clear_pointer (&actor_wayland->shadow_shape, meta_window_shape_unref);
-
++
+ g_clear_signal_handler (&actor_wayland->size_changed_id, surface_actor);
+ g_clear_signal_handler (&actor_wayland->repaint_scheduled_id, surface_actor);
+ g_clear_signal_handler (&actor_wayland->shadow_factory_changed_handler_id,
@@ -710,15 +711,15 @@ index bdc5c5a53..4e8418334 100644
G_OBJECT_CLASS (meta_window_actor_wayland_parent_class)->dispose (object);
}
-@@ -175,6 +543,7 @@ static void
+@@ -191,6 +559,7 @@ static void
meta_window_actor_wayland_class_init (MetaWindowActorWaylandClass *klass)
{
MetaWindowActorClass *window_actor_class = META_WINDOW_ACTOR_CLASS (klass);
+ ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass);
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- window_actor_class->assign_surface_actor = meta_window_actor_wayland_assign_surface_actor;
-@@ -187,10 +556,19 @@ meta_window_actor_wayland_class_init (MetaWindowActorWaylandClass *klass)
+ window_actor_class->get_topmost_surface = meta_window_actor_wayland_get_topmost_surface;
+@@ -204,10 +573,19 @@ meta_window_actor_wayland_class_init (MetaWindowActorWaylandClass *klass)
window_actor_class->update_regions = meta_window_actor_wayland_update_regions;
window_actor_class->can_freeze_commits = meta_window_actor_wayland_can_freeze_commits;
@@ -854,7 +855,7 @@ index 9e64462ea..7c003a342 100644
/* The frame bounds are already subtracted from actor_x11->shadow_clip
diff --git a/src/compositor/meta-window-actor.c b/src/compositor/meta-window-actor.c
-index b32df2010..012b67c2b 100644
+index 9cee56a37..de5775768 100644
--- a/src/compositor/meta-window-actor.c
+++ b/src/compositor/meta-window-actor.c
@@ -41,6 +41,9 @@
@@ -883,7 +884,7 @@ index b32df2010..012b67c2b 100644
int geometry_scale;
/*
-@@ -119,6 +131,246 @@ G_DEFINE_ABSTRACT_TYPE_WITH_CODE (MetaWindowActor, meta_window_actor, CLUTTER_TY
+@@ -121,6 +133,246 @@ G_DEFINE_ABSTRACT_TYPE_WITH_CODE (MetaWindowActor, meta_window_actor, CLUTTER_TY
G_IMPLEMENT_INTERFACE (META_TYPE_CULLABLE, cullable_iface_init)
G_IMPLEMENT_INTERFACE (META_TYPE_SCREEN_CAST_WINDOW, screen_cast_window_iface_init));
@@ -1130,7 +1131,7 @@ index b32df2010..012b67c2b 100644
static void
meta_window_actor_class_init (MetaWindowActorClass *klass)
{
-@@ -216,6 +468,11 @@ meta_window_actor_init (MetaWindowActor *self)
+@@ -219,6 +471,11 @@ meta_window_actor_init (MetaWindowActor *self)
meta_window_actor_get_instance_private (self);
priv->geometry_scale = 1;
@@ -1142,7 +1143,7 @@ index b32df2010..012b67c2b 100644
}
static void
-@@ -368,6 +625,11 @@ meta_window_actor_real_assign_surface_actor (MetaWindowActor *self,
+@@ -371,6 +628,11 @@ meta_window_actor_real_assign_surface_actor (MetaWindowActor *self,
meta_window_actor_set_frozen (self, TRUE);
else
meta_window_actor_sync_thawed_state (self);
@@ -1154,7 +1155,7 @@ index b32df2010..012b67c2b 100644
}
void
-@@ -399,6 +661,32 @@ init_surface_actor (MetaWindowActor *self)
+@@ -402,6 +664,32 @@ init_surface_actor (MetaWindowActor *self)
meta_window_actor_assign_surface_actor (self, surface_actor);
}
@@ -1187,7 +1188,7 @@ index b32df2010..012b67c2b 100644
static void
meta_window_actor_constructed (GObject *object)
{
-@@ -406,6 +694,7 @@ meta_window_actor_constructed (GObject *object)
+@@ -409,6 +697,7 @@ meta_window_actor_constructed (GObject *object)
MetaWindowActorPrivate *priv =
meta_window_actor_get_instance_private (self);
MetaWindow *window = priv->window;
@@ -1195,7 +1196,7 @@ index b32df2010..012b67c2b 100644
priv->compositor = window->display->compositor;
-@@ -424,6 +713,15 @@ meta_window_actor_constructed (GObject *object)
+@@ -427,6 +716,15 @@ meta_window_actor_constructed (GObject *object)
priv->first_frame_state = DRAWING_FIRST_FRAME;
meta_window_actor_sync_actor_geometry (self, priv->window->placed);
@@ -1211,7 +1212,7 @@ index b32df2010..012b67c2b 100644
}
static void
-@@ -442,6 +740,7 @@ meta_window_actor_dispose (GObject *object)
+@@ -445,6 +743,7 @@ meta_window_actor_dispose (GObject *object)
priv->disposed = TRUE;
@@ -1219,7 +1220,7 @@ index b32df2010..012b67c2b 100644
meta_compositor_remove_window_actor (compositor, self);
g_clear_object (&priv->window);
-@@ -470,6 +769,8 @@ meta_window_actor_set_property (GObject *object,
+@@ -473,6 +772,8 @@ meta_window_actor_set_property (GObject *object,
{
case PROP_META_WINDOW:
priv->window = g_value_dup_object (value);
@@ -1228,7 +1229,7 @@ index b32df2010..012b67c2b 100644
g_signal_connect_object (priv->window, "notify::appears-focused",
G_CALLBACK (window_appears_focused_notify), self, 0);
break;
-@@ -588,6 +889,7 @@ meta_window_actor_effect_in_progress (MetaWindowActor *self)
+@@ -603,6 +904,7 @@ meta_window_actor_effect_in_progress (MetaWindowActor *self)
meta_window_actor_get_instance_private (self);
return (priv->minimize_in_progress ||
@@ -1236,7 +1237,7 @@ index b32df2010..012b67c2b 100644
priv->size_change_in_progress ||
priv->map_in_progress ||
priv->destroy_in_progress);
-@@ -606,6 +908,47 @@ is_freeze_thaw_effect (MetaPluginEffect event)
+@@ -621,6 +923,47 @@ is_freeze_thaw_effect (MetaPluginEffect event)
}
}
@@ -1284,7 +1285,7 @@ index b32df2010..012b67c2b 100644
static gboolean
start_simple_effect (MetaWindowActor *self,
MetaPluginEffect event)
-@@ -625,15 +968,33 @@ start_simple_effect (MetaWindowActor *self,
+@@ -640,15 +983,33 @@ start_simple_effect (MetaWindowActor *self,
case META_PLUGIN_NONE:
return FALSE;
case META_PLUGIN_MINIMIZE:
@@ -1318,7 +1319,7 @@ index b32df2010..012b67c2b 100644
counter = &priv->destroy_in_progress;
break;
case META_PLUGIN_SIZE_CHANGE:
-@@ -682,6 +1043,7 @@ meta_window_actor_after_effects (MetaWindowActor *self)
+@@ -697,6 +1058,7 @@ meta_window_actor_after_effects (MetaWindowActor *self)
g_signal_emit (self, signals[EFFECTS_COMPLETED], 0);
meta_window_actor_sync_visibility (self);
meta_window_actor_sync_actor_geometry (self, FALSE);
@@ -1326,7 +1327,7 @@ index b32df2010..012b67c2b 100644
}
clutter_stage_repick_device (stage, clutter_seat_get_pointer (seat));
-@@ -803,6 +1165,19 @@ meta_window_actor_queue_destroy (MetaWindowActor *self)
+@@ -818,6 +1180,19 @@ meta_window_actor_queue_destroy (MetaWindowActor *self)
clutter_actor_destroy (CLUTTER_ACTOR (self));
}
@@ -1346,7 +1347,7 @@ index b32df2010..012b67c2b 100644
MetaWindowActorChanges
meta_window_actor_sync_actor_geometry (MetaWindowActor *self,
gboolean did_placement)
-@@ -1031,7 +1406,7 @@ meta_window_actor_sync_visibility (MetaWindowActor *self)
+@@ -1046,7 +1421,7 @@ meta_window_actor_sync_visibility (MetaWindowActor *self)
if (CLUTTER_ACTOR_IS_VISIBLE (self) != priv->visible)
{
@@ -1700,10 +1701,10 @@ index 536d9dd57..29bddc170 100644
+ return FALSE;
+}
diff --git a/src/meson.build b/src/meson.build
-index f3aebfb28..cf9cf4b61 100644
+index 7b456f524..35d4b07aa 100644
--- a/src/meson.build
+++ b/src/meson.build
-@@ -169,6 +169,18 @@ if get_option('verbose')
+@@ -174,6 +174,18 @@ if get_option('verbose')
]
endif
@@ -1722,7 +1723,7 @@ index f3aebfb28..cf9cf4b61 100644
mutter_sources = [
'backends/edid.h',
'backends/edid-parse.c',
-@@ -458,6 +470,8 @@ mutter_sources = [
+@@ -463,6 +475,8 @@ mutter_sources = [
'x11/window-x11-private.h',
'x11/xprops.c',
'x11/xprops.h',
@@ -1730,8 +1731,8 @@ index f3aebfb28..cf9cf4b61 100644
+ 'meta_clip_effect.h',
]
- if have_egl
-@@ -993,7 +1007,8 @@ subdir('meta')
+ if have_egl_device
+@@ -1017,7 +1031,8 @@ subdir('meta')
mutter_built_sources += mutter_enum_types
libmutter = shared_library(libmutter_name,
@@ -1797,7 +1798,7 @@ index 227de68bf..7d5d8f347 100644
* MetaKeyBindingAction:
* @META_KEYBINDING_ACTION_NONE: FILLME
diff --git a/src/ui/frames.c b/src/ui/frames.c
-index 48b2a361c..8be6a8f8b 100644
+index cf90d477b..f82d653fd 100644
--- a/src/ui/frames.c
+++ b/src/ui/frames.c
@@ -711,6 +711,27 @@ meta_ui_frame_get_bounds (MetaUIFrame *frame)
@@ -1829,10 +1830,10 @@ index 48b2a361c..8be6a8f8b 100644
meta_ui_frame_move_resize (MetaUIFrame *frame,
int x, int y, int width, int height)
diff --git a/src/ui/frames.h b/src/ui/frames.h
-index d81be1c72..c32a93d99 100644
+index 89b399265..8262f0446 100644
--- a/src/ui/frames.h
+++ b/src/ui/frames.h
-@@ -134,6 +134,10 @@ void meta_ui_frame_get_borders (MetaUIFrame *frame,
+@@ -139,6 +139,10 @@ void meta_ui_frame_get_borders (MetaUIFrame *frame,
cairo_region_t * meta_ui_frame_get_bounds (MetaUIFrame *frame);
@@ -1843,11 +1844,170 @@ index d81be1c72..c32a93d99 100644
void meta_ui_frame_get_mask (MetaUIFrame *frame,
cairo_rectangle_int_t *frame_rect,
cairo_t *cr);
+diff --git a/src/ui/frames.h.orig b/src/ui/frames.h.orig
+new file mode 100644
+index 000000000..89b399265
+--- /dev/null
++++ b/src/ui/frames.h.orig
+@@ -0,0 +1,153 @@
++/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
++
++/* Metacity window frame manager widget */
++
++/*
++ * Copyright (C) 2001 Havoc Pennington
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License as
++ * published by the Free Software Foundation; either version 2 of the
++ * License, or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful, but
++ * WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, see <http://www.gnu.org/licenses/>.
++ */
++
++#ifndef META_FRAMES_H
++#define META_FRAMES_H
++
++#include <gtk/gtk.h>
++#include <gdk/gdkx.h>
++
++#include "meta/common.h"
++#include "meta/types.h"
++#include "ui/theme-private.h"
++#include "ui/ui.h"
++
++typedef enum
++{
++ META_FRAME_CONTROL_NONE,
++ META_FRAME_CONTROL_TITLE,
++ META_FRAME_CONTROL_DELETE,
++ META_FRAME_CONTROL_MENU,
++ META_FRAME_CONTROL_MINIMIZE,
++ META_FRAME_CONTROL_MAXIMIZE,
++ META_FRAME_CONTROL_UNMAXIMIZE,
++ META_FRAME_CONTROL_RESIZE_SE,
++ META_FRAME_CONTROL_RESIZE_S,
++ META_FRAME_CONTROL_RESIZE_SW,
++ META_FRAME_CONTROL_RESIZE_N,
++ META_FRAME_CONTROL_RESIZE_NE,
++ META_FRAME_CONTROL_RESIZE_NW,
++ META_FRAME_CONTROL_RESIZE_W,
++ META_FRAME_CONTROL_RESIZE_E,
++ META_FRAME_CONTROL_CLIENT_AREA
++} MetaFrameControl;
++
++/* This is one widget that manages all the window frames
++ * as subwindows.
++ */
++
++#define META_TYPE_FRAMES (meta_frames_get_type ())
++#define META_FRAMES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_FRAMES, MetaFrames))
++#define META_FRAMES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), META_TYPE_FRAMES, MetaFramesClass))
++#define META_IS_FRAMES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), META_TYPE_FRAMES))
++#define META_IS_FRAMES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), META_TYPE_FRAMES))
++#define META_FRAMES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), META_TYPE_FRAMES, MetaFramesClass))
++
++typedef struct _MetaFrames MetaFrames;
++typedef struct _MetaFramesClass MetaFramesClass;
++
++struct _MetaUIFrame
++{
++ MetaFrames *frames;
++ MetaWindow *meta_window;
++ Window xwindow;
++ GdkWindow *window;
++ MetaStyleInfo *style_info;
++ MetaFrameLayout *cache_layout;
++ PangoLayout *text_layout;
++ int text_height;
++ char *title; /* NULL once we have a layout */
++ guint maybe_ignore_leave_notify : 1;
++
++ /* FIXME get rid of this, it can just be in the MetaFrames struct */
++ MetaFrameControl prelit_control;
++ MetaButtonState button_state;
++ int grab_button;
++
++ gboolean is_frozen;
++};
++
++struct _MetaFrames
++{
++ GtkWindow parent_instance;
++
++ MetaX11Display *x11_display;
++
++ GHashTable *text_heights;
++
++ GHashTable *frames;
++
++ MetaStyleInfo *normal_style;
++ GHashTable *style_variants;
++
++ MetaGrabOp current_grab_op;
++ MetaUIFrame *grab_frame;
++ guint grab_button;
++ gdouble grab_x;
++ gdouble grab_y;
++
++ ClutterEventSequence *grab_touch;
++
++ float last_click_x;
++ float last_click_y;
++ uint32_t last_click_time;
++ int click_count;
++};
++
++struct _MetaFramesClass
++{
++ GtkWindowClass parent_class;
++
++};
++
++GType meta_frames_get_type (void) G_GNUC_CONST;
++
++MetaFrames * meta_frames_new (MetaX11Display *x11_display);
++
++MetaUIFrame * meta_frames_manage_window (MetaFrames *frames,
++ MetaWindow *meta_window,
++ Window xwindow,
++ GdkWindow *window);
++
++void meta_ui_frame_unmanage (MetaUIFrame *frame);
++
++void meta_ui_frame_set_title (MetaUIFrame *frame,
++ const char *title);
++
++void meta_ui_frame_update_style (MetaUIFrame *frame);
++
++void meta_ui_frame_get_borders (MetaUIFrame *frame,
++ MetaFrameBorders *borders);
++
++cairo_region_t * meta_ui_frame_get_bounds (MetaUIFrame *frame);
++
++void meta_ui_frame_get_mask (MetaUIFrame *frame,
++ cairo_rectangle_int_t *frame_rect,
++ cairo_t *cr);
++
++void meta_ui_frame_move_resize (MetaUIFrame *frame,
++ int x, int y, int width, int height);
++
++void meta_ui_frame_queue_draw (MetaUIFrame *frame);
++
++gboolean meta_ui_frame_handle_event (MetaUIFrame *frame, const ClutterEvent *event);
++
++#endif
diff --git a/src/wayland/meta-window-wayland.c b/src/wayland/meta-window-wayland.c
-index 12e9567d9..7138330bc 100644
+index 2b389bfbf..cbd04cc41 100644
--- a/src/wayland/meta-window-wayland.c
+++ b/src/wayland/meta-window-wayland.c
-@@ -1002,6 +1002,9 @@ meta_window_wayland_finish_move_resize (MetaWindow *window,
+@@ -1073,6 +1073,9 @@ meta_window_wayland_finish_move_resize (MetaWindow *window,
gravity = META_GRAVITY_STATIC;
meta_window_move_resize_internal (window, flags, gravity, rect);
diff --git a/shader.h b/shader.h
index 95ea686b002a..6a3340fcce69 100644
--- a/shader.h
+++ b/shader.h
@@ -2,84 +2,62 @@
/*
* copied from src/compositor/meta-background-content.c
- *
- * The ellipsis_dist(), ellipsis_coverage() and rounded_rect_coverage() are
- * copied from GSK, see gsk_ellipsis_dist(), gsk_ellipsis_coverage(), and
- * gsk_rounded_rect_coverage() here:
- * https://gitlab.gnome.org/GNOME/gtk/-/blob/master/gsk/resources/glsl/preamble.fs.glsl
- *
+ * see: https://gitlab.gnome.org/GNOME/mutter/-/blob/858b5c12b1f55043964c2e2bd30de8cf112e76d2/src/compositor/meta-background-content.c#L138
*/
#define ROUNDED_CLIP_FRAGMENT_SHADER_FUNCS \
-" \n"\
"float \n"\
-"ellipsis_dist (vec2 p, vec2 radius) \n"\
+"rounded_rect_coverage (vec2 p, vec4 bounds, float clip_radius) \n"\
"{ \n"\
-" if (radius == vec2(0, 0)) \n"\
+" // Outside the bounds \n"\
+" if (p.x < bounds.x || p.x > bounds.z \n"\
+" || p.y < bounds.y || p.y > bounds.w ) { \n"\
" return 0.0; \n"\
+" } \n"\
+" float center_left = bounds.x + clip_radius; \n"\
+" float center_right = bounds.z - clip_radius; \n"\
+" float center_x; \n"\
+" \n"\
+" if (p.x < center_left) \n"\
+" center_x = center_left; \n"\
+" else if (p.x > center_right) \n"\
+" center_x = center_right; \n"\
+" else \n"\
+" return 1.0; // The vast majority of pixels exit early here \n"\
+" \n"\
+" float center_top = bounds.y + clip_radius; \n"\
+" float center_bottom = bounds.w - clip_radius; \n"\
+" float center_y; \n"\
+" \n"\
+" if (p.y < center_top) \n"\
+" center_y = center_top; \n"\
+" else if (p.y > center_bottom) \n"\
+" center_y = center_bottom; \n"\
+" else \n"\
+" return 1.0; \n"\
" \n"\
-" vec2 p0 = p / radius; \n"\
-" vec2 p1 = (2.0 * p0) / radius; \n"\
-" \n"\
-" return (dot(p0, p0) - 1.0) / length (p1); \n"\
-"} \n"\
-" \n"\
-"float \n"\
-"ellipsis_coverage (vec2 point, vec2 center, vec2 radius) \n"\
-"{ \n"\
-" float d = ellipsis_dist ((point - center), radius); \n"\
-" return clamp (0.5 - d, 0.0, 1.0); \n"\
-"} \n"\
+" vec2 delta = p - vec2 (center_x, center_y); \n"\
+" float dist_squared = dot (delta, delta); \n"\
" \n"\
-"float \n"\
-"rounded_rect_coverage (vec4 bounds, \n"\
-" vec4 corner_centers_1, \n"\
-" vec4 corner_centers_2, \n"\
-" vec2 p) \n"\
-"{ \n"\
-" if (p.x < bounds.x || p.y < bounds.y || \n"\
-" p.x >= bounds.z || p.y >= bounds.w) \n"\
+" // Fully outside the circle \n"\
+" float outer_radius = clip_radius + 0.5; \n"\
+" if (dist_squared >= (outer_radius * outer_radius)) \n"\
" return 0.0; \n"\
" \n"\
-" vec2 ref_tl = corner_centers_1.xy; \n"\
-" vec2 ref_tr = corner_centers_1.zw; \n"\
-" vec2 ref_br = corner_centers_2.xy; \n"\
-" vec2 ref_bl = corner_centers_2.zw; \n"\
-" \n"\
-" if (p.x >= ref_tl.x && p.x >= ref_bl.x && \n"\
-" p.x <= ref_tr.x && p.x <= ref_br.x) \n"\
-" return 1.0; \n"\
-" \n"\
-" if (p.y >= ref_tl.y && p.y >= ref_tr.y && \n"\
-" p.y <= ref_bl.y && p.y <= ref_br.y) \n"\
+" // Fully inside the circle \n"\
+" float inner_radius = clip_radius - 0.5; \n"\
+" if (dist_squared <= (inner_radius * inner_radius)) \n"\
" return 1.0; \n"\
" \n"\
-" vec2 rad_tl = corner_centers_1.xy - bounds.xy; \n"\
-" vec2 rad_tr = corner_centers_1.zw - bounds.zy; \n"\
-" vec2 rad_br = corner_centers_2.xy - bounds.zw; \n"\
-" vec2 rad_bl = corner_centers_2.zw - bounds.xw; \n"\
" \n"\
-" float d_tl = ellipsis_coverage(p, ref_tl, rad_tl); \n"\
-" float d_tr = ellipsis_coverage(p, ref_tr, rad_tr); \n"\
-" float d_br = ellipsis_coverage(p, ref_br, rad_br); \n"\
-" float d_bl = ellipsis_coverage(p, ref_bl, rad_bl); \n"\
-" \n"\
-" vec4 corner_coverages = 1.0 - vec4(d_tl, d_tr, d_br, d_bl); \n"\
-" \n"\
-" bvec4 is_out = bvec4(p.x < ref_tl.x && p.y < ref_tl.y, \n"\
-" p.x > ref_tr.x && p.y < ref_tr.y, \n"\
-" p.x > ref_br.x && p.y > ref_br.y, \n"\
-" p.x < ref_bl.x && p.y > ref_bl.y); \n"\
-" \n"\
-" return 1.0 - dot(vec4(is_out), corner_coverages); \n"\
+" // Only pixels on the edge of the curve need expensive antialiasing \n"\
+" return outer_radius - sqrt (dist_squared); \n"\
"} \n"
#define ROUNDED_CLIP_FRAGMENT_SHADER_VARS \
-"uniform vec4 bounds; // x, y: top left; w, v: bottom right \n"\
-"uniform vec4 corner_centers_1; // x, y: top left; w, v: top right \n"\
-"uniform vec4 corner_centers_2; // x, y: bottom right; w, v: bottom left \n"\
+"uniform vec4 bounds; // x, y: top left; z, w: bottom right \n"\
+"uniform float clip_radius; \n"\
"uniform vec4 inner_bounds; \n"\
-"uniform vec4 inner_corner_centers_1; \n"\
-"uniform vec4 inner_corner_centers_2; \n"\
+"uniform float inner_clip_radius; \n"\
"uniform vec2 pixel_step; \n"\
"uniform int skip; \n"\
"uniform float border_width; \n"\
@@ -95,15 +73,13 @@ ROUNDED_CLIP_FRAGMENT_SHADER_FUNCS
"if (skip == 0) { \n"\
" vec2 texture_coord = cogl_tex_coord0_in.xy / pixel_step; \n"\
" \n"\
-" float outer_alpha = rounded_rect_coverage (bounds, \n"\
-" corner_centers_1, \n"\
-" corner_centers_2, \n"\
-" texture_coord); \n"\
+" float outer_alpha = rounded_rect_coverage (texture_coord, \n"\
+" bounds, \n"\
+" clip_radius); \n"\
" if (border_width > 0.0) { \n"\
-" float inner_alpha = rounded_rect_coverage (inner_bounds, \n"\
-" inner_corner_centers_1, \n"\
-" inner_corner_centers_2, \n"\
-" texture_coord); \n"\
+" float inner_alpha = rounded_rect_coverage (texture_coord, \n"\
+" inner_bounds, \n"\
+" inner_clip_radius); \n"\
" float border_alpha = clamp (outer_alpha - inner_alpha, 0.0, 1.0) \n"\
" * cogl_color_out.a; \n"\
" \n"\
@@ -118,8 +94,7 @@ ROUNDED_CLIP_FRAGMENT_SHADER_FUNCS
#define ROUNDED_CLIP_FRAGMENT_SHADER_VARS_BLUR \
"uniform vec4 bounds; // x, y: top left; w, v: bottom right \n"\
-"uniform vec4 corner_centers_1; // x, y: top left; w, v: top right \n"\
-"uniform vec4 corner_centers_2; // x, y: bottom right; w, v: bottom left \n"\
+"uniform float clip_radius; \n"\
"uniform vec2 pixel_step; \n"\
"uniform int skip; \n"\
"uniform float brightness; \n"
@@ -134,9 +109,8 @@ ROUNDED_CLIP_FRAGMENT_SHADER_FUNCS
"if (skip == 0) { \n"\
" vec2 texture_coord = cogl_tex_coord0_in.xy / pixel_step; \n"\
" \n"\
-" cogl_color_out *= rounded_rect_coverage (bounds, \n"\
-" corner_centers_1, \n"\
-" corner_centers_2, \n"\
-" texture_coord); \n"\
+" cogl_color_out *= rounded_rect_coverage (texture_coord, \n"\
+" bounds, \n"\
+" clip_radius); \n"\
"} \n"\
"cogl_color_out.rgb *= brightness; \n"
diff --git a/shell_blur_effect.patch b/shell_blur_effect.patch
index 685c26a00bd7..e2ed3edfae0b 100644
--- a/shell_blur_effect.patch
+++ b/shell_blur_effect.patch
@@ -1,6 +1,6 @@
diff -Narup a/src/shell-blur-effect.c b/src/shell-blur-effect.c
---- a/src/shell-blur-effect.c 2021-11-06 14:09:18.864228559 +0800
-+++ b/src/shell-blur-effect.c 2021-11-06 14:09:18.864228559 +0800
+--- a/src/shell-blur-effect.c 2022-03-31 10:47:02.847618301 +0800
++++ b/src/shell-blur-effect.c 2022-03-31 10:47:02.847618301 +0800
@@ -22,6 +22,9 @@
#include "shell-enum-types.h"
@@ -33,20 +33,19 @@ diff -Narup a/src/shell-blur-effect.c b/src/shell-blur-effect.c
{
ClutterEffect parent_instance;
-@@ -78,6 +75,12 @@ struct _ShellBlurEffect
+@@ -78,6 +75,11 @@ struct _ShellBlurEffect
FramebufferData background_fb;
FramebufferData brightness_fb;
int brightness_uniform;
+ int bounds_uniform;
-+ int corner_centers_1_uniform;
-+ int corner_centers_2_uniform;
++ int clip_radius_uniform;
+ int pixel_step_uniform;
+ int skip_uniform;
+ gboolean skip;
ShellBlurMode mode;
float downscale_factor;
-@@ -85,7 +88,7 @@ struct _ShellBlurEffect
+@@ -85,7 +87,7 @@ struct _ShellBlurEffect
int sigma;
};
@@ -55,7 +54,7 @@ diff -Narup a/src/shell-blur-effect.c b/src/shell-blur-effect.c
enum {
PROP_0,
-@@ -133,8 +136,8 @@ create_brightness_pipeline (void)
+@@ -133,8 +135,8 @@ create_brightness_pipeline (void)
brightness_pipeline = create_base_pipeline ();
snippet = cogl_snippet_new (COGL_SNIPPET_HOOK_FRAGMENT,
@@ -66,7 +65,7 @@ diff -Narup a/src/shell-blur-effect.c b/src/shell-blur-effect.c
cogl_pipeline_add_snippet (brightness_pipeline, snippet);
cogl_object_unref (snippet);
}
-@@ -144,7 +147,7 @@ create_brightness_pipeline (void)
+@@ -144,7 +146,7 @@ create_brightness_pipeline (void)
static void
@@ -75,7 +74,7 @@ diff -Narup a/src/shell-blur-effect.c b/src/shell-blur-effect.c
uint8_t paint_opacity)
{
cogl_pipeline_set_color4ub (self->brightness_fb.pipeline,
-@@ -155,9 +158,44 @@ update_brightness (ShellBlurEffect *self
+@@ -155,9 +157,29 @@ update_brightness (ShellBlurEffect *self
if (self->brightness_uniform > -1)
{
@@ -91,36 +90,21 @@ diff -Narup a/src/shell-blur-effect.c b/src/shell-blur-effect.c
+ float height = self->tex_height;
+ float radius = meta_prefs_get_round_corner_radius();
+ float bounds[] = { 0.0, 0.0, width, height };
-+ float corner_centers_1[] = {
-+ radius,
-+ radius,
-+ width - radius,
-+ radius
-+ };
-+ float corner_centers_2[] = {
-+ width - radius,
-+ height - radius,
-+ radius,
-+ height - radius
-+ };
+ float pixel_step[] = { 1.0 / width, 1.0 / height };
+
+ cogl_pipeline_set_uniform_float (self->brightness_fb.pipeline,
+ self->bounds_uniform,
+ 4, 1, bounds);
-+ cogl_pipeline_set_uniform_float (self->brightness_fb.pipeline,
-+ self->corner_centers_1_uniform,
-+ 4, 1, corner_centers_1);
-+ cogl_pipeline_set_uniform_float (self->brightness_fb.pipeline,
-+ self->corner_centers_2_uniform,
-+ 4, 1, corner_centers_2);
++ cogl_pipeline_set_uniform_1f (self->brightness_fb.pipeline,
++ self->clip_radius_uniform,
++ radius);
+ cogl_pipeline_set_uniform_float (self->brightness_fb.pipeline,
+ self->pixel_step_uniform,
+ 2, 1, pixel_step);
}
}
-@@ -212,7 +250,7 @@ update_fbo (FramebufferData *data,
+@@ -212,7 +234,7 @@ update_fbo (FramebufferData *data,
}
static gboolean
@@ -129,7 +113,7 @@ diff -Narup a/src/shell-blur-effect.c b/src/shell-blur-effect.c
unsigned int width,
unsigned int height,
float downscale_factor)
-@@ -231,7 +269,7 @@ update_actor_fbo (ShellBlurEffect *self,
+@@ -231,7 +253,7 @@ update_actor_fbo (ShellBlurEffect *self,
}
static gboolean
@@ -138,7 +122,7 @@ diff -Narup a/src/shell-blur-effect.c b/src/shell-blur-effect.c
unsigned int width,
unsigned int height,
float downscale_factor)
-@@ -250,7 +288,7 @@ update_brightness_fbo (ShellBlurEffect *
+@@ -250,7 +272,7 @@ update_brightness_fbo (ShellBlurEffect *
}
static gboolean
@@ -147,7 +131,7 @@ diff -Narup a/src/shell-blur-effect.c b/src/shell-blur-effect.c
unsigned int width,
unsigned int height)
{
-@@ -303,10 +341,10 @@ static void
+@@ -303,10 +325,10 @@ static void
shell_blur_effect_set_actor (ClutterActorMeta *meta,
ClutterActor *actor)
{
@@ -160,7 +144,7 @@ diff -Narup a/src/shell-blur-effect.c b/src/shell-blur-effect.c
meta_class->set_actor (meta, actor);
/* clear out the previous state */
-@@ -319,7 +357,7 @@ shell_blur_effect_set_actor (ClutterActo
+@@ -319,7 +341,7 @@ shell_blur_effect_set_actor (ClutterActo
}
static void
@@ -169,7 +153,7 @@ diff -Narup a/src/shell-blur-effect.c b/src/shell-blur-effect.c
ClutterPaintContext *paint_context,
ClutterActorBox *source_actor_box)
{
-@@ -368,7 +406,7 @@ update_actor_box (ShellBlurEffect *s
+@@ -368,7 +390,7 @@ update_actor_box (ShellBlurEffect *s
}
static void
@@ -178,7 +162,7 @@ diff -Narup a/src/shell-blur-effect.c b/src/shell-blur-effect.c
ClutterPaintNode *node,
uint8_t paint_opacity)
{
-@@ -395,7 +433,7 @@ add_blurred_pipeline (ShellBlurEffect *
+@@ -395,7 +417,7 @@ add_blurred_pipeline (ShellBlurEffect *
}
static ClutterPaintNode *
@@ -187,7 +171,7 @@ diff -Narup a/src/shell-blur-effect.c b/src/shell-blur-effect.c
ClutterPaintNode *node,
uint8_t paint_opacity)
{
-@@ -435,7 +473,7 @@ create_blur_nodes (ShellBlurEffect *sel
+@@ -435,7 +457,7 @@ create_blur_nodes (ShellBlurEffect *sel
}
static void
@@ -196,7 +180,7 @@ diff -Narup a/src/shell-blur-effect.c b/src/shell-blur-effect.c
ClutterPaintNode *node,
ClutterPaintContext *paint_context,
ClutterActorBox *source_actor_box)
-@@ -482,7 +520,7 @@ paint_background (ShellBlurEffect *s
+@@ -482,7 +504,7 @@ paint_background (ShellBlurEffect *s
}
static gboolean
@@ -205,7 +189,7 @@ diff -Narup a/src/shell-blur-effect.c b/src/shell-blur-effect.c
ClutterPaintContext *paint_context,
ClutterActorBox *source_actor_box)
{
-@@ -509,7 +547,7 @@ update_framebuffers (ShellBlurEffect
+@@ -509,7 +531,7 @@ update_framebuffers (ShellBlurEffect
}
static void
@@ -214,7 +198,7 @@ diff -Narup a/src/shell-blur-effect.c b/src/shell-blur-effect.c
ClutterPaintNode *node,
int opacity)
{
-@@ -520,7 +558,7 @@ add_actor_node (ShellBlurEffect *self,
+@@ -520,7 +542,7 @@ add_actor_node (ShellBlurEffect *self,
}
static void
@@ -223,7 +207,7 @@ diff -Narup a/src/shell-blur-effect.c b/src/shell-blur-effect.c
ClutterPaintNode *node,
ClutterEffectPaintFlags flags)
{
-@@ -579,7 +617,7 @@ paint_actor_offscreen (ShellBlurEffect
+@@ -579,7 +601,7 @@ paint_actor_offscreen (ShellBlurEffect
}
static gboolean
@@ -232,7 +216,7 @@ diff -Narup a/src/shell-blur-effect.c b/src/shell-blur-effect.c
ClutterEffectPaintFlags flags)
{
gboolean actor_cached;
-@@ -608,7 +646,7 @@ shell_blur_effect_paint_node (ClutterEff
+@@ -608,7 +630,7 @@ shell_blur_effect_paint_node (ClutterEff
ClutterPaintContext *paint_context,
ClutterEffectPaintFlags flags)
{
@@ -241,7 +225,7 @@ diff -Narup a/src/shell-blur-effect.c b/src/shell-blur-effect.c
uint8_t paint_opacity;
g_assert (self->actor != NULL);
-@@ -689,7 +727,7 @@ fail:
+@@ -689,7 +711,7 @@ fail:
static void
shell_blur_effect_finalize (GObject *object)
{
@@ -250,7 +234,7 @@ diff -Narup a/src/shell-blur-effect.c b/src/shell-blur-effect.c
clear_framebuffer_data (&self->actor_fb);
clear_framebuffer_data (&self->background_fb);
-@@ -699,7 +737,7 @@ shell_blur_effect_finalize (GObject *obj
+@@ -699,7 +721,7 @@ shell_blur_effect_finalize (GObject *obj
g_clear_pointer (&self->background_fb.pipeline, cogl_object_unref);
g_clear_pointer (&self->brightness_fb.pipeline, cogl_object_unref);
@@ -259,7 +243,7 @@ diff -Narup a/src/shell-blur-effect.c b/src/shell-blur-effect.c
}
static void
-@@ -708,7 +746,7 @@ shell_blur_effect_get_property (GObject
+@@ -708,7 +730,7 @@ shell_blur_effect_get_property (GObject
GValue *value,
GParamSpec *pspec)
{
@@ -268,7 +252,7 @@ diff -Narup a/src/shell-blur-effect.c b/src/shell-blur-effect.c
switch (prop_id)
{
-@@ -735,20 +773,20 @@ shell_blur_effect_set_property (GObject
+@@ -735,20 +757,20 @@ shell_blur_effect_set_property (GObject
const GValue *value,
GParamSpec *pspec)
{
@@ -293,7 +277,7 @@ diff -Narup a/src/shell-blur-effect.c b/src/shell-blur-effect.c
break;
default:
-@@ -757,7 +795,7 @@ shell_blur_effect_set_property (GObject
+@@ -757,7 +779,7 @@ shell_blur_effect_set_property (GObject
}
static void
@@ -302,7 +286,7 @@ diff -Narup a/src/shell-blur-effect.c b/src/shell-blur-effect.c
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
ClutterActorMetaClass *meta_class = CLUTTER_ACTOR_META_CLASS (klass);
-@@ -797,38 +835,50 @@ shell_blur_effect_class_init (ShellBlurE
+@@ -797,38 +819,48 @@ shell_blur_effect_class_init (ShellBlurE
}
static void
@@ -321,10 +305,8 @@ diff -Narup a/src/shell-blur-effect.c b/src/shell-blur-effect.c
cogl_pipeline_get_uniform_location (self->brightness_fb.pipeline, "brightness");
+ self->bounds_uniform =
+ cogl_pipeline_get_uniform_location (self->brightness_fb.pipeline, "bounds");
-+ self->corner_centers_1_uniform =
-+ cogl_pipeline_get_uniform_location (self->brightness_fb.pipeline, "corner_centers_1");
-+ self->corner_centers_2_uniform =
-+ cogl_pipeline_get_uniform_location (self->brightness_fb.pipeline, "corner_centers_2");
++ self->clip_radius_uniform =
++ cogl_pipeline_get_uniform_location (self->brightness_fb.pipeline, "clip_radius");
+ self->pixel_step_uniform =
+ cogl_pipeline_get_uniform_location (self->brightness_fb.pipeline, "pixel_step");
+ self->skip_uniform =
@@ -361,7 +343,7 @@ diff -Narup a/src/shell-blur-effect.c b/src/shell-blur-effect.c
if (self->sigma == sigma)
return;
-@@ -843,18 +893,18 @@ shell_blur_effect_set_sigma (ShellBlurEf
+@@ -843,18 +875,18 @@ shell_blur_effect_set_sigma (ShellBlurEf
}
float
@@ -384,7 +366,7 @@ diff -Narup a/src/shell-blur-effect.c b/src/shell-blur-effect.c
if (self->brightness == brightness)
return;
-@@ -869,18 +919,18 @@ shell_blur_effect_set_brightness (ShellB
+@@ -869,18 +901,18 @@ shell_blur_effect_set_brightness (ShellB
}
ShellBlurMode
@@ -407,7 +389,7 @@ diff -Narup a/src/shell-blur-effect.c b/src/shell-blur-effect.c
if (self->mode == mode)
return;
-@@ -905,3 +955,17 @@ shell_blur_effect_set_mode (ShellBlurEff
+@@ -905,3 +937,17 @@ shell_blur_effect_set_mode (ShellBlurEff
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_MODE]);
}
@@ -426,8 +408,8 @@ diff -Narup a/src/shell-blur-effect.c b/src/shell-blur-effect.c
+ clutter_effect_queue_repaint (CLUTTER_EFFECT (self));
+}
diff -Narup a/src/shell-blur-effect.h b/src/shell-blur-effect.h
---- a/src/shell-blur-effect.h 2021-11-06 14:09:18.864228559 +0800
-+++ b/src/shell-blur-effect.h 2021-11-06 14:09:18.864228559 +0800
+--- a/src/shell-blur-effect.h 2022-03-31 10:47:02.847618301 +0800
++++ b/src/shell-blur-effect.h 2022-03-31 10:47:02.847618301 +0800
@@ -20,6 +20,10 @@
#pragma once