Skip to content

Render layer shell popups over the top layer#4781

Merged
emersion merged 2 commits intoswaywm:masterfrom
David96:layer-shell-popups
Apr 10, 2020
Merged

Render layer shell popups over the top layer#4781
emersion merged 2 commits intoswaywm:masterfrom
David96:layer-shell-popups

Conversation

@David96
Copy link
Copy Markdown
Contributor

@David96 David96 commented Dec 3, 2019

As talked about in #4684, this renders popups separately from the corresponding windows, to make sure they are always displayed above other windows. I'm not sure though, whether they should be rendered before or after the top layer.

Furthermore, I don't have a good understanding of sways rendering code. This seems to work for me, but I cannot really figure out the side effects those changes may have. Splitting the output_layer_for_each_surface in three functions also gives some code duplication but I wanted to make sure to not break anything using output_layer_for_each_surface and expecting it to also include popups.
So it would be nice, if someone with an actual understanding of this code could give it a look and it's also why it is marked [WIP].

Edit: something I just realised: this changes the rendering order, but it doesn't change the order used for giving focus, therefore e.g. a context menu doesn't get any input events outside of the parent window.

@alebastr
Copy link
Copy Markdown
Contributor

alebastr commented Mar 2, 2020

To finish this PR matching changes to sway/input/cursor.c are needed. I made a PoC change that seems to be working as expected: alebastr@a9bd645
However the changes required to make this working made me think that rendering layer shell toplevel and popups on a different layers is way outside of initial assumptions. Maybe there's a cleaner way to do that, like changing layer-shell surface storage to be a single list sorted in a desired rendering/focus order and having only one place in the code that defines the order. Or 3 lists, overlay, above normal surfaces and below normal surfaces.

@emersion
Copy link
Copy Markdown
Member

emersion commented Mar 3, 2020

Then you need to sort the list, and find a way to store mixed layer surfaces and popups in the list. I'm not sure it'll be simpler in the end.

@David96 David96 force-pushed the layer-shell-popups branch from 4d7bf72 to 1cec059 Compare March 20, 2020 10:03
@David96
Copy link
Copy Markdown
Contributor Author

David96 commented Mar 20, 2020

Rebased to current master and added @alebastr 's commit, removing WIP since it now at least does everything it should.

@David96 David96 changed the title [WIP] Render layer shell popups over the top layer Render layer shell popups over the top layer Mar 20, 2020
@ianyfan ianyfan mentioned this pull request Mar 30, 2020
5 tasks
Copy link
Copy Markdown
Member

@emersion emersion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants