kiwmi icon indicating copy to clipboard operation
kiwmi copied to clipboard

Add wlr_output_manager support

Open Uks2 opened this issue 2 years ago • 6 comments

This allows things like wlr-randr to work.

There's the standard wlroots plumbing to connect up, plus a few extra checks here and there to make sure we're not trying to access an output that doesn't exist anymore.

Uks2 avatar Jun 20 '22 17:06 Uks2

Can you split the diff unrelated to wlr_output_manager into a separate commit? It’s quite small i know, but it would help make the history cleaner.

ghost avatar Jun 21 '22 21:06 ghost

Wait! No! This version isn't sending events to lua at all. Rats.

I'll see if I can fix that tomorrow...

Uks2 avatar Jun 30 '22 21:06 Uks2

Another small problem I've noticed: if you disable a monitor using wlr-randr or whatever, the bounds for the cursor remain unchanged; you can move it off screen, into the invisible place where that monitor used to be.

I'm not sure why that's happening. When we create a wlr_cursor, we associate the wlr_output_layout with it, and wlroots registers its own handler for when that layout changes. I'll need to take a closer look at some point.

Uks2 avatar Jul 01 '22 20:07 Uks2

I believe that’s related to https://github.com/buffet/kiwmi/pull/62#discussion_r909450955: the wlr_output_layout doesn’t add/remove outputs as they are enabled/disabled, the compositor has to do it itself. (This behaviour is useful e.g. for wlr-output-power-management.)

ghost avatar Jul 02 '22 07:07 ghost

IIRC there was some issue before with sometimes erroneously getting a new output event, so i’ll see if it’s still there or got fixed mid-way

Seems like it got fixed and/or i remember wrongly.

Edit: for the record, it’s only me being dumb again and testing my rebase rather than this PR. That wrong event was apparently caused by changes in wlroots 0.16. No need to worry for now; it can be solved when the time comes.

ghost avatar Jul 12 '22 12:07 ghost

The commit message also isn’t right anymore (fortunately):

It required the addition of a flag to the output structure, because, when applying or testing a new layout, you have to go through each output and check that all their new configurations work. Then, if they all do, you go through again commit those changes and send off new output events and such. But you need a way of keeping track of which outputs have had their enabled status changed and it was simpler to just put that in the output's struct than to create some whole new data structure.

ghost avatar Jul 16 '22 11:07 ghost