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

Add set-title events for views #63

Closed
wants to merge 285 commits into from
Closed

Conversation

Uks2
Copy link
Contributor

@Uks2 Uks2 commented Jun 20, 2022

Outputs get events that trigger before and after all their windows get drawn.

Views get events that trigger when a window's title is changed so I can keep my status bar up to date.

buffet and others added 30 commits March 7, 2019 19:25
* Cleanup README.adoc

* Fix issues in README.adoc

Set kiwmi to lowercase.
Remove unintended heading.
Change "barely anything" to "almost nothing" for clarity.
commit ee1a466
Author: buffet <[email protected]>
Date:   Sat Mar 16 16:29:33 2019 +0100

    Fixed TTY switching

commit 7cc8aae
Author: buffet <[email protected]>
Date:   Fri Mar 15 16:55:13 2019 +0100

    Started working on kb handling
@Uks2
Copy link
Contributor Author

Uks2 commented Jun 20, 2022

If kiwmi migrates to wlr_scene, the pre/post-render events will have to be replaced (also see #60, pls comment if you can)

I have no idea how the scene graph system works, so I'll keep quite on that one.

Would you mind splitting the PR into two, or possibly only keeping the title_change? (Would need a comment from buffet on what’s preferred, yay.)

Either way is fine by me. I'll wait for word from on high then do what I'm told.

@ghost
Copy link

ghost commented Jun 21, 2022

I have no idea how the scene graph system works, so I'll keep quite on that one.

The main point is, instead of rendering things ourselves, we say where they should be and tell the wlr_scene to render them all for us. Therefore we can’t pop in just before/after something’s gonna render (i’m not exactly sure how it’s for outputs’ post-render), but rather say ‘draw this&this below/above this&this’.

It’s only a change in how things are achieved, and what i’m saying is, we don’t necessarily want to introduce something that would soon be replaced.

@Uks2
Copy link
Contributor Author

Uks2 commented Jun 21, 2022

Okay, that makes sense.

I've just had a quick look though wlr_scene.h and it seems like you're able to create coloured rectangles and add them to you scene graph. We might be able to wrap that up in an output:draw_rect() lua function, with just an extra parameter for whether it goes above or below the windows. How you delete those rectangles is another matter though.

...or we go nuts and create a whole API for drawing on wlr_buffers. :)

I'll try to have a rummage though #50 at some point and look at what the practicalities are.

@ghost ghost mentioned this pull request Jun 22, 2022
@ghost
Copy link

ghost commented Jun 22, 2022

We might be able to wrap that up in an output:draw_rect() lua function, with just an extra parameter for whether it goes above or below the windows. How you delete those rectangles is another matter though.

...or we go nuts and create a whole API for drawing on wlr_buffers. :)

See #60 (comment)

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

Apart from this detail and the above comment, looks good to me.

kiwmi/desktop/xdg_shell.c Outdated Show resolved Hide resolved
tiosgz and others added 15 commits July 14, 2022 14:15
This is needed in order for wlroots to interpret some values (mostly
coords of absolute input events) correctly. It for example fixes how the
pointer behaves with WLR_WL_OUTPUTS=2.

In order to also map the pointer/output pair when the pointer is created
before the output, a list of pointers has to be managed, which wasn't
needed until now.
The rendered region size is independent on the output transform and
scale. Until now, an output with scale > 1 would render only its
(1 / scale) part; so with a scale of 2, only the top-left quarter (ie.
the left 1/2 of the top 1/2) would be visible.

Similarly, a portrait output (constructed as landscape, rotated by 90
degrees) would have an empty area at its bottom.

This bug was found while testing the output-management PR (buffet#62).
Also handle NULL output in output_damage().

Co-authored-by: Uks2 <[email protected]>
This is a preparation for switching to the wlroots scene-graph. There is
no replacement planned for output:redraw() because it will no longer be
necessary (as far as i can tell), while scene-compatible replacements
for the view pre_render/post_render events are planned.
With the migration to wlr_scene, some objects (desktop, output etc)
will no longer have any reason to care about individual shells and
similar; handling each one on its own would introduce code that is,
from their perspective, over-complicated.

Strata (sg. stratum; this name was chosen to avoid confusion with the
over-used 'layer') represent logical layers of surfaces on the desktop,
such as every layer shell layer, one for xdg shell, another for popups.
At the moment it isn't used at all and a lot of data is duplicated. This
is a temporary state introduced for nicer diff separation into several
commits.
Apart from removing a lot of code, this commit also introduces (thanks
to wlr_scene) fine-grained damage tracking.

The lack of our own rendering code will only be an issue if the need for
custom effects (such as blur) arises; however, that's very unlikely and
it would probably require a lot of changes anyway.
Use it for getting the surface under cursor, position of surfaces, etc.
Works in basically the same way as all the other events (I hope!),
allows the config script to update a status bar or whatever.
@Uks2 Uks2 changed the title Add pre- and post-render events for outputs and title-change events for views Add set-title events for views Jul 30, 2022
@Uks2
Copy link
Contributor Author

Uks2 commented Jul 30, 2022

Changed event name, removed pre- and post-render events and rebased on top of the scene graph changes

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.

8 participants