Skip to content

Conversation

@ygerlach
Copy link
Contributor

@ygerlach ygerlach commented Nov 16, 2025

I have not tested this, as i didnt had time to setup fedora and reproduce the problem, but this should
Fix #474

(EDIT: I wasnt able to reproduce the initial issue, but my change helped some notifications to appear at all)

I branched from one of my other branches (#459) as i improved the handling of commands, that should not be run by root, what i needed here. So this branch shares some commits with #459 but they should not conflict and can be merged in any order (i will fix all conflicts otherwise)

The center of this fix is executing "notify-send" as user and not as root. But i also made the call async.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes notification issues by ensuring notify-send executes as the actual user rather than root, and makes the notification call asynchronous. The fix addresses issue #474 where notifications weren't appearing.

Key changes:

  • Introduces exec_user_async() to execute commands as the unprivileged user using pkexec
  • Refactors user ID and username lookup functions to use POSIX APIs directly instead of shell commands
  • Updates notification system to use the new async user execution method

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
src/Utility/TeeJee.System.vala Refactored user ID/username lookup to use POSIX APIs; changed get_user_id() to use SUDO_UID instead of SUDO_USER; simplified xdg_open() to use new exec_user_async()
src/Utility/TeeJee.Process.vala Added new exec_user_async() function to execute commands as unprivileged user with pkexec wrapper when running with elevated privileges
src/Utility/OSDNotify.vala Changed notification from synchronous exec_sync() to asynchronous exec_user_async() to run notify-send as the actual user
src/Gtk/MainWindow.vala Connected AboutDialog's activate_link signal to xdg_open() to handle link clicks with user-level execution

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mtwebster
Copy link
Member

Btw, I'm not using copilot only, but it's another pair of 'eyes' and it's not terrible at finding stupid mistakes and occasionally interesting things.

@ygerlach ygerlach force-pushed the fixNotify branch 2 times, most recently from 69e1e19 to 3c01e94 Compare November 25, 2025 20:03
@mtwebster mtwebster merged commit 915f2a5 into linuxmint:master Nov 26, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Problem with libnotify-bin - 60 seconds timeout after completion (create or restore)

2 participants