Commit graph

1617 commits

Author SHA1 Message Date
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
Daniel Eklöf
32a3f56710
wayland: don't resize when we're not mapped anywhere
Normally, we resize and update the font's DPI whenever our window
enters or leaves an output.

This is since a change in the outputs we're mapped on means the scale
factor to use, or the DPI to use for the fonts may have changed.

However, a special case is when we're removed from the last
output. This should only happen at shutdown, when we're un-mapping
ourselves.

In this case, we typically don't have a access to e.g. the PTMX
fd (often, the reason we're shutting down is because the client
exited). This resulted in (harmless) error messages when emitting the
TIOCSWINSZ event.

Since we're shutting down anyway, we can simply skip the resize and
everything. This gets rid of the error message, and also means we're
shutting down faster.
2020-02-29 15:46:40 +01:00
Daniel Eklöf
ea2d7f8b8c
input: start window move right away if user starts dragging the window
When the user left-clicks the title-bar, we start a timer. When the
timer has elapsed, we initiate a 'move' operation.

However, if the user clicked, and then started dragging right away,
there was a very visible lag since we waited for the timeout before
starting the move.

Now, on a pointer motion event we detect a running 'move' timer, and
abort it and instead start the 'move' operation right away.
2020-02-29 15:38:04 +01:00
Daniel Eklöf
33744ebe63
input: fix 'unused variable' warning (release builds) 2020-02-29 15:29:58 +01:00
Daniel Eklöf
73133c10ee
input: cleanup 2020-02-29 15:29:00 +01:00
Daniel Eklöf
e496d81f4d
input: don't update xcursor on keyboard enter/leave
I'm not sure why I added this in the first place... our cursor doesn't
depend on keyboard focus.

Furthermore, with CSDs, we may get keyboard enter events for the CSD
surfaces, and these should definitely *not* update the xcursor
as if it was inside the main surface.
2020-02-29 13:04:18 +01:00
Daniel Eklöf
43b07b122a
input: csd: add a small delay before initiating a move
This ensures the user has time to double-click to toggle the maximized
state.
2020-02-29 12:56:04 +01:00
Daniel Eklöf
c917a74f48
wayland: remove all usages of wayl_terminal_from_surface()
Use the 'user data' pointer from the wayland surface instead.
2020-02-29 12:13:58 +01:00
Daniel Eklöf
43c0551806
wayland: store pointer to window instance in all surfaces 2020-02-29 12:09:28 +01:00
Daniel Eklöf
1091d1c078
input: reset mouse state on pointer leave 2020-02-29 12:08:59 +01:00
Daniel Eklöf
4ee5a81d1a
input: toggle maximized state when double-clicking the title bar 2020-02-29 11:56:16 +01:00
Daniel Eklöf
7b51d6919d
input: handle double/triple click state regardless of surface 2020-02-29 11:55:43 +01:00
Daniel Eklöf
cbf657e2d2
render: resize: redraw search box, if visible 2020-02-29 11:42:00 +01:00
Daniel Eklöf
f67572208d
render: search: fix off-by-one error in number of visible characters 2020-02-29 11:41:40 +01:00
Daniel Eklöf
601dc02ea1
render: wl_subsurface_set_position() uses un-scaled coordinates
This fixes an issue where the CSDs and the search box was incorrectly
positioned when output's scale != 1.
2020-02-29 11:40:41 +01:00
Daniel Eklöf
5717a0dfb0
config: change default geometry from 800x600 -> 700x500
If the display resolution *is* 800x600, using this size is bad since
there will typically be panels and other things on the screen too.

Not that 800x600 is something we expect to see in real life, but may
happen on virtual displays.
2020-02-29 11:01:23 +01:00
Daniel Eklöf
e01030f99f
render: csd: bump title bar height from 20 -> 26 2020-02-29 09:39:05 +01:00
Daniel Eklöf
d48a789412
input: handle CSD border corners correctly
That is, change to correct cursor, and do resize correctly.
2020-02-29 09:32:22 +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
de9fcbc339
render: csd: use a struct for positioning information 2020-02-28 19:00:48 +01:00
Daniel Eklöf
45c1585bfb
render: resize: change 'resize' log from info to debug 2020-02-28 18:51:51 +01:00
Daniel Eklöf
ec2ad7755f
render: CSDs: transparent borders
This gives the illusion that window is border-less, but still gives us
surfaces the user can grab to resize the window.
2020-02-28 18:51:09 +01:00
Daniel Eklöf
e7e553ae5b
render: resize: exclude CSD borders when loading default geometry in maximized mode 2020-02-28 18:50:15 +01:00
Daniel Eklöf
b44bbb5b2b
render: CSDs: don't render borders (only title bar) in maximized mode 2020-02-28 18:49:34 +01:00
Daniel Eklöf
6ba476b3bd
wayland: configure: work around GNOME/mutter weirdness
When resizing the window under mutter, mutter seems to expect a
configure ack *and* a surface commit *right* away, or things get out
of sync.

Unlike kwin, which is requires a commit for each configure ack, but is
fine with having the commit arrive later (after we've rendered it),
mutter is not.

I even tried delaying the configure ack until just before the commit,
but still no go.

So for now, detect when we're running under mutter and always do a
surface commit right away.

This can *not* be done on any other compositor as it breaks the CSD
and main surface synchronization; we've resized the CSDs, but not the
main surface.

I.e. this *should* not work, but for some reason is the *only* way to
make things work on mutter.

Interestingly, doing it any other way on mutter causes visual
glitches; window jumping around when resizing, or de-synchronized
CSDs/main surface.
2020-02-28 18:43:33 +01:00
Daniel Eklöf
b69c9b5f58
wayland: fix window size adjustment for CSDs placed outside main surface
* Do this both in XDG configure, and when the decoration manager
  switches between CSDs/SSDs at run-time.

* Exclude CSD borders when we're maximized
2020-02-28 18:42:10 +01:00
Daniel Eklöf
6c20abf279
wayland: warn when compositor doesn't implement the decoration manager interface 2020-02-28 18:37:07 +01:00
Daniel Eklöf
7d021b5b37
wayland: request server side decorations 2020-02-28 18:36:52 +01:00
Daniel Eklöf
3c7e17e8c1
wayland: drop required wl_output interface version from 3 -> 2
We don't need version 3, and mutter 3.34 only implements version 2.
2020-02-28 18:35:50 +01:00
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