You are not logged in.
Not sure how to troubleshoot this. Any idea?
Last edited by pm3840 (2024-03-31 22:48:40)
Offline
No.
https://bbs.archlinux.org/viewtopic.php?id=57855
I'd "scrot -F - | xsel -i", you probably want to https://man.archlinux.org/man/extra/xfc … ter.1.en#c and for everything else, you'll have to elaborate a bit on the problem.
Like, eg., describing it and also the environment (eg. if you're trying that in a wayland session, it will very most likely not work)
Offline
Well, it's all GUI. I've checked journalctl but nothing is there.
clipman is running and its tray icon is on taskbar. No problem there too.
Let me try though.
I open a terminal and run this "xfce4-screenshooter -f -c". There's no error. Same goes for "xfce4-screenshooter -r -c"
What else can be attached here?
$ xfce4-screenshooter -f -c
$ echo $?
0
The alt for me is to open captured in chromium and then go to chromium and do "copy image"
Last edited by pm3840 (2024-03-30 18:22:47)
Offline
xfce4-screenshooter -f -c
xsel -o > /tmp/test.file
file /tmp/test.file
xsel -o -b > /tmp/test.file
file /tmp/test.file
Offline
$ xfce4-screenshooter -f -c
$ xsel -o > /tmp/test.file
$ file /tmp/test.file
/tmp/test.file: ASCII text
$ xsel -o -b > /tmp/test.file
$ file /tmp/test.file
/tmp/test.file: ASCII text, , with no line terminators
$
Here it is. Thank you!
Last edited by pm3840 (2024-03-30 20:08:05)
Offline
So those are text files, it seems screeshooter doesn't put anything onto the clipboard.
Do you use some sort of clipboard manager?
There apparently used to be https://bugzilla.xfce.org/show_bug.cgi?id=15244 - can you get screenshots of small(er) screen fractions into the clipboard?
Offline
Yes I use xfce4 clipman. According to doc https://docs.xfce.org/apps/xfce4-screenshooter/usage it's required for this feature to work
Copy to the clipboard option allows you to paste the screenshot in another application, such as a word processor. This option is only available when a clipboard manager is running."
Chromium "copy image" works just fine, even big size image.
I see that quite a few bug reports were determined to be invalid. And the new bug tracker at https://gitlab.xfce.org/apps/xfce4-screenshooter doesn't have much.
I don't think there's a second clipboard manager running if that matters.
Offline
When you copy the image to the clipboard, does clicking on the clipboard icon in the panel display the image in the history? If not, can you confirm your version of xfce4-screenshooter?
Edit: the clipboard contents should be saved to ~/.cache/xfce4/clipman - check if the image file shows up there.
Last edited by toz (2024-03-31 00:53:44)
Offline
No. History is not touched. Version is the latest available:
$ pacman -Q|grep screensh
xfce4-screenshooter 1.10.5-1
xfce4-screenshooter doesn't affect ~/.cache/xfce4/clipman/image0.png. Chromium "copy image" does.
Offline
Perhaps you could do a quick debug build of the package to see exactly what's happening (no need to actually install this build)?
-snip-
This will generate debug output which you can post back.
You may need to install some extra packages like base-devel, intltool and xfce4-dev-tools, but you can remove them later.
Edit: probably not a good idea to just drop random code here. You can find the debug parameters here. You can create a temporary build, without actually installing, by grabbing the source from the official upstream source repository (or building directly from git) with "--enable-debug=full". This will generate debug output when you manually run xfce4-screenshooter from the build's "src" directory.
Last edited by toz (2024-03-31 03:00:38)
Offline
screenshooter depends on xclip, which doesn't ship a library…
scrot -F - | xclip -i
xclip -o > /tmp/test.png
file /tmp/test.png
Offline
Excuse my C lang skill.
I find the logic here weird like the actions are offered as radio buttons not check boxes so why does the code do more than specified? screenshot is saved to "tmp" directory anyway when "copy to clipboard"
https://gitlab.xfce.org/apps/xfce4-scre … _type=tags
if (sd->action & CLIPBOARD)
screenshooter_copy_to_clipboard (sd->screenshot);
if (sd->action & SAVE)
{
...
}
else {
GFile *temp_dir = g_file_new_for_path (g_get_tmp_dir ());
gchar *temp_dir_uri = g_file_get_uri (temp_dir);
gchar *filename = screenshooter_get_filename_for_uri (temp_dir_uri,
sd->title,
sd->last_extension,
sd->timestamp);
save_location = screenshooter_save_screenshot (sd->screenshot,
temp_dir_uri,
filename,
sd->last_extension,
FALSE,
FALSE);
}
This part is straight forward. According to GTK doc GTK takes care of everything pretty much.
https://docs.gtk.org/gtk3/type_func.Cli … splay.html
https://docs.gtk.org/gtk3/method.Clipbo … image.html
https://gitlab.xfce.org/apps/xfce4-scre … _type=tags
/* Copy the screenshot to the Clipboard.
* Code is from gnome-screenshooter.
* @screenshot: the screenshot
*/
void
screenshooter_copy_to_clipboard (GdkPixbuf *screenshot)
{
GtkClipboard *clipboard;
TRACE ("Adding the image to the clipboard...");
clipboard =
gtk_clipboard_get_for_display (gdk_display_get_default(), GDK_SELECTION_CLIPBOARD);
gtk_clipboard_set_image (clipboard, screenshot);
}
Offline
actions are offered as radio buttons not check boxes so why does the code
The code there (has horrible newline/indention patterns and) checks whether some sd-action flag is set, the settings could translate to that exclusively ie. "sd->action & (CLIPBOARD|SAVE) == CLIPBOARD|SAVE" isn't an expected condition.
Did you test whether you can scrot into xclip?
The problem might be gtk_clipboard_set_image
Offline
Forgot to attach the debug build log. gtk_clipboard_set_image() might fail but its type is void doesn't return anything.
$ src/xfce4-screenshooter -r -c
TRACE[lib/screenshooter-utils.c:194] screenshooter_read_rc_file(): Open the rc file
TRACE[lib/screenshooter-utils.c:200] screenshooter_read_rc_file(): Read the entries
TRACE[lib/screenshooter-utils.c:231] screenshooter_read_rc_file(): Close the rc file
TRACE[lib/screenshooter-utils.c:238] screenshooter_read_rc_file(): Set the values of the struct
TRACE[lib/screenshooter-capture.c:1486] screenshooter_capture_screenshot(): Let the user select the region to screenshot
TRACE[lib/screenshooter-capture.c:571] cb_draw(): Draw event received.
TRACE[lib/screenshooter-capture.c:634] cb_button_pressed(): Left button pressed
TRACE[lib/screenshooter-capture.c:779] cb_motion_notify(): Mouse is moving with left button pressed
TRACE[lib/screenshooter-capture.c:571] cb_draw(): Draw event received.
TRACE[lib/screenshooter-capture.c:779] cb_motion_notify(): Mouse is moving with left button pressed
TRACE[lib/screenshooter-capture.c:571] cb_draw(): Draw event received.
TRACE[lib/screenshooter-capture.c:779] cb_motion_notify(): Mouse is moving with left button pressed
TRACE[lib/screenshooter-capture.c:571] cb_draw(): Draw event received.
TRACE[lib/screenshooter-capture.c:779] cb_motion_notify(): Mouse is moving with left button pressed
TRACE[lib/screenshooter-capture.c:571] cb_draw(): Draw event received.
TRACE[lib/screenshooter-capture.c:779] cb_motion_notify(): Mouse is moving with left button pressed
TRACE[lib/screenshooter-capture.c:571] cb_draw(): Draw event received.
TRACE[lib/screenshooter-capture.c:779] cb_motion_notify(): Mouse is moving with left button pressed
TRACE[lib/screenshooter-capture.c:779] cb_motion_notify(): Mouse is moving with left button pressed
TRACE[lib/screenshooter-capture.c:779] cb_motion_notify(): Mouse is moving with left button pressed
TRACE[lib/screenshooter-capture.c:571] cb_draw(): Draw event received.
TRACE[lib/screenshooter-capture.c:779] cb_motion_notify(): Mouse is moving with left button pressed
TRACE[lib/screenshooter-capture.c:571] cb_draw(): Draw event received.
TRACE[lib/screenshooter-capture.c:779] cb_motion_notify(): Mouse is moving with left button pressed
TRACE[lib/screenshooter-capture.c:779] cb_motion_notify(): Mouse is moving with left button pressed
TRACE[lib/screenshooter-capture.c:779] cb_motion_notify(): Mouse is moving with left button pressed
TRACE[lib/screenshooter-capture.c:571] cb_draw(): Draw event received.
TRACE[lib/screenshooter-capture.c:779] cb_motion_notify(): Mouse is moving with left button pressed
TRACE[lib/screenshooter-capture.c:571] cb_draw(): Draw event received.
TRACE[lib/screenshooter-capture.c:779] cb_motion_notify(): Mouse is moving with left button pressed
TRACE[lib/screenshooter-capture.c:571] cb_draw(): Draw event received.
TRACE[lib/screenshooter-capture.c:779] cb_motion_notify(): Mouse is moving with left button pressed
TRACE[lib/screenshooter-capture.c:779] cb_motion_notify(): Mouse is moving with left button pressed
TRACE[lib/screenshooter-capture.c:779] cb_motion_notify(): Mouse is moving with left button pressed
TRACE[lib/screenshooter-capture.c:571] cb_draw(): Draw event received.
TRACE[lib/screenshooter-capture.c:779] cb_motion_notify(): Mouse is moving with left button pressed
TRACE[lib/screenshooter-capture.c:571] cb_draw(): Draw event received.
TRACE[lib/screenshooter-capture.c:779] cb_motion_notify(): Mouse is moving with left button pressed
TRACE[lib/screenshooter-capture.c:571] cb_draw(): Draw event received.
TRACE[lib/screenshooter-utils.c:156] screenshooter_copy_to_clipboard(): Adding the image to the clipboard...
TRACE[lib/screenshooter-utils.c:487] screenshooter_get_filename_for_uri(): Get the folder corresponding to the URI
DBG[lib/screenshooter-utils.c:100] get_datetime(): datetime is 2024-03-31_06-59-46
TRACE[src/main.c:133] cb_finalize(): Execute finalize callback
TRACE[lib/screenshooter-utils.c:280] screenshooter_write_rc_file(): Open the rc file
TRACE[lib/screenshooter-utils.c:286] screenshooter_write_rc_file(): Write the entries.
TRACE[lib/screenshooter-utils.c:316] screenshooter_write_rc_file(): Flush and close the rc file
TRACE[src/main.c:364] main(): Ciao
scrot works.
screenshooter also works just the clipboard part fails.
$ scrot -F - | xclip -i
$ xclip -o > /tmp/test.png
$ file /tmp/test.png
/tmp/test.png: PNG image data, 3840 x 1200, 8-bit/color RGB, non-interlaced
Last edited by pm3840 (2024-03-31 15:00:43)
Offline
xclip doesn't affect clipboard either. only X selections.
Offline
Please use [code][/code] tags, not "quote" tags. Edit your post in this regard.
TRACE[lib/screenshooter-utils.c:156] screenshooter_copy_to_clipboard(): Adding the image to the clipboard...
The problem might be gtk_clipboard_set_image
But I don't understand why screenshooter drags in xclip if it uses the gtk function.
Is this a regression, ie. has this worked in the past an only fails now?
Edit: "xclip -i -selection clipboard"
Last edited by seth (2024-03-31 15:01:26)
Offline
Is this a regression, ie. has this worked in the past an only fails now?
This works for me on my systems, so its not a regression. There is something askew here though as you suggest, maybe with gtk_clipboard_set_image?
Edit: @OP, can you post back:
xfconf-query -c xfce4-panel -lv | grep clipman
Or maybe something with clipman settings?
Last edited by toz (2024-03-31 15:09:13)
Offline
You're also running clipman on xfce?
Offline
clipman still doesn't pick up
$ scrot -F - | xclip -i -selection clipboard
$ xclip -o -selection clipboard > /tmp/test.png
$ file /tmp/test.png
/tmp/test.png: PNG image data, 3840 x 1200, 8-bit/color RGB, non-interlaced
$ xfconf-query -c xfce4-panel -lv | grep clipman
/plugins/clipman/tweaks/inhibit false
/plugins/plugin-20 xfce4-clipman-plugin
Offline
I'm a new user to xfce wouldn't know if this worked before.
Funny xclip doesn't always complain about bad options:
$ scrot -F - | xclip -i --selection clipboard
xclip: --selection: No such file or directory
$ xclip -o --selection clipboard > /tmp/test.png
$ file /tmp/test.png
/tmp/test.png: ASCII text, with no line terminators
$ xclip -o -selection clipboard > /tmp/test.png
$ file /tmp/test.png
/tmp/test.png: PNG image data, 3840 x 1200, 8-bit/color RGB, non-interlaced
$
Offline
"--selection" is simply wrong, it doens't use the gnu doubledash syntax.
If you quit/kill clipman, does screenshooter work as expected?
Offline
Yeah but it doesn't complain when -o is used
Same. Clipboard is not updated.
$ ps ax | grep clip
354079 pts/8 S+ 0:00 grep --color=auto clip
$ xfce4-screenshooter -f -c
$
"--selection" is simply wrong, it doens't use the gnu doubledash syntax.
If you quit/kill clipman, does screenshooter work as expected?
Offline
@toz You probably have "Remember last copied image" enabled in clipman history?
With this option unchecked I can reproduce the issue.
I think it's this one: https://gitlab.xfce.org/xfce/libxfce4ui/-/issues/105
Xfce maintainer: https://gravatar.com/gaelbdx1
Offline
Yes I have this enabled "Remember last copied image" and at least Chromium "Copy image" works.
If this is not enabled, Chromium "Copy image" also fails.
Offline
It always works for me with this option enabled, not sure what happens then.
Xfce maintainer: https://gravatar.com/gaelbdx1
Offline