Skip to content

Commit

Permalink
Improve screenshot logging, fix debug mode.
Browse files Browse the repository at this point in the history
The --verbose flag wasn't working.
  • Loading branch information
mtwebster committed Oct 13, 2024
1 parent b364687 commit 660af0f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions src/screenshot.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ send_response (ScreenshotHandle *handle)
if (handle->request->exported)
request_unexport (handle->request);

g_debug ("Sending screenshot/pickcolor response");

if (strcmp (handle->retval, "url") == 0)
{
GVariantBuilder opt_builder;
Expand Down Expand Up @@ -137,6 +139,8 @@ cinnamon_color_pick_done (GObject *source,
handle->response = 2;
}

g_debug ("ColorPicker returned: %f %f %f", handle->red, handle->green, handle->blue);

handle->response = 0;

send_response (handle);
Expand Down Expand Up @@ -203,6 +207,8 @@ construct_filename (void)
// saved to. The placeholder is a timestamp, e.g. "2017-05-21 12-24-03".
filename = g_strdup_printf ("%s/Screenshot from %s.png", pic_dir, timestamp);

g_debug ("Saving screenshot to %s", filename);

g_free (timestamp);
g_date_time_unref (datetime);

Expand All @@ -225,6 +231,8 @@ handle_pick_color (XdpImplScreenshot *object,
sender = g_dbus_method_invocation_get_sender (invocation);
request = request_new (sender, arg_app_id, arg_handle);

g_debug ("Got new PickColor request from '%s'", sender);

handle = g_new0 (ScreenshotHandle, 1);
handle->impl = object;
handle->invocation = invocation;
Expand Down Expand Up @@ -278,6 +286,8 @@ handle_screenshot (XdpImplScreenshot *object,
GSubprocess *proc;
GError *error = NULL;

g_debug ("Using xfce4-screenshooter to handle screenshot");

const gchar *argv[] = {
"xfce4-screenshooter",
"-f",
Expand All @@ -300,6 +310,7 @@ handle_screenshot (XdpImplScreenshot *object,
else
if (CINNAMON_MODE)
{
g_debug ("Calling Cinnamon to handle screenshot");
org_gnome_shell_screenshot_call_screenshot (cinnamon,
FALSE,
TRUE,
Expand All @@ -311,6 +322,7 @@ handle_screenshot (XdpImplScreenshot *object,
else
{
// mate
g_debug ("Screenshot not supported in MATE");
handle->response = 2;
send_response (handle);
}
Expand Down
2 changes: 1 addition & 1 deletion src/xdg-desktop-portal-xapp.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ main (int argc, char *argv[])
g_set_printerr_handler (printerr_handler);

if (opt_verbose)
g_log_set_handler (NULL, G_LOG_LEVEL_DEBUG, message_handler, NULL);
g_log_set_handler (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, message_handler, NULL);

g_set_prgname ("xdg-desktop-portal-xapp");

Expand Down

0 comments on commit 660af0f

Please sign in to comment.