From 3074051b3da2c54733dda09b6608e9b4e4025fe9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Dzi=C4=99giel?= Date: Thu, 31 Mar 2022 16:46:09 +0200 Subject: [PATCH] flatpak: Build recent GTK 4.6.2 version We are gonna move into depending on at least 4.6.0, build it for CI to pass --- pkgs/flatpak/com.github.rafostar.Clapper.json | 2 +- .../testing/gtk4-popover-unrealize.patch | 31 +++++++++++++++++ pkgs/flatpak/testing/gtk4.json | 33 +++++++++++++++++++ 3 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 pkgs/flatpak/testing/gtk4-popover-unrealize.patch create mode 100644 pkgs/flatpak/testing/gtk4.json diff --git a/pkgs/flatpak/com.github.rafostar.Clapper.json b/pkgs/flatpak/com.github.rafostar.Clapper.json index d03621e1..39c3eabd 100644 --- a/pkgs/flatpak/com.github.rafostar.Clapper.json +++ b/pkgs/flatpak/com.github.rafostar.Clapper.json @@ -35,7 +35,7 @@ "flathub/lib/uchardet.json", "testing/libsoup3.json", "flathub/gstreamer-1.0/gstreamer.json", - "flathub/lib/gtk4.json", + "testing/gtk4.json", "flathub/lib/libadwaita.json", "testing/gtuber.json", { diff --git a/pkgs/flatpak/testing/gtk4-popover-unrealize.patch b/pkgs/flatpak/testing/gtk4-popover-unrealize.patch new file mode 100644 index 00000000..c5b90efd --- /dev/null +++ b/pkgs/flatpak/testing/gtk4-popover-unrealize.patch @@ -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 + diff --git a/pkgs/flatpak/testing/gtk4.json b/pkgs/flatpak/testing/gtk4.json new file mode 100644 index 00000000..aac780d8 --- /dev/null +++ b/pkgs/flatpak/testing/gtk4.json @@ -0,0 +1,33 @@ +{ + "name": "gtk", + "buildsystem": "meson", + "config-opts": [ + "--buildtype=release", + "--wrap-mode=nofallback", + + "-Dwin32-backend=false", + "-Dmacos-backend=false", + "-Dmedia-ffmpeg=disabled", + "-Dprint-cups=disabled", + "-Dintrospection=enabled", + "-Ddemos=false", + "-Dbuild-examples=false", + "-Dbuild-tests=false" + ], + "cleanup": [ + "/bin/gtk4-builder-tool", + "/bin/gtk4-encode-symbolic-svg" + ], + "sources": [ + { + "type": "git", + "url": "https://gitlab.gnome.org/GNOME/gtk.git", + "tag": "4.6.2", + "commit": "aec7ca82007dbe07faee6be084d20758ebac2b91" + }, + { + "type": "patch", + "path": "gtk4-popover-unrealize.patch" + } + ] +}