Commit graph

190 commits

Author SHA1 Message Date
tiosgz
c844262321 Introduce kiwmi_strata
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.
2022-07-30 19:06:25 +00:00
tiosgz
afb2c78a6e Remove API that relies on our rendering
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.
2022-07-30 19:06:25 +00:00
tiosgz
83dc21feb1 output: While destroying, destroy layers
Also handle NULL output in output_damage().

Co-authored-by: Uks2 <tom@tomg.xyz>
2022-07-30 19:06:25 +00:00
13c5312de5 Merge pull request #65 from tiosgz/map-pointer-output 2022-07-25 14:53:41 +00:00
tiosgz
fced953bb5 output: wlr_renderer_begin with physical size
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 (#62).
2022-07-14 14:21:14 +00:00
tiosgz
30f8469da0 input: map pointer to output if possible
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.
2022-07-14 14:15:51 +00:00
tiosgz
aa9776f006 Partly revert "Only render mapped surfaces"
This reverts most of commit 520dd5ce02,
because it is now handled by wlroots.
The iterator -> callback renames have been kept in place.
2021-12-20 19:07:58 +00:00
tiosgz
b238994996 Catch up with wlroots 0.15 breaking changes 2021-12-20 19:07:56 +00:00
tiosgz
53684f0e79 Attempt to exit cleanly, without crash (#51) 2021-12-04 17:25:31 +00:00
ed1ff87494 Merge pull request #46 from tiosgz/view-get-size
view_get_size: access view::geom directly
2021-10-18 16:29:24 +00:00
Will Eccles
7c8f8a92ea output: add redraw function 2021-10-14 14:40:09 -04:00
tiosgz
6a1af5f1ae view_get_size: access view::geom directly 2021-10-09 17:33:59 +00:00
ca71a58462 Merge pull request #43 from tiosgz/use-buffer-age
Use buffer age when rendering
2021-10-08 17:18:08 +00:00
31c7e0f60f Merge pull request #42 from tiosgz/view-geom
Various view geometry-related fixes
2021-10-08 17:07:50 +00:00
gk
8f4c9e1ab7 fix logic error 2021-10-07 06:26:47 +10:00
tiosgz
711fb83bda Use buffer age when rendering 2021-09-19 13:02:15 +00:00
tiosgz
09d0802a59 Allow interactive move and resize at once
There is no technical reason not to allow resizing on opposite edges,
effectively getting single-directional interactive move (which can be
combined with another edge for resizing in the other direction).
2021-09-15 17:15:45 +00:00
tiosgz
251afa161d Fix top edge interactive resize
The view jumped to the cursor position vertically.

While making this change, I also put some consistency into how position
and size are set (first the original ones are considered, and then only
updated as needed). It doesn't change the functionality, but is easier
to understand IMO.
2021-09-15 17:05:05 +00:00
tiosgz
8e58279c26 Fix xdg_shell_view_get_size
If the view doesn't set its size explicitly (e.g. imv), it returned 0
2021-09-15 17:05:05 +00:00
tiosgz
0d1972eacf Fix getting view position
view->geom.{x,y} tell the compositor where to place the buffer
relatively to the view, view->{x,y} is the view's absolute position.
2021-09-15 17:05:05 +00:00
fb86e3df22 Add check to adjust_package_path 2021-09-14 12:16:22 +00:00
9ae4b095d1 Merge pull request #41 from tiosgz/pointer-focus
Pointer focus improvements
2021-09-13 19:06:18 +00:00
781ee80fee Add $XDG_CONFIG_HOME/kiwmi to package path 2021-09-13 10:25:41 +00:00
tiosgz
5537a445be Give pointer focus to layer shell surfaces as well 2021-09-10 21:06:41 +00:00
c732eb8364 Use view_set_pos in process_cursor_motion 2021-09-05 18:35:07 +00:00
tiosgz
21062c0224 Update pointer focus more often
Until now, focusing a different view didn't move pointer focus to it,
even though it was under the cursor. The pointer had to move in order
to switch its focus. Similar situations should be handled after this
commit.
2021-09-05 10:51:58 +00:00
60f9265b50 Use unistd.h instead of getopt.h 2021-09-03 20:22:49 +00:00
tiosgz
520dd5ce02 Only render mapped surfaces
This targets only surfaces under kiwmi_view, thus only XDG shell. Other
surfaces to be fixed later.

The new code here is copied over from wlroots, with only small
modifications.
2021-08-27 13:13:37 +00:00
tiosgz
2b4d6d205b Handle XDG popups and subsurfaces
This commit ensures that they also cause output damage to happen and
that popups are moved into the visible area.

I browsed the source code of Sway while writing this and took a lot of
inspiration and help from there.
2021-08-27 13:06:55 +00:00
1cb890c45e Move stuff into output_damage() function 2021-08-15 17:07:54 +00:00
6e5e651f90 Damage output when layer-shell surface updates 2021-08-15 17:00:06 +00:00
c54abdba2c Don't redraw on cursor movements unless required 2021-08-14 21:31:31 +00:00
c6012cf08b Clean up damage tracking code a little 2021-08-14 21:04:23 +00:00
4bf66b6df5 Redraw twice on damage (even more hacky) 2021-08-14 20:25:15 +00:00
64aad5b332 Damage on move and resize 2021-08-14 20:06:00 +00:00
cd5ce00f74 Add hacky lazy damage tracking implementation 2021-08-14 19:44:20 +00:00
c94804588e Add scoll event 2021-08-14 18:42:35 +00:00
d14d8139b4 Merge pull request #37 from tiosgz/bg-paint
kiwmi:bg_color()
2021-08-13 17:44:37 +00:00
tiosgz
8693d2dd13 Add controls for verbosity level
This allows the config to be exactly as verbose as kiwmi, or to change
the verbosity level at runtime (e.g. using kiwmic).

It uses numbers, because they are much easier to handle on both sides
and add only little inconvenience to the user.
2021-08-13 13:46:35 +00:00
tiosgz
feca54a974 kiwmi:bg_color() 2021-08-13 08:36:00 +00:00
783a12426b Merge pull request #32 from tiosgz/usable-area
kiwmi_output:usable_area() and :on("usable_area_change")
2021-08-12 08:45:30 +00:00
tiosgz
a5e82d083c kiwmi_output:usable_area() and :on("usable_area_change") 2021-08-11 20:30:14 +00:00
ed20755135 Merge pull request #34 from tiosgz/layer-shell-pos
Do not add output position twice when rendering
2021-08-11 20:17:12 +00:00
tiosgz
478eb6d693 Do not add output position twice when rendering
The renderer already uses output-local positions.
2021-08-11 18:49:15 +00:00
7a36ebaf63 Add view:id() 2021-08-10 19:26:34 +00:00
b6e3492234 Fix small bug 2021-08-09 19:20:11 +00:00
c09e552a69 Add FROM_KIWMIC 2021-08-09 19:09:48 +00:00
c45dd269e7 Add kiwmi:unfocus(), clang-format 2021-08-09 18:55:01 +00:00
4322717ba7 Merge pull request #31 from tiosgz/clipboard
Add clipboard (& other stuff) support
2021-08-02 20:44:19 +00:00
0492605d1b Add kiwmi:active_output() 2021-08-01 22:04:32 +00:00