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

nitrogen --restore does not work if one of the external monitors is disconnected. #55

Closed
denilsonsa opened this issue May 11, 2015 · 5 comments

Comments

@denilsonsa
Copy link

How to reproduce:

  1. Use xrandr (or arandr) to setup a second monitor.
  2. Use nitrogen to set a different wallpaper (or the same one) for each of your 2 screens.
  3. Run nitrogen --restore. It works.
  4. Now disable your second monitor, so that you have only one screen.
  5. Run nitrogen --restore. It fails because it can't find the second monitor.

Expected: it should gracefully ignore non-connected screens. Optionally, it could print a message saying that such screen was being ignored.

It is worth noting that, in my config file, the first item was number 1, and the second was number 0. I haven't tried if the order is different, and the order should alter the behavior.

@daf
Copy link
Member

daf commented May 11, 2015

I'm not too familiar with using xrandr to enable/disable monitors - does this use Xinerama/TwinView or regular independent X displays?

@denilsonsa
Copy link
Author

It uses Xinerama. I'm using a laptop with intel CPU and videocard.
Since it is a laptop, disconnecting and reconnecting an external monitor is a common use-case.

@daf
Copy link
Member

daf commented May 13, 2015

Yeah, I know what's causing it then. In the config file, for Xinerama, it uses xin_0, xin_1, etc for the keys, and I bet the API isn't reporting them in the expected order or similar. Maybe even omitting 0.

I've actually just received a laptop from work (my first in many years), so I'll be able to replicate soon.

@daf daf closed this as completed in b596809 Jun 16, 2015
@daf
Copy link
Member

daf commented Jun 16, 2015

@denilsonsa Please give this fix a try if you can. The code was only considering Xinerama if there was more than one screen available - it's been relaxed now. It might affect non-xinerama setups, but I don't have a working setup in that mode anymore and kind of think most of the userbase also wouldn't.

@denilsonsa
Copy link
Author

I can confirm, this is fixed. Thanks!

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

No branches or pull requests

2 participants