Commit graph

220 commits

Author SHA1 Message Date
Daniel Eklöf
9699c9b8bf
csd: initial implementation of minimize/maximize/close buttons 2020-03-02 20:29:28 +01:00
Daniel Eklöf
f235bfdfdf
terminal: workaround founds with negative line gaps
Some fonts, even monospaced ones, have a negative line gap (line
height < ascent + descent).

Using the font's line height as cell height will result in some glyphs
overflowing into the cell above or below.

Workaround by using which ever value is the largest: the line height
or ascent + descent.
2020-03-02 18:43:23 +01:00
Daniel Eklöf
70cdb7af08
term: visual_focus_{in,out}: use quirk_weston_subsurface_desync_{on,off} 2020-03-01 13:09:25 +01:00
Daniel Eklöf
92d638eb1c
render: csd: split up positioning from rendering 2020-02-29 18:02:38 +01:00
Daniel Eklöf
8c98dfc51a
term: loop through all sub-surfaces when switching sync/desync mode 2020-02-29 09:26:49 +01:00
Daniel Eklöf
40f3d4c24c
terminal: error out when we fail to load the primary font 2020-02-28 18:35:05 +01:00
Daniel Eklöf
2f587f6f3d
csd: position CSD sub-surfaces *outside* the main window
For now, this behavior is controlled with an ifdef. At least kwin
seems very buggy when the decorations are positioned like this (but
normally you'd use server-side decorations with kwin anyway).

This commit also changes 'use_csd' to be a tri-state variable;
when instantiating a window it is set to 'unknown'.

If there's no decoration manager available (e.g. weston), we
immediately set it to 'yes' (use CSDs).

Otherwise, we wait for the decoration manager callback to indicate
whether we should use CSDs or not.
2020-02-26 12:17:58 +01:00
Daniel Eklöf
e9d3e7d87f
term: visual_focus_in/out: redraw CSDs
We draw the CSDs in a darker color when we're inactive.

Weston seems to be buggy with synchronized subsurfaces, so temporarily
reconfigure them to desynchronized surfaces.
2020-02-25 20:31:37 +01:00
Daniel Eklöf
ef53729242
render: resize with with/height == 0 resizes to user configured dimensions 2020-02-25 20:29:44 +01:00
Daniel Eklöf
ac32bcda07
main: geometry defaults to 800x600 pixels 2020-02-25 19:05:48 +01:00
Daniel Eklöf
7f270a9f01
term: add term_surface_kind(), and track currently active surface
This is needed to handle pointer motion and button events correctly,
since mouse actions in e.g. CSD surfaces are very different from mouse
actions in the main window.
2020-02-24 22:38:35 +01:00
Daniel Eklöf
77fcb43ea5
term: scroll: call sixel_delete_*() instead of manually erasing sixel images 2020-02-24 18:42:52 +01:00
Daniel Eklöf
4c6f2ea340
term: term_erase(): call sixel_delete_*()
This ensures sixel images are removed, regardless of _how_ the screen
was erased.
2020-02-24 18:42:46 +01:00
Daniel Eklöf
6d69311630
term: scroll: don't delete sixel images on the 'other' grid 2020-02-23 00:41:10 +01:00
Daniel Eklöf
86d640ef71
sixel: rename: purge_at_cursor() -> delete_at_cursor() 2020-02-22 23:06:11 +01:00
Daniel Eklöf
80361ca04e
sixel: purge images at current cursor row
When printing a character, or starting a new sixel image, purge all
images that cover the cursor's current row.
2020-02-22 21:35:45 +01:00
Daniel Eklöf
8e37a18083
sixel: application configurable palette size (color count)
This implements the CSI escapes for retrieving and (re)setting the
palette size.
2020-02-22 14:02:00 +01:00
Daniel Eklöf
ad5b2030f0
term: free sixel images on reset 2020-02-22 10:47:16 +01:00
Daniel Eklöf
bb82b9fabc
sixel: add sixel_destroy() 2020-02-22 00:23:19 +01:00
Daniel Eklöf
63140a68f5
sixel: calculate image height in (cell) rows 2020-02-22 00:05:25 +01:00
Daniel Eklöf
f0fc82f098
sixel: wip: maintain a list of finished, and "active" sixel images
In unhook, add the generated image to a list of finished sixel images,
along with positioning and size information.

When rendering, loop this list of images, and render the images (or
parts of) that are visible.

When scrolling, check if any part of the images cover the re-cycled
lines, and if so, remove the *entire* image from the list.

This means we have the following limitations:

* The renderer always renders the whole (visible area of) the
  image(s). There are times when this isn't necessary - for example,
  when the image is scrolled inside the visible area.
* It would be nice if we could crop the image when parts of it is
  scrolled out.
2020-02-21 23:40:35 +01:00
Daniel Eklöf
01f8719c77
term: spawn_new: check return value of chdir() and write() 2020-02-20 18:46:16 +01:00
Daniel Eklöf
b5efe984bb
slave: prefix argv[0] with a '-' when spawning a login-shell 2020-02-20 18:36:09 +01:00
Daniel Eklöf
4d3ab6176d
term: implement term_font_dpi_changed()
This function reloads the font *if* the DPI has changed. To handle
user run-time adjusted font sizes, we record the number of adjustments
made.

Then, when re-loading the font, we first load the font as specified in
the configuration. Then, we re-apply the size adjustment using
font_size_adjust().

Note that this means we end up loading the fonts twice; first using
the default size (but with adjusted DPI), and then again with the
adjusted size. This can probably be improved upon.

The existing font code has been refactored to avoid code
duplication. For example, term_init() now calls
term_font_dpi_changed() to load the initial fonts, instead of directly
instantiating them.

Finally, the way we calculate the DPI to use has changed: instead of
using the highest DPI of all available outputs, we use the highest DPI
of the output's we're actually mapped on. If we're not mapped at all,
we use the globally highest DPI.

Doing it this way means we usually only have to load the fonts
once. Otherwise, we'd end up using the default DPI of 96 when the
terminal is first instantiated (since it's not mapped at that time).

On a single monitor system, we'll use the globally highest DPI at
first, before being mapped. Then when we get mapped, we re-load the
fonts using the highest mapped DPI. But since they'll be the same,
we can skip actually reloading the fonts.
2020-02-15 19:08:14 +01:00
Daniel Eklöf
d11a71e0b2
term: reset: use grid_row_alloc() with initialize=true
This will both zero out the cells, *and* re-initialize the row
properties correctly.
2020-02-14 22:43:23 +01:00
Daniel Eklöf
ce8005545d
term: convert cell 'linefeed' attribute to a row 'linebreak' property
To do text reflow, we only need to know if a line has been explicitly
linebreaked or not. If not, that means it wrapped, and that we
should *not* insert a linebreak when reflowing text.

When reflowing text, when reaching the end of a row in the old grid,
only insert a linebreak in the new grid if the old row had been
explicitly linebreaked.

Furthermore, when reflowing text and wrapping a row in the new grid,
mark the previous row as linebreaked if either the last cell was
(the last column in the last row) empty, or the current cell (the
first column in the new row) is empty. If both are non-empty, then we
assume a linewrap.
2020-02-14 22:39:26 +01:00
Daniel Eklöf
69a633221f
term: formfeed: set linefeed correctly when we're at last column with lcf=1
When cursor.lcf is set, that means the cursor column was *not*
incremented when we printed the last character. Thus, we should *not*
decrement the column before setting the linefeed bit.
2020-02-12 18:06:27 +01:00
Daniel Eklöf
335bf2e5b4
Merge branch 'text-reflow' 2020-02-11 19:39:23 +01:00
Daniel Eklöf
b0f98a9d0c
term: font_size_{increase,descrease}: adjust size by 0.5pt 2020-02-10 22:22:42 +01:00
Daniel Eklöf
4a169f5643
vt: tag cells that were form-feed:ed, to allow correct text reflow
To handle text reflow correctly when a line has a printable character
in the last column, but was still line breaked, we need to track the
fact that the slave inserted a line break here.

Otherwise, when the window width is increased, we'll end up pulling up
the next line, when we really should have inserted a line break.
2020-02-10 21:54:37 +01:00
Daniel Eklöf
d6ef3c02fb
term: log error when failing to initialize the primary fonts 2020-02-09 16:56:59 +01:00
Daniel Eklöf
1dfd121c44
term: factor out common font changing code 2020-02-08 18:23:08 +01:00
Daniel Eklöf
6c0d00fcee
term: add term_font_size_reset() 2020-02-08 17:57:50 +01:00
Daniel Eklöf
89cca2a5d1
term: add term_font_size_{increase,decrease}() 2020-02-08 14:09:06 +01:00
Daniel Eklöf
2560e83c54
term: reduce max number of iterations when trying to drain client 2020-02-05 20:24:46 +01:00
Daniel Eklöf
92376eae01
term: language 2020-02-05 20:23:20 +01:00
Daniel Eklöf
9d52c422e1
term: always read *all* we can from the client before updating state
But place an upper limit on the number of iterations we read, to
prevent starvation caused by a bad behaving client to constantly
writes data.
2020-02-05 19:50:49 +01:00
Daniel Eklöf
8f4ec9aa47
Implement --hold
When specified, we don't exit when the slave/client process exits.
2020-02-03 19:58:32 +01:00
Daniel Eklöf
31baf334b3
fcft: update to 1.1.0 2020-02-01 20:20:22 +01:00
Daniel Eklöf
08eb0532ad
terminal: regression: char printed to wrong column
When term_print() was implemented, it introduced a regression where
printing a character when the last cursor was in the last column on a
line would print the character in the wrong column.

This is because term_print() retrieved a pointer to the current
cell *before* line wrapping (and possibly inserting empty cells).
2020-01-22 18:22:15 +01:00
Daniel Eklöf
a3d919a90d
input: implement metaSendsEscape and eightBitMeta 2020-01-20 18:45:14 +01:00
Daniel Eklöf
0c11459eef
term: fix reset state of VT state 2020-01-20 18:35:13 +01:00
Daniel Eklöf
300f83e66b
term: factor out character printing to new function term_print() 2020-01-20 18:34:32 +01:00
Daniel Eklöf
767a0ec232
fcft: update to 1.0.0
Allow/disallow subpixel antialiasing in font_glyph_for_wc(), not using
font_enable_subpixel_antialias().
2020-01-19 12:44:21 +01:00
Daniel Eklöf
7a00c7ddf4
term: enable subpixel antialiasing if background is opaque 2020-01-18 19:58:14 +01:00
Daniel Eklöf
1623fc0c0a
term: shorten application_synchronized_updates -> app_sync_updates 2020-01-12 12:55:19 +01:00
Daniel Eklöf
02c310d241
term: enable_application_synchronized_updates: not a noop if already enabled
If synchronized updates are already enabled when we receive a request
to enable them, extend the timeout.
2020-01-12 12:51:21 +01:00
Daniel Eklöf
95d2ee0cc1
term: app sync updates: disable delayed rendering timers once only
Disable the delayed rendering timers when enabling application
synchronized updates, not every time we've received ptmx data.
2020-01-12 12:45:34 +01:00
Daniel Eklöf
bdf127fc7e
term/render: move {enable,disable}_application_synchronized_updates()
From render -> terminal
2020-01-12 12:43:28 +01:00
Daniel Eklöf
afa1dbb7cc
render: add a timeout for application synchronized updates
This ensures we can recover from a crashing (or bad behaving)
application that sends a BSU but then never sends an ESU.
2020-01-12 12:40:42 +01:00