Commit graph

1248 commits

Author SHA1 Message Date
Daniel Eklöf
ce4e99ebe2
term: background alpha is not a floating point number 2020-01-03 21:53:16 +01:00
Daniel Eklöf
0ea0323d0f
wayland: don't use wl_display_dispatch()
wl_display_dispatch() calls poll(), which is unnecessary since we
already know the FD is readable.

Use the more lower level wl_display_read_events() +
wl_display_dispatch_pending().

These require wl_display_prepare_read() to have been called.

The idea is to call wl_display_prepare_read() **before** calling
poll().

Thus, we do this more or less last in wayl_init(), and at the **end**
of the FDM handler.

However, having taking this lock also means we no longer can call
wl_display_roundtrip() directly (it will hang).

So, add a wrapper, wayl_roundtrip(), that cancels the read intent,
does the roundtrip, and then re-acquires the read intent.
2020-01-03 21:02:12 +01:00
Daniel Eklöf
c6e46bbfac
selection: remove unneeded wayland display roundtrips 2020-01-03 21:01:07 +01:00
Daniel Eklöf
ef3c7d7e0a
term: init: don't resize if compositor has already resized us 2020-01-03 19:31:09 +01:00
Daniel Eklöf
782da0f8e9
term: no need to call render_refresh() when starting/stopping blink timer 2020-01-03 19:27:57 +01:00
Daniel Eklöf
a291999f2c
wayland: flush after commit new pointer surface 2020-01-03 19:04:42 +01:00
Daniel Eklöf
c118ed9252
wayland: configure: resize before changing visual focus
This hopefully fixes and issue where the visual focus in/out caused a
render refresh with the *old* size.

This caused the occasional flicker at startup, or when resizing the
window.

By placing the resize call before the visual focus in/out, we ensure
the refresh uses the new size.

This is a temporary workaround. The correct solution is to ensure we
only call refresh() once.
2020-01-03 18:58:26 +01:00
Daniel Eklöf
f7362d381b
render: refresh: ensure window has been configured 2020-01-03 18:55:13 +01:00
Daniel Eklöf
f2a745cfdb
Merge branch 'cleanup-wayland-window-callbacks' 2020-01-03 13:56:24 +01:00
Daniel Eklöf
d07fd7de39
render: remove 'refresh' from render_resize() 2020-01-03 13:56:10 +01:00
Daniel Eklöf
46c434d3f1
wayland: window: apply all configure changes after acking the event 2020-01-03 13:54:44 +01:00
Daniel Eklöf
765fe13aff
wayland: remove wayl_terminal_from_xdg_{surface,toplevel} 2020-01-03 13:46:37 +01:00
Daniel Eklöf
b0fbc064dd
wayland: window: pass window pointer to xdg toplevel callbacks 2020-01-03 13:46:15 +01:00
Daniel Eklöf
ea002ad571
wayland: window: pass window pointer to xdg-surface-listener callbacks 2020-01-03 13:41:35 +01:00
Daniel Eklöf
9372fb4166
wayland: window: pass window pointer to wl-surface callbacks 2020-01-03 13:40:37 +01:00
Daniel Eklöf
9a0238bb52
wayland: window now keeps pointer to owning terminal, not wayland 2020-01-03 13:37:03 +01:00
Daniel Eklöf
74aa604904
render: render_resize(): don't do anything if width or height is 0 2020-01-03 12:54:03 +01:00
Daniel Eklöf
11892e8d23
wayland: fix release build 2020-01-03 12:52:18 +01:00
Daniel Eklöf
43b76f002f
Merge branch 'visual-focus' 2020-01-03 12:49:51 +01:00
Daniel Eklöf
8494cc808f
wayland: debug log state changes in xdg-toplevel-configure 2020-01-03 12:49:04 +01:00
Daniel Eklöf
c94da979fb
wayland: xdg-surface-configure: refresh terminal
Any changes done in any of the configure events are ignored before
we've ack:ed the configure event.

In particular, this means the resize done in xdg-toplevel-configure
isn't displayed until the next time we call render_refresh().

Unless we do something ourselves, this can take quite some time, since
we're basically need the slave to write something.

So, in xdg-surface-configure, *after* having ack:ed the configure
event, call render_refresh() to make the changes done in
xdg-toplevel-configure visible as soon as possible.
2020-01-03 12:48:54 +01:00
Daniel Eklöf
bd13c2c86a
term: render_resize() now takes a 'refresh' argument 2020-01-03 12:45:30 +01:00
Daniel Eklöf
26c16a9a47
wayland: render_resize() now takes a 'refresh' argument 2020-01-03 12:45:16 +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
709dbfe18b
Merge branch 'master' into visual-focus 2020-01-03 12:08:51 +01:00
Daniel Eklöf
792b443918
render: use a unique buffer cookie for the 'search' surface
This fixes an issue where rendering the 'search' box caused the last
normal buffer from being purged.

This meant the terminal had a pointer to a now freed buffer, which we
de-referenced and occasionally memcpy:ied from.
2020-01-03 12:05:48 +01:00
Daniel Eklöf
aa9e87ffb0
wayland: term_visual_focus_{in,out} handles already being focused/defocused 2020-01-03 11:20:13 +01:00
Daniel Eklöf
80dfd5b645
term: visual_focus_{in,out}: do nothing if already focused/defocused 2020-01-03 11:19:56 +01:00
Daniel Eklöf
304355d8ed
wayland: xdg-toplevel-configure: no need to detect early configure events
We can now lookup terminal instances at all times, making it
unnecessary to detect "early" configure events.

Note that we still need to prevent a resize from happening when
width/height is 0.
2020-01-03 11:18:43 +01:00
Daniel Eklöf
913c684844
term: term_init() calls wl_display_roundtrip()
Instead of having `wayl_win_init()` call
`wl_display_roundtrip()` (which it itself doesn't need), call it from
`term_init()`.

This allows us to add ourselves (the new terminal instance) to the
terminal list in the wayland backend, before triggering the wayland
events caused by `wayl_win_init()`.

This is turn allows the wayland backend to find/lookup the new
terminal when those events occur..
2020-01-03 11:16:06 +01:00
Daniel Eklöf
4451f4ad62
term: spell 'initialize' correctly 2020-01-03 11:15:35 +01:00
Daniel Eklöf
29483f936f
render: draw_cursor: use terminal's visual focus to determine cursor shape 2020-01-02 19:37:21 +01:00
Daniel Eklöf
0e40e1c711
wayland: xdg-top-level-configure: call term_visual_focus_{in,out} 2020-01-02 19:37:01 +01:00
Daniel Eklöf
6f281cebfb
term: add term_visual_focus_{in,out}
These functions should be called when the terminal gets or loses
visual focus.

Note that this isn't necessarily the same as having keyboard focus.
2020-01-02 19:35:32 +01:00
Daniel Eklöf
4be3c04999
input: keyboard-leave: move comment to where it belongs 2020-01-02 19:30:34 +01:00
Daniel Eklöf
e9325b958f
term: rename term_focus_{in,out} -> term_kbd_focus_{in,out} 2020-01-02 19:29:42 +01:00
Daniel Eklöf
90a1d920bb
Merge branch 'master' into visual-focus 2020-01-02 18:42:30 +01:00
Daniel Eklöf
9829539af8
fcft: ignore embeddedbitmap for non-scalable fonts 2020-01-02 18:42:21 +01:00
Daniel Eklöf
2192d95fa9
wayland: xdg-toplevel-configure: check for stateless configure calls
Ignore configure calls without state, instead of checking for
width/height == 0.
2020-01-02 17:38:50 +01:00
Daniel Eklöf
4a9f359a6a
wayland: ignore early configure calls
At this point, not everything has been setup and we crash when trying
to convert the surface pointer to a terminal pointer.
2020-01-02 17:25:41 +01:00
Daniel Eklöf
eb1ea2d80d
term: add visually focused attribute to terminal struct 2020-01-02 16:06:35 +01:00
Daniel Eklöf
4ecb0ecf4d
wayland: rename focused/moused to kbd_focus/mouse_focus 2020-01-02 15:58:52 +01:00
Daniel Eklöf
6c75c16d2c
README: add missing '+' in keyboard shortcut ctrl+shift+w 2020-01-01 17:01:34 +01:00
Daniel Eklöf
403af22061
wayland: warn when presentation timings have been requested but is not supported 2020-01-01 16:09:16 +01:00
Daniel Eklöf
fad5c87f65
Merge branch 'readme-pimping' 2020-01-01 15:20:39 +01:00
Daniel Eklöf
ba9c14ad68
README: use footnote 2020-01-01 15:18:12 +01:00
Daniel Eklöf
a958c07489
README: add keyboard::normal-mode and keyboard::scrollback-search to index 2020-01-01 15:14:19 +01:00
Daniel Eklöf
79da7907fb
README: use headings to separate normal key bindings from scrollback search bindings 2020-01-01 15:12:57 +01:00
Daniel Eklöf
1a8849c5f6
Revert "README: try removing empty lines between list items"
This reverts commit 7e39d113b7.
2020-01-01 15:12:00 +01:00
Daniel Eklöf
d13b106516
Revert "README: that didn't work - try with a hard line break"
This reverts commit 7489cae576.
2020-01-01 15:11:50 +01:00