Skip to content

Conversation

@cwendling
Copy link
Member

Follow-up to #368 to restore asynchronous screenshot saving, but doing it more reasonably this time (before #368 it was using a exec()-less fork(), which is unsafe when using GTK libraries, leading to bugs).

Restore asynchronous screenshot saving to improve reactivity, but use
proper asynchronous APIs instead of the previous dangerous fork()-based
solution, that mostly worked out of luck and stopped working with newer
gdk-pixbuf versions.
While at it, also create the temporary directory asynchronously, rather
than this part being the only synchronous operation.
@cwendling cwendling requested review from raveit65 and vkareh November 5, 2025 11:33
@L-U-T-i
Copy link

L-U-T-i commented Nov 7, 2025

I am getting the following build error with this patch:

/usr/bin/ld: /tmp/cc0yBufC.ltrans0.ltrans.o: in function `new_tmp_dir_async_ready':
/builddir/build/BUILD/mate-utils-c74d86d0f25435b1d90f70015d210448126bb6ef/mate-screenshot/src/screenshot-save.c:182: undefined reference to `g_file_new_tmp_dir_finish'
/usr/bin/ld: /tmp/cc0yBufC.ltrans0.ltrans.o: in function `screenshot_save_start':
/builddir/build/BUILD/mate-utils-c74d86d0f25435b1d90f70015d210448126bb6ef/mate-screenshot/src/screenshot-save.c:236: undefined reference to `g_file_new_tmp_dir_async'
collect2: error: ld returned 1 exit status
make[4]: *** [Makefile:566: mate-screenshot] Error 1

As much as I've been able to find, g_file_new_tmp_dir_finish and g_file_new_tmp_dir_async shall be available since glib2 2.74, while RHEL 9.6 is shipping with glib2 2.68.4 at the moment.

Older versions don't have g_file_new_tmp_dir_async(), so emulate it
there for compatibility.
@cwendling
Copy link
Member Author

@L-U-T-i ah, bummer. I just pushed a poor man's compatibility wrapper that seem to work fine. Tell me if that's still not enough.

@mate-desktop/core-team if the async directory stuff is getting too much out of hand, I can also drop it. Although nice, it used to be synchronous anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants