Skip to content

Forced 200ms delay might be unnecessary for composited desktops

I found this code block that forces a delay of 200ms.

lib/screenshooter-capture-x11.c:941

  /* Await the specified delay, but not less than 200ms */
  if (delay == 0)
    g_usleep (200000);
  else
    sleep (delay);

Do you think this delay might be a little too long? I think it can be reduced to about 50ms-80ms or be eliminated. I apologize if I'm being ignorant but I'm not sure why this delay was done. See #111 (comment 102901)

Since the artifacts in the link doesn't show up for composited desktops, is it safe to remove the forced 200ms delay?

Initial bug report

Affected in xfce 4.20

xfce4-screenshooter 1.11.1

Description

When I happen to do something quick after taking a screenshot (e.g. switching windows), the content that I want to take the screenshot of is either partially or completely blocked.

Steps to reproduce

  1. Launch xfce4-screenshooter -c -r -d 0 in the terminal or from a shortcut
  2. Select a region
  3. After releasing the mouse, immediately hit Alt+Tab

Observed behavior

The window switcher or another window shows up and overlays the content.

Expected behavior

Screenshot taken immediately showing desired content

Screencast

xfce_screenshot_delay

Edited by Cas Pascal