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

Use only output if no output_name #167

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

matthewbauer
Copy link
Contributor

If we don’t have an output_name, but we have only one output, just use
that. This makes things easier to handle so that plug-and-play just
works. For multiple output setups, we fail, showing the old log
message.

/cc @Hjdskes

If we don’t have an output_name, but we have only one output, just use
that. This makes things easier to handle so that plug-and-play just
works. For multiple output setups, we fail, showing the old log
message.
@Hjdskes
Copy link
Collaborator

Hjdskes commented Aug 25, 2020

I don't think I'll accept this, as this risks breaking in non-obvious ways if the input device is actually not supposed to be mapped to this output device. It also ultimately works around a broken configuration.

What made you add this feature?

@matthewbauer
Copy link
Contributor Author

matthewbauer commented Aug 25, 2020

I was actually seeing an unrelated bug first where no pointer / keyboard would focus on my GTK app. That ended up being fixed by updating to wlroots 0.11. I was seeing the Input device %s cannot be mapped to an output device message and figured that must've been the problem

But, I wanted to restore the old behavior where pointers mapped to output automatically without WL_OUTPUT:

https://github.com/Hjdskes/cage/blob/0aeba8085cc023e42aedc7e2d54cb3fd23bafdbf/seat.c#L195

I'm using qemu with the "virtio-tablet-pci" device, so there's not a clear way to set up the mapping correctly. It looks like not having wlr_cursor_map_input_to_output called is not that important though? I could see some situations where it might throw things off.

@iohzrd
Copy link

iohzrd commented Jun 20, 2021

I was just looking into implementing this feature myself, so I'm glad I found this PR first.

@Hjdskes
I understand wanting to avoid scenarios where things break in non-obvious ways, but perhaps a reasonable compromise could be to require a command line switch for it to behave in this way. Making it more obvious.
Thoughts?

@iohzrd
Copy link

iohzrd commented Jun 21, 2021

Something like this perhaps.
iohzrd@c88aa04

@emersion
Copy link
Contributor

I'm not exactly following why explicitly mapping to the single output is necessary. If an input device isn't mapped to a specific output, wlroots maps it to the whole layout, which only contains the one output. So that should be strictly equivalent to explicitly mapping the input device to the output. What am I missing here?

@emersion
Copy link
Contributor

plug-and-play just works

So this is about plugging an output later on, and still have the input device mapped to a single output?

The behavior in this PR sounds inconsistent and fragile. If the external output is plugged in at startup time then the mapping will be broken. There is no guarantee that the user wants to map the input device to the output.

Sway has some heuristics to detect internal touchscreens, maybe that could be ported over. In any case, would be nice to have a proper way to configure the mappings (the heuristic doesn't catch all cases).

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

4 participants