mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-31 08:21:59 +02:00
Flatpak: Add GTK4 popover unrealize patch
This is a temporary workaround I came up with for app performance drop on Wayland after any popover is opened. We are waiting for a proper fix from GTK4 devs. Until then, this is still much better that nothing.
This commit is contained in:
31
pkgs/flatpak/lib/gtk4-popover-unrealize.patch
Normal file
31
pkgs/flatpak/lib/gtk4-popover-unrealize.patch
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
From b413ee2c7d458c7005d3d3d1da8822cd86893ac0 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Rafostar <40623528+Rafostar@users.noreply.github.com>
|
||||||
|
Date: Fri, 4 Dec 2020 19:25:34 +0100
|
||||||
|
Subject: [PATCH] popover: Call unrealize on hide
|
||||||
|
|
||||||
|
When popover is shown "realize" method is called which creates a new
|
||||||
|
surface for popup. Unfortunately this causes performance drop on Wayland until that
|
||||||
|
surface is destroyed what happens inside "unrealize" method during popover destruction.
|
||||||
|
|
||||||
|
This commit changes default behavior in a way that surface will be destroyed
|
||||||
|
when popover is closed and app will ragain the performance it lost when
|
||||||
|
popover was shown.
|
||||||
|
---
|
||||||
|
gtk/gtkpopover.c | 1 +
|
||||||
|
1 file changed, 1 insertion(+)
|
||||||
|
|
||||||
|
diff --git a/gtk/gtkpopover.c b/gtk/gtkpopover.c
|
||||||
|
index 504dcd6cc1..a7a764d483 100644
|
||||||
|
--- a/gtk/gtkpopover.c
|
||||||
|
+++ b/gtk/gtkpopover.c
|
||||||
|
@@ -951,6 +951,7 @@ gtk_popover_hide (GtkWidget *widget)
|
||||||
|
|
||||||
|
gtk_popover_set_mnemonics_visible (GTK_POPOVER (widget), FALSE);
|
||||||
|
_gtk_widget_set_visible_flag (widget, FALSE);
|
||||||
|
+ gtk_widget_unrealize (widget);
|
||||||
|
gtk_widget_unmap (widget);
|
||||||
|
g_signal_emit (widget, signals[CLOSED], 0);
|
||||||
|
}
|
||||||
|
--
|
||||||
|
GitLab
|
||||||
|
|
@@ -17,6 +17,10 @@
|
|||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://gitlab.gnome.org/GNOME/gtk.git",
|
"url": "https://gitlab.gnome.org/GNOME/gtk.git",
|
||||||
"commit": "53cd499621b5f55df658725fb4f83d365a1319ad"
|
"commit": "53cd499621b5f55df658725fb4f83d365a1319ad"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "patch",
|
||||||
|
"path": "gtk4-popover-unrealize.patch"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user