Blame SOURCES/perf-tool-wayland.patch

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