1 Star 0 Fork 2

chengchaonan_1/gala

forked from src-oepkgs/gala 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0003-adapt-to-mutter-3.38-API-changes.patch 3.29 KB
一键复制 编辑 原始数据 按行查看 历史
张一诺 提交于 2022-11-30 08:39 . 3.3.2
From 9f68e58ca39d8a1416d1340e09718cf756d36a9f Mon Sep 17 00:00:00 2001
From: Fabio Valentini <decathorpe@gmail.com>
Date: Thu, 27 Aug 2020 15:11:43 +0200
Subject: [PATCH 3/8] adapt to mutter 3.38 API changes
---
lib/Plugin.vala | 12 ++++++++++++
src/Widgets/WindowClone.vala | 17 +++++++++++++++++
2 files changed, 29 insertions(+)
diff --git a/lib/Plugin.vala b/lib/Plugin.vala
index 1b3e95f..039df11 100644
--- a/lib/Plugin.vala
+++ b/lib/Plugin.vala
@@ -149,7 +149,11 @@ namespace Gala {
*/
public void track_actor (Clutter.Actor actor) {
tracked_actors.prepend (actor);
+#if HAS_MUTTER338
+ actor.notify["allocation"].connect (on_actor_allocation_changed);
+#else
actor.allocation_changed.connect (actor_allocation_changed);
+#endif
update_region ();
}
@@ -162,7 +166,11 @@ namespace Gala {
*/
public void untrack_actor (Clutter.Actor actor) {
tracked_actors.remove (actor);
+#if HAS_MUTTER338
+ actor.notify["allocation"].disconnect (on_actor_allocation_changed);
+#else
actor.allocation_changed.disconnect (actor_allocation_changed);
+#endif
}
/**
@@ -202,7 +210,11 @@ namespace Gala {
region_changed ();
}
+#if HAS_MUTTER338
+ private void on_actor_allocation_changed (GLib.Object actor_object, GLib.ParamSpec pspec) {
+#else
private void actor_allocation_changed (Clutter.ActorBox box, Clutter.AllocationFlags f) {
+#endif
if (!freeze_track)
update_region ();
}
diff --git a/src/Widgets/WindowClone.vala b/src/Widgets/WindowClone.vala
index efec6ff..770275d 100644
--- a/src/Widgets/WindowClone.vala
+++ b/src/Widgets/WindowClone.vala
@@ -341,12 +341,21 @@ namespace Gala {
* according to their given allocations. The first two are placed in a way
* that compensates for invisible borders of the texture.
*/
+#if HAS_MUTTER338
+ public override void allocate (ActorBox box) {
+ base.allocate (box);
+#else
public override void allocate (ActorBox box, AllocationFlags flags) {
base.allocate (box, flags);
+#endif
foreach (var child in get_children ()) {
if (child != clone && child != active_shape)
+#if HAS_MUTTER338
+ child.allocate_preferred_size ();
+#else
child.allocate_preferred_size (flags);
+#endif
}
ActorBox shape_alloc = {
@@ -355,7 +364,11 @@ namespace Gala {
box.get_width () + ACTIVE_SHAPE_SIZE,
box.get_height () + ACTIVE_SHAPE_SIZE
};
+#if HAS_MUTTER338
+ active_shape.allocate (shape_alloc);
+#else
active_shape.allocate (shape_alloc, flags);
+#endif
if (clone == null || dragging)
return;
@@ -370,7 +383,11 @@ namespace Gala {
(input_rect.y - outer_rect.y) * scale_factor);
alloc.set_size (actor.width * scale_factor, actor.height * scale_factor);
+#if HAS_MUTTER338
+ clone.allocate (alloc);
+#else
clone.allocate (alloc, flags);
+#endif
}
public override bool button_press_event (Clutter.ButtonEvent event) {
--
2.26.2
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/chengchaonan-one/gala.git
git@gitee.com:chengchaonan-one/gala.git
chengchaonan-one
gala
gala
openEuler-22.03-LTS

搜索帮助

0d507c66 1850385 C8b1a773 1850385