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

deprecate --display #301

Closed

Conversation

guijan
Copy link
Contributor

@guijan guijan commented May 20, 2023

We don't need to duplicate the work XOpenDisplay() already does for us. Mark --display for removal at a later date.

2023-05-20-192641_678x87_scrot

We don't need to duplicate the work XOpenDisplay() already does for us.
Mark --display for removal at a later date.
@N-R-K
Copy link
Collaborator

N-R-K commented May 20, 2023

The multimonitor code seems to use the explicit display parameter - so removing -D probably won't buy us much LoC.

initXAndImlib(newDisp, i);

I don't know whether this is OK or hacky as I don't use multi-monitor setup.

Also setting an environment variable DISPLAY is not the same as -D - the exec-ed child will inherit the new $DISPLAY but not the one set via -D (not sure whether this matters in practice or not - but I wanted to make sure we're aware of the subtle changes that this introduces).

@guijan
Copy link
Contributor Author

guijan commented May 20, 2023

I think the difference between -D and the DISPLAY environment variable is an unintended consequence more than a feature. Are people really going to run scrot in one X server, and then exec a command in another?
Also, because system() invokes a shell, the user can make the exec string a script that first calls unset DISPLAY for this edge case.

@N-R-K
Copy link
Collaborator

N-R-K commented May 22, 2023

I think the difference between -D and the DISPLAY environment variable is an unintended consequence more than a feature. Are people really going to run scrot in one X server, and then exec a command in another?

Same. But as I said, I'm just trying to make sure we fully understand the effect of the change.


Also I looked a bit more into scrotGrabShotMulti's usage of initXAndImlib and I don't think we'll gain a whole lot by removing -D. Unless you want to fix/cleanup scrotGrabShotMulti (but keep in mind I have no way of testing such changes).

@guijan
Copy link
Contributor Author

guijan commented May 24, 2023

It'll still remove and simplify code if we keep the lines that get the display name from the environment for scrotGrabShotMulti(). Shouldn't be too hard. We don't have to fix that and deprecate -D at the same time either.

@N-R-K
Copy link
Collaborator

N-R-K commented May 25, 2023

It'll still remove and simplify code if we keep the lines that get the display name from the environment for scrotGrabShotMulti().

I don't think I follow, what would be removed and simplified exactly? Can you show a patch or something.

@N-R-K
Copy link
Collaborator

N-R-K commented Jun 2, 2024

Looking at it again, I don't see how removing --display buys us anything. And it's a straightforward flag to keep supporting, unlike --note for example.

@N-R-K N-R-K closed this Jun 2, 2024
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.

None yet

2 participants