Commit graph

1647 commits

Author SHA1 Message Date
Daniel Eklöf
e6feed5311
wayland: remove debug logs 2020-03-06 19:19:18 +01:00
Daniel Eklöf
4f90cbda59
wayland: log: say 'requesting' instead of 'referring' client/server decorations 2020-03-06 19:18:59 +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
e5540a0d2e
render: csd: improved look of minimize/maximize/close buttons
* minimize: a downward triangle
* maximize (window): an upward triangle
* maximize (already maximized): a hollow square
* close: a filled square

The glyphs are now rendered using the default background color instead
of hardcoded to black.
2020-03-06 19:15:09 +01:00
Daniel Eklöf
f434933824
render: CSD: use *default* foreground, not current foreground
Applications may temporarily change the foreground color. Don't use
this when rendering the CSD title bar - use the default
foreground (i.e the default default one, or the one configured by the
user in footrc).
2020-03-06 19:13:10 +01:00
Daniel Eklöf
0dddb5d119
sixel: don't try to dirty an un-allocated row
This may happen e.g. when resizing a grid
2020-03-06 19:11:57 +01:00
Daniel Eklöf
27ef5b472a
config: change default CSD button width from 22 -> 26 2020-03-06 19:11:31 +01:00
Daniel Eklöf
a78cca74a0
render: oops, add missing '}' 2020-03-03 18:29:46 +01:00
Daniel Eklöf
b81b1b6ff7
render: configure a clip region to exclude the grid margins
This ensures content in the last column doesn't flow over into the
margins (where they are typically never erased, unless the window is
resized).
2020-03-03 18:27:59 +01:00
Daniel Eklöf
d76484ae50
wayland: set window geometry to exclude the invisible CSD borders
But it *does* include the title bar. This simplifies the 'adjustment'
needed to be done to the configured window size.

It also fixes a number of issues:

* the compositor will now properly snap the window to screen
  edges (before, there was an empty space between the edge and the
  window - the CSD border).
* This also removes the need for the mutter 'commit' workaround. We
  must be doing something right now.
2020-03-03 18:26:15 +01:00
Daniel Eklöf
044556ef3e
render: csd: render surfaces in reverse order
This ensures the inner most child surfaces are rendered and comitted
before the parent surfaces.
2020-03-03 18:24:51 +01:00
Daniel Eklöf
da91a9de4b
render: csd: assert surfaces exist before trying to use them 2020-03-03 18:24:31 +01:00
Daniel Eklöf
09bb9bef33
render: csd: center 'close' button's cross 2020-03-03 18:24:09 +01:00
Daniel Eklöf
c9659ecd14
render: csd: don't even try to render CSDs when we're in fullscreen mode 2020-03-03 18:23:52 +01:00
Daniel Eklöf
c10f1d5459
render: don't try to render CSDs when the terminal is shutting down 2020-03-03 18:23:37 +01:00
Daniel Eklöf
264acd6463
input: do a full CSD repaint on pointer motion over CSD buttons
This fixes repainting issues on mutter.
2020-03-03 18:22:32 +01:00
Daniel Eklöf
f0892988c0
wayland: don't destroy keyboard/pointer if they haven't been removed
When the seat capabilities change, we used to destroy all pointers and
keyboards, and then re-creating them as necessary.

This caused a crash on mutter - probably because we removed a keyboard
device the compositor had already sent an event for (or was about to).

Now, we only destroy and create devices when it's needed.
2020-03-03 18:20:53 +01:00
Daniel Eklöf
e077290c56
quirks: add shortcut for flipping all CSD surfaces sync/desync state 2020-03-03 18:20:09 +01:00
Daniel Eklöf
c90d70b2bf
config: CSD borders are always invisible
That is, remove all configuration options and always draw them fully
transparent.
2020-03-03 18:18:59 +01:00
Daniel Eklöf
cb6616ef8a
render: csd: maximize: change default color to a lighter green 2020-03-02 21:11:17 +01:00
Daniel Eklöf
63a3d6ce03
render: csd: close: change default color to a lighter blue 2020-03-02 21:10:25 +01:00
Daniel Eklöf
b14c217fb6
render: csd: minimize: change default color to a lighter blue 2020-03-02 21:09:21 +01:00
Daniel Eklöf
20eaa15271
render: initial minimize/maximize/close glyphs
These are really ugly, but is meant to get something up there, that
can be polished afterwards.
2020-03-02 21:06:15 +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
c845c90835
README: CSDs have been implemented 2020-03-02 18:50:21 +01:00
Daniel Eklöf
1b2050de7b
config: no need to free 'line' between each call to getline()
getline() will re-use the allocated line if it large enough, or resize
it otherwise. Thus there's no need to free it and set it to NULL
between each call.
2020-03-02 18:48:29 +01:00
Daniel Eklöf
1f33b4a292
doc: foot.5: describe what each section in the configuration file does 2020-03-02 18:47:48 +01:00
Daniel Eklöf
6c317396e5
footrc: default geometry has changed to 700x500 2020-03-02 18:47:35 +01:00
Daniel Eklöf
6eae5ebd94
input: don't change xcursor if active surface isn't the main grid 2020-03-02 18:47:17 +01:00
Daniel Eklöf
b268b69a7b
quirks: log when applying weston sub-surface desync quirk 2020-03-02 18:47:04 +01:00
Daniel Eklöf
6912bbd310
slave: set $SHELL when command line is a shell listed in /etc/shells 2020-03-02 18:46:35 +01:00
Daniel Eklöf
74175b5bd1
config: prefer $SHELL over /etc/passwd
If the user hasn't configured a shell in footrc, use $SHELL. Only if
that variable isn't set do we use the shell from /etc/passwd.
2020-03-02 18:45:38 +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
def4395bd1
wayland: log whether CSDs or SSDs are used at info level, not debug 2020-03-02 18:43:07 +01:00
Daniel Eklöf
22ce09eb44
config: make CSD user configurable
The user can now configure the following:

* Whether to prefer CSDs or SSDs. But note that this is only a hint to
  the compositor - it may deny our request. Furthermore, not all
  compositors implement the decoration manager protocol, meaning CSDs
  will be used regardless of the user configuration (GNOME/mutter
  being the most prominent one).
* Title bar size and color, including transparency
* Border size and color, including transparency

Also drop support for rendering the CSDs inside the main surface.
2020-03-02 18:42:49 +01:00
Daniel Eklöf
ae22366f3b
input: raise window 'move' timeout to 200ms
100ms was a bit low and prevented double-tap on touchpads from
working.
2020-03-01 13:20:07 +01:00
Daniel Eklöf
875b067f13
render: csd: don't try to render a zero-width/height border 2020-03-01 13:17:54 +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
7b3fffc6ec
search: don't mark the entire sub-surface as opaque 2020-03-01 13:06:30 +01:00
Daniel Eklöf
b6f8a2e422
search: enable/disable weston sub-surface desync quirk when rendering search box 2020-03-01 13:06:00 +01:00
Daniel Eklöf
a29427a185
render: search: add todo to only position sub-surface on a window resize 2020-03-01 12:54:50 +01:00
Daniel Eklöf
b8d79c719b
render: search: mark visible portion of sub-surface opaque 2020-03-01 12:54:27 +01:00
Daniel Eklöf
7b1dafae0f
render: search: kwin has problems with a resizing/repositioned sub-surface
So, make it equal to the window size, and make the non-used area fully
transparent.
2020-03-01 12:28:33 +01:00
Daniel Eklöf
f038a27366
render: csd: switch-based CSD positioning 2020-03-01 12:28:01 +01:00
Daniel Eklöf
3ec50369ce
search: update search box before we update the main grid 2020-03-01 12:24:37 +01:00
Daniel Eklöf
9d834bb43d
shm: log 'size' when failing to fallocate() 2020-03-01 12:19:28 +01:00
Daniel Eklöf
fff480e584
input: use xdg_toplevel_resize_edge enum type 2020-03-01 11:43:58 +01:00
Daniel Eklöf
92d638eb1c
render: csd: split up positioning from rendering 2020-02-29 18:02:38 +01:00
Daniel Eklöf
9264e1e5bd
render: don't update last 'un-maximized' size when in fullscreen 2020-02-29 17:25:08 +01:00
Daniel Eklöf
d6f0a47fb8
wayland: always update window->is_fullscreen, not just when using CSDs 2020-02-29 17:24:45 +01:00