I noticed that under Wayland, running GParted with root privileges can be problematic because GUI applications cannot access the display as root. I would like to propose a potential workaround that may help make GParted functional under Wayland:
The core functionality of GParted already relies on command-line tools that require root privileges. My suggestion is to separate the privileged backend from the graphical user interface in the following way:
-
The user launches the core backend component with root privileges.
-
This core backend then starts the GParted graphical interface as an unprivileged user.
-
The role of the GUI is only to display information and to generate an execution script when the user clicks the Apply button.
-
Once the script is generated, the privileged backend executes it with administrative rights.
-
The backend can then analyze the script’s exit codes to determine whether the operation succeeded or failed.
This architecture would allow GParted to remain Wayland-compatible, since the GUI itself would not need elevated privileges.