From 614bcf6d0aabb2d41d08f2c9ec6f2ede157f5f9b Mon Sep 17 00:00:00 2001 From: Jehan Date: Sat, 9 Dec 2017 01:28:15 +0100 Subject: [PATCH] Bug 791352 - Screenshot delay is broken for region shots in GNOME. Delay should indeed happen before root and window screenshots, but must happen in-between region selection and region screenshot. One can notice that the logics is different for Windows screenshot in X11. The reason is that X11 window screenshot has an additional window selection step (and therefore delay must happen in between selection and actual screenshot). Window screenshot in Wayland doesn't have this step and simply screenshots whatever is the currently active Window. --- plug-ins/screenshot/screenshot-gnome-shell.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/plug-ins/screenshot/screenshot-gnome-shell.c b/plug-ins/screenshot/screenshot-gnome-shell.c index 406b98a289..a5b00e82e6 100644 --- a/plug-ins/screenshot/screenshot-gnome-shell.c +++ b/plug-ins/screenshot/screenshot-gnome-shell.c @@ -87,14 +87,14 @@ screenshot_gnome_shell_shoot (ScreenshotValues *shootvals, gint monitor = shootvals->monitor; gboolean success; - if (shootvals->select_delay > 0) - screenshot_delay (shootvals->select_delay); - filename = gimp_temp_name ("png"); switch (shootvals->shoot_type) { case SHOOT_ROOT: + if (shootvals->select_delay > 0) + screenshot_delay (shootvals->select_delay); + method = "Screenshot"; args = g_variant_new ("(bbs)", shootvals->show_cursor, @@ -134,9 +134,15 @@ screenshot_gnome_shell_shoot (ScreenshotValues *shootvals, gdk_screen_get_monitor_at_point (screen, (shootvals->x1 + shootvals->x2) / 2, (shootvals->y1 + shootvals->y2) / 2); + if (shootvals->select_delay > 0) + screenshot_delay (shootvals->select_delay); + break; case SHOOT_WINDOW: + if (shootvals->select_delay > 0) + screenshot_delay (shootvals->select_delay); + method = "ScreenshotWindow"; args = g_variant_new ("(bbbs)", shootvals->decorate,