Blame SOURCES/perf-tool-wayland.patch

35159f
From 3c4c37e4d0668d748ee792f7580defdf4780624a Mon Sep 17 00:00:00 2001
35159f
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
35159f
Date: Thu, 5 Dec 2019 14:12:47 +0100
35159f
Subject: [PATCH 1/2] perf-helper: Add content for custom drawing
35159f
35159f
Drawing windows got a lot more involved with the advent of client-side
35159f
decorations. Instead of accounting for visible and invisible borders,
35159f
titlebar and shadows when necessary, just add an empty child for the
35159f
custom drawing.
35159f
35159f
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/887
35159f
---
35159f
 src/shell-perf-helper.c | 12 ++++++++----
35159f
 1 file changed, 8 insertions(+), 4 deletions(-)
35159f
35159f
diff --git a/src/shell-perf-helper.c b/src/shell-perf-helper.c
35159f
index f115dcbdc..ba1754e02 100644
35159f
--- a/src/shell-perf-helper.c
35159f
+++ b/src/shell-perf-helper.c
35159f
@@ -119,9 +119,9 @@ on_window_map_event (GtkWidget   *window,
35159f
 }
35159f
 
35159f
 static gboolean
35159f
-on_window_draw (GtkWidget  *window,
35159f
-		cairo_t    *cr,
35159f
-                WindowInfo *info)
35159f
+on_child_draw (GtkWidget  *window,
35159f
+               cairo_t    *cr,
35159f
+               WindowInfo *info)
35159f
 {
35159f
   cairo_rectangle_int_t allocation;
35159f
   double x_offset, y_offset;
35159f
@@ -203,6 +203,7 @@ create_window (int      width,
35159f
                gboolean redraws)
35159f
 {
35159f
   WindowInfo *info;
35159f
+  GtkWidget *child;
35159f
 
35159f
   info = g_new0 (WindowInfo, 1);
35159f
   info->width = width;
35159f
@@ -218,10 +219,13 @@ create_window (int      width,
35159f
   info->pending = TRUE;
35159f
   info->start_time = -1;
35159f
 
35159f
+  child = g_object_new (GTK_TYPE_BOX, "visible", TRUE, "app-paintable", TRUE, NULL);
35159f
+  gtk_container_add (GTK_CONTAINER (info->window), child);
35159f
+
35159f
   gtk_widget_set_size_request (info->window, width, height);
35159f
   gtk_widget_set_app_paintable (info->window, TRUE);
35159f
   g_signal_connect (info->window, "map-event", G_CALLBACK (on_window_map_event), info);
35159f
-  g_signal_connect (info->window, "draw", G_CALLBACK (on_window_draw), info);
35159f
+  g_signal_connect (child, "draw", G_CALLBACK (on_child_draw), info);
35159f
   gtk_widget_show (info->window);
35159f
 
35159f
   if (info->redraws)
35159f
-- 
35159f
2.23.0
35159f
35159f
35159f
From 0185c288c3e6b82b76f2a0704aab0e2ab20b75b8 Mon Sep 17 00:00:00 2001
35159f
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
35159f
Date: Thu, 5 Dec 2019 13:29:38 +0100
35159f
Subject: [PATCH 2/2] perf-helper: Remove unused atoms
35159f
35159f
Those aren't used for anything, but make the helper dependent on X11.
35159f
35159f
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/887
35159f
---
35159f
 src/shell-perf-helper.c | 18 ------------------
35159f
 1 file changed, 18 deletions(-)
35159f
35159f
diff --git a/src/shell-perf-helper.c b/src/shell-perf-helper.c
35159f
index ba1754e02..a50376e2e 100644
35159f
--- a/src/shell-perf-helper.c
35159f
+++ b/src/shell-perf-helper.c
35159f
@@ -12,7 +12,6 @@
35159f
 #include <math.h>
35159f
 
35159f
 #include <gtk/gtk.h>
35159f
-#include <gdk/gdkx.h>
35159f
 
35159f
 #define BUS_NAME "org.gnome.Shell.PerfHelper"
35159f
 
35159f
@@ -60,12 +59,6 @@ static GOptionEntry opt_entries[] =
35159f
     { NULL }
35159f
   };
35159f
 
35159f
-static Display *xdisplay;
35159f
-static Window xroot;
35159f
-static Atom atom_wm_state;
35159f
-static Atom atom__net_wm_name;
35159f
-static Atom atom_utf8_string;
35159f
-
35159f
 static guint timeout_id;
35159f
 static GList *our_windows;
35159f
 static GList *wait_windows_invocations;
35159f
@@ -350,8 +343,6 @@ on_name_lost  (GDBusConnection *connection,
35159f
 int
35159f
 main (int argc, char **argv)
35159f
 {
35159f
-  GdkDisplay *display;
35159f
-  GdkScreen *screen;
35159f
   GOptionContext *context;
35159f
   GError *error = NULL;
35159f
 
35159f
@@ -367,15 +358,6 @@ main (int argc, char **argv)
35159f
       return 1;
35159f
     }
35159f
 
35159f
-  display = gdk_display_get_default ();
35159f
-  screen = gdk_screen_get_default ();
35159f
-
35159f
-  xdisplay = gdk_x11_display_get_xdisplay (display);
35159f
-  xroot = gdk_x11_window_get_xid (gdk_screen_get_root_window (screen));
35159f
-  atom_wm_state = gdk_x11_get_xatom_by_name_for_display (display, "WM_STATE");
35159f
-  atom__net_wm_name = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_NAME");
35159f
-  atom_utf8_string = gdk_x11_get_xatom_by_name_for_display (display, "UTF8_STRING");
35159f
-
35159f
   g_bus_own_name (G_BUS_TYPE_SESSION,
35159f
                   BUS_NAME,
35159f
                   G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT |
35159f
-- 
35159f
2.23.0
35159f