Commit graph

27 commits

Author SHA1 Message Date
Daniel Eklöf
7ffd31e13a
render: remove render_refresh_margins() 2020-09-29 10:08:59 +02:00
Daniel Eklöf
2488c3935b
render: implement render_refresh_margins()
For now, it will reset term->render.last_buf to NULL, and then calls
grid_render() to do a full screen refresh.
2020-09-01 07:33:44 +02:00
Daniel Eklöf
4e48d550ef
multi-seat: improve handling of multiple (mouse) pointers
* xcursor always set for all pointers
* xcursor sometimes not updated when it should be
* mouse grabbed state wasn't per seat, but global (i.e. "does at least
  one seat enable mouse grabbing")
* selection enabled state wasn't per seat
2020-07-09 09:52:11 +02:00
Daniel Eklöf
be2490022d
multi-seat: enable xcursor theme support again 2020-07-08 18:08:39 +02:00
Daniel Eklöf
9bbbd26c7a
render: pace title updates
Synchronize window title updates with window rendering.
2020-03-25 18:23:55 +01:00
Daniel Eklöf
c5a1af4e53
render: never render CSD and/or search box "immediately"
Handle the CSDs and the search box the same way we handle the main
grid; when we need to redraw them, call
render_refresh_{csd,search}(). This sets a flag that is checked after
each FDM iteration. All actual rendering is done here.

This also ties the commits of the Wayland sub-surfaces to the commit
of the main surface.
2020-03-06 19:16:54 +01:00
Daniel Eklöf
9699c9b8bf
csd: initial implementation of minimize/maximize/close buttons 2020-03-02 20:29:28 +01:00
Daniel Eklöf
92d638eb1c
render: csd: split up positioning from rendering 2020-02-29 18:02:38 +01:00
Daniel Eklöf
595b32ddf9
render: render_resize_*() returns a boolean indicating whether size changed. 2020-02-25 19:51:03 +01:00
Daniel Eklöf
70ce7245c6
render: export render_csd() 2020-02-25 19:09:29 +01:00
Daniel Eklöf
9e2ca2b1a3
render: add render_resize_force()
This forces a full resize operation, even though actual window
size (or scale) hasn't changed.
2020-02-08 14:08:16 +01:00
Daniel Eklöf
5ec447697c
render: throttle xcursor updates
With a bad behaving client (e.g. 'less' with mouse support enabled),
we can end up with a *lot* of xcursor updates (so much, that we
flooded the wayland socket before we implemented a blocking
wayl_flush()).

Since there's little point in updating the cursor more than once per
frame interval, use frame callbacks to throttle the updates.

This works more or lesslike normal terminal refreshes:

render_xcursor_set() stores the last terminal (window) that had (and
updated) the cursor.

The renderer's FDM hook checks if we have such a pending terminal set,
and if so, tries to refresh the cursor.

This is done by first checking if we're already waiting for a callback
from a previous cursor update, and if so we do nothing; the callback
will update the cursor for the next frame. If we're *not* already
waiting for a callback, we update the cursor immediately.
2020-01-04 22:58:32 +01:00
Daniel Eklöf
99f471d738
render: trigger terminal refreshes in an FDM hook
In some cases, we end up calling render_refresh() multiple times in
the same FDM iteration. This means will render the first update
immediately, and then set the 'pending' flag, causing the updated
content to be rendered in the next frame.

This can cause flicker, or flashes, since we're presenting one or more
intermediate frames until the final content is shown.

Not to mention that it is inefficient to render multiple frames like
this.

Fix by:

* render_refresh() only sets a flag in the terminal

* install an FDM hook; this hook loops all terminals and executes what
  render_refresh() _used_ to do (that is, render immediately if we're
  not waiting for a frame callback, otherwise set 'pending' flag). for
  all terminals that have the 'refresh_needed' flag set.
2020-01-04 19:49:26 +01:00
Daniel Eklöf
d07fd7de39
render: remove 'refresh' from render_resize() 2020-01-03 13:56:10 +01:00
Daniel Eklöf
af26f043fb
render: resize() now only calls refresh() if asked to 2020-01-03 12:44:29 +01:00
Daniel Eklöf
aabb7a7e8f
render: attrs_to_font: const:ify 2019-12-19 07:28:33 +01:00
Daniel Eklöf
957fb25559
wayland: move reload_cursor_theme() and update_cursor_surface() to wayland 2019-10-27 19:36:45 +01:00
Daniel Eklöf
2c3ab701e7
search: move render() function to the 'render' module 2019-08-29 20:18:06 +02:00
Daniel Eklöf
d5bc46f333
render: reload cursor theme when scale (may) have changed 2019-08-21 17:53:52 +02:00
Daniel Eklöf
c2451e2a80
output: track output we're mapped on, and use maximum scale
Our surface may be on multiple outputs at the same time. In this case,
we use the largest scale factor, and let the compositor down scale on
the "other" output(s).
2019-08-12 21:49:17 +02:00
Daniel Eklöf
05e91fa9df
output: resize on scale changes 2019-08-12 21:33:24 +02:00
Daniel Eklöf
c531795b83
wip: initial multithreaded renderer 2019-07-29 20:13:26 +02:00
Daniel Eklöf
ebf0a11fa0
render: add render_refresh() 2019-07-24 20:11:41 +02:00
Daniel Eklöf
6e55be1557
render: cache generated glyphs for regular ASCII characters
To avoid having to re-generate glyphs, cache the glyphs.

For now, we only cache ASCII characters, as this allows us to lookup
the cache by simply indexing with the character (into a 256-entry
array).
2019-07-18 10:33:58 +02:00
Daniel Eklöf
d93ca2f654
render: implement 'underline' 2019-07-16 14:20:39 +02:00
Daniel Eklöf
1a341a56cc
render: load cursor theme from XCURSOR_THEME and XCURSOR_SIZE 2019-07-05 10:44:09 +02:00
Daniel Eklöf
1947d33868
render: break out rendering functions to render.{c,h} 2019-07-05 10:16:56 +02:00