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

Difficult to bootstrap the display config option #20

Closed
Saviq opened this issue Sep 14, 2021 · 9 comments
Closed

Difficult to bootstrap the display config option #20

Saviq opened this issue Sep 14, 2021 · 9 comments
Labels
enhancement New feature or request

Comments

@Saviq
Copy link
Collaborator

Saviq commented Sep 14, 2021

It's currently difficult to retrieve the defaults for frame.display. We point at /var/snap/ubuntu-frame/current/frame.display, but that's an internal detail.

It would be good to snapctl set display … with the default config, since that what ends up in there anyway?

@Saviq Saviq added the enhancement New feature or request label Sep 14, 2021
@AlanGriffiths
Copy link
Contributor

Once the display layout is set we don't handle subsequent changes to the physical outputs very well. For now, I'd rather we "opt in" by manually setting a configuration. But I'm very open to ideas for improving this.

@Saviq
Copy link
Collaborator Author

Saviq commented Sep 21, 2021

Well, since the file is written by ubuntu-frame anyway, it's not really opt-in, is it?

@AlanGriffiths
Copy link
Contributor

Well, Mir won't write that file until it runs as a daemon for the first time. As an example, I don't have it on my system.

@Saviq
Copy link
Collaborator Author

Saviq commented Sep 21, 2021

Sure, but on Ubuntu Core, just installing ubuntu-frame makes the current setting the persistent one. But it's still not available through snap get until you manually snap set it.

@AlanGriffiths
Copy link
Contributor

AlanGriffiths commented Sep 21, 2021

Right, but when do you envisage setting it?

There's no file until after Mir has run as a daemon for the first time, so dumping snapctl set display="$(cat ${display_file})" in hooks/configure would not take effect until a subsequent "configure".

We probably want Mir to do some better change management (e.g. adding any new devices it encounters). And maybe have a "dump out the display config and exit" option too.

@Saviq
Copy link
Collaborator Author

Saviq commented Sep 21, 2021

Maybe we don't set it, but also don't store the file? At least not in a place that makes it the config? Like, always save it on startup (and thus, deal with hardware changes).

@AlanGriffiths
Copy link
Contributor

Ah! Yeah, it is a bit weird moving it out of the way only in the configure hook.

You'd be happy if we move the mv "${display_file}" "${display_file}.save" || true incantation from configure to run-frame? Want to PR that?

@Saviq
Copy link
Collaborator Author

Saviq commented Sep 21, 2021

But isn't ${display_file} used when you snap set ..., too? That doesn't sound right to move it about?

@AlanGriffiths
Copy link
Contributor

Yes, if $(snapctl get display) returns something (in configure) we write the file.

At present, if $(snapctl get display) returns nothing (in configure) we move the file out of the way.

Hypothetically, "if $(snapctl get display) returns nothing (in run-frame) we move the file" would give behaviour you're happy with?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants