Commit graph

1569 commits

Author SHA1 Message Date
Daniel Eklöf
925088a8f2
render: color_hex_to_pixman_with_alpha(): handle alpha == 0 (transparent) 2020-02-28 18:35:21 +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
3a9a2bb6a4
config: add default font when using the default config
When there is no configuration file, and we're using the default
configuration, we accidentally jumped pasted the code that ensures
we have at least "monospace" in the font list.
2020-02-28 18:33:30 +01:00
Daniel Eklöf
ddbfb3676c
render: remember, and use, last unmaximized size
When the compositor wants us to decide the size (it sends a configure
event with width/height == 0), then use the last unmaximized size, if
there is one.

If there isn't one, use the size from the user configuration.
2020-02-26 20:59:11 +01:00
Daniel Eklöf
77b37fb288
wayland: once again switch to positioning CSDs outside the main surface 2020-02-26 20:45:44 +01:00
Daniel Eklöf
3228758951
render: resize: adjust user configured size for CSDs 2020-02-26 15:27:40 +01:00
Daniel Eklöf
66decac16b
wayland: document what FOOT_CSD_OUTSIDE does 2020-02-26 13:49:54 +01:00
Daniel Eklöf
1ccfceca05
wayland: switch back to positioning CSDs inside the main surface 2020-02-26 13:47:29 +01:00
Daniel Eklöf
02fedfb2fc
wayland: resize main surface when enabling CSDs runtime
When we position CSDs inside the main surface, and CSDs are switched
on run-time, we need to force a grid resize, since the actual window
content will now be smaller.

Alternative solution: call resize with width/height increased, to
account for the CSDs. This would increase the window size, but would
keep the grid size fixed.
2020-02-26 13:46:37 +01:00
Daniel Eklöf
d863ea8a46
input: temporary code to trigger maximize/minimize 2020-02-26 13:23:11 +01:00
Daniel Eklöf
5fbbd2f80e
wayland: track window maximized state 2020-02-26 13:23:00 +01:00
Daniel Eklöf
6eece79218
render: csd: fix typo when CSDs are positioned *inside* main surface 2020-02-26 13:22:20 +01:00
Daniel Eklöf
020ce60778
wayland: don't adjust size when CSDs are positioned inside main surface 2020-02-26 13:02:15 +01:00
Daniel Eklöf
90efe6ec02
render: don't center grid on surface
Up until now, we've centered the grid on the main surface. Meaning, we
calculated the unusable area, added the user configured padding and
then centered the grid.

This may look nice at first, but doesn't anymore when you start
resizing the window. Resizing the window will cause the top+left
margins to change, which makes the text "jump" or "wobble".

So, now we fix the grid in the upper left corner defined by the user
configured padding (plus CSDs if they aren't positioned outside the
main surface).
2020-02-26 12:51:58 +01:00
Daniel Eklöf
6ca880bd3e
wayland: disable debug logs 2020-02-26 12:47:00 +01:00
Daniel Eklöf
1e1b204377
csd: don't draw CSDs in fullscreen mode 2020-02-26 12:39:17 +01:00
Daniel Eklöf
be5988dd3a
wayland: decoration configure: no need to force a resize - just update the CSDs 2020-02-26 12:28:12 +01:00
Daniel Eklöf
135ca0884d
wayland: configure: adjust configured size when using CSDs
The size (width, height) arguments provided by the compositor in the
XDG toplevel configure event *include* the surrounding CSDs.

Since our code assumes the size is for the main surface only (and then
positions the sub-surfaces *outside* the main surface), adjust the
provided size when using CSDs.

This ensures our actual window size ends up being what the compositor
wants it to be, and it fixes resize-glitches when resizing using CSDs.
2020-02-26 12:26:03 +01:00
Daniel Eklöf
ea97a0dc87
wayland: instantiate sub-surfaces on-demand
While most compositors handle instantiated but not-yet-mapped
sub-surfaces correctly, e.g. kwin does not.

For example, it will incorrectly offset the main surface both
horizontally and vertically with a couple of pixels, leaving two
transparent areas at the top and left, between the SSDs and the main
surface.

Note that a workaround is to position the sub-surfaces inside the main
surface while they're unmapped. However, since the surfaces may be
larger than the main surface (the CSDs, for examples, always are),
this doesn't quite work since kwin, at least, resizes the window to
include the sub-surfaces, even when unmapped.

So, instead we instantiate all sub-surfaces on demand, when we know
where to position them, and when they should be mapped.
2020-02-26 12:22:16 +01:00
Daniel Eklöf
f960e7aff7
render: resize: ignore unconfigured windows 2020-02-26 12:21:03 +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
45ba9f9c8f
grid: grid_reflow(): may be called with old_rows/cols == new_rows/cols
TODO: avoid calling grid_reflow() in this case.
2020-02-25 20:33:27 +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
c0e3db1712
input: wip: trigger move/resize when left-clicking CSD 2020-02-25 20:31:13 +01:00
Daniel Eklöf
cc3dad9599
render: search: take CSD into account 2020-02-25 20:30:45 +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
2855d06c6e
wayland: mark the whole search surface as opaque 2020-02-25 19:57:19 +01:00
Daniel Eklöf
f05e0ad0ae
wayland: synchronize the CSD surfaces to the main surface 2020-02-25 19:56:56 +01:00
Daniel Eklöf
7e26d96d17
wayland: default to CSDs
Only when the compositor implements the XDG decoration manager
interface, and it tells us to use server side decorations to we do so.
2020-02-25 19:56:23 +01:00
Daniel Eklöf
8af5bf49b0
wayland: weston does not implement the xdg decoration manager interface 2020-02-25 19:56:17 +01:00
Daniel Eklöf
0126cee55d
wayland: xdg_surface_configure(): call wl_surface_commit()
It seems kwin expects a wl_surface_commit() for each
xdg_surface_ack_configure().

We don't want to commit before we've rendered a resized surface. So,
if we *did* change the window size, let the normal rendering path do
the surface commit.

Only when we did *not* change the window size do we need to explicitly
commit the surface in xdg_surface_configure().
2020-02-25 19:53:06 +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
a4d77608b9
wayland: decoration-configure: call render_resize() to add/remove CSDs
Call render_resize_force() when the decoration type changes
run-time. This ensures the CSDs are drawn when changing from server ->
client side decorations, and removed when going the other way.
2020-02-25 19:16:23 +01:00
Daniel Eklöf
7db9221aa9
render: render_resize(): don't allow too small window sizes 2020-02-25 19:10:48 +01:00
Daniel Eklöf
d3c7d25dae
render: call render_csd() from render_resize(), not render_grid()
The CSDs doesn't need to be re-drawn each time we redraw the grid,
only when the window is resized.
2020-02-25 19:09:49 +01:00
Daniel Eklöf
70ce7245c6
render: export render_csd() 2020-02-25 19:09:29 +01:00
Daniel Eklöf
d15eb936ef
render: make CSD border and title size globally accessible 2020-02-25 19:08:14 +01:00
Daniel Eklöf
3f601a31dc
shm: handle EINTR in posix_fallocate() 2020-02-25 19:07:23 +01:00
Daniel Eklöf
ac32bcda07
main: geometry defaults to 800x600 pixels 2020-02-25 19:05:48 +01:00
Daniel Eklöf
551170d940
input: pointer-motion/button: ignore actions in non-main surfaces 2020-02-24 22:42:04 +01:00
Daniel Eklöf
7b18f8394e
input: pointer-leave: reset 'active-surface' in terminal 2020-02-24 22:41:46 +01:00
Daniel Eklöf
d303084a81
input: pointer-enter: differentiate between the surfaces 2020-02-24 22:40:24 +01:00
Daniel Eklöf
0b265cc9a5
render: csd: sort geometry entries 2020-02-24 22:40:02 +01:00
Daniel Eklöf
b725ac4c73
wayland: terminal_from_surface(): use term_surface_kind() 2020-02-24 22:39:37 +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
2798807853
render: csd: render all borders and the title bar
* Still no content in the title bar
* Colors are temporary
* No resize/drag yet
2020-02-24 22:06:20 +01:00
Daniel Eklöf
01a11457a5
Merge branch 'master' into csd 2020-02-24 18:47:08 +01:00
Daniel Eklöf
0c247de4ae
sixel: CSI setters also write a reply to the client 2020-02-24 18:42:52 +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