static GdkWindow *
find_current_window (char **window_title)
{
  GdkWindow *window;

  if (!screenshot_grab_lock ())
    exit (0);

  if (take_window_shot)
    {
      window = screenshot_find_current_window ();
      if (!window)
	{
	  take_window_shot = FALSE;
	  window = gdk_get_default_root_window ();
	}
      else
	{
	  gchar *tmp, *sanitized;

	  tmp = screenshot_get_window_title (window);
	  sanitized = screenshot_sanitize_filename (tmp);
	  g_free (tmp);
	  *window_title = sanitized;
	}
    }
  else
    {
      window = gdk_get_default_root_window ();
    }

  return window;
}
Exemple #2
0
static GdkWindow *
find_current_window (void)
{
  GdkWindow *window = NULL;

  if (!screenshot_grab_lock ())
    exit (0);

  if (screenshot_config->take_window_shot)
    {
      window = screenshot_find_current_window ();

      if (window == NULL)
        screenshot_config->take_window_shot = FALSE;
    }

  if (window == NULL)
    window = gdk_get_default_root_window ();

  return window;
}