Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: make elevating process in execution an option #485

Conversation

Fuann-Kinoko
Copy link
Contributor

@Fuann-Kinoko Fuann-Kinoko commented Dec 22, 2023

If GlazeWM isn’t run with administrator privileges, it can't handle certain windows properly (#456 ). However, running cmd.exe or any other programs in an elevated GlazeWM will cause it to be opened with elevated permission as well.

I've attempted a (somewhat ugly) trick by using explorer.exe to open a shortcut of the program, allowing the target process to remain unelevated.

But there are still two aspects I believe need consideration:

  1. Is it necessary to delete the created temp.lnk? Although launching the new program occurs in a separate process, to avoid potential issues, GlazeWM's main process still waits for explorer.exe to finish before deleting temp.lnk. This might slightly increase program startup time. If temp.lnk isn’t deleted (I'm unsure if users would be concerned about it), none of the aforementioned issues would arise.
  2. What’s the default option for running programs? Currently, my approach is that exec cmd.exe spawns an unelevated process, while sudo exec cmd.exe invariably spawns an administrator process, regardless of whether GlazeWM.exe has elevated privileges.

@Video-Nomad
Copy link
Contributor

Runing GlazeWM as admin also causes the system tray component to ignore all non-elevated apps #331

@stianeklund
Copy link

@Fuann-Kinoko I don't think running GlazeVM as admin is the best option from a security standpoint, however, is there any way to tell if the window is an elevated one? If so maybe UAC elevation could be nice to allow interaction? I don't have any insight into this so forgive me if I'm asking in the wrong place & wrong person etc.

@lars-berger lars-berger deleted the branch glzr-io:develop August 11, 2024 16:21
@lars-berger
Copy link
Member

Due to the C# -> Rust rewrite, some of these older PRs aren't compatible anymore. Can't merge as is, and I'm sorry about not finding the time to get this in while the C# version was active. Nevertheless, thank you for contributing to GlazeWM 🙏

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.

4 participants