Prevent wayland clients that request the X11 clipboard but closing
their read fd prematurely to crash labwc because of the unhandled
SIGPIPE signal. It is caused by wlroots trying to write the X11
clipboard data to the closed fd of the wayland client.
See https://github.com/labwc/labwc/issues/890#issuecomment-1524962995
for a reproducer involving xclip and wl-paste | head -c 1.
po: clean up language files
Changed entries in "Language" field to language code
Added language names to "Language Team"
Removed example email address
Fixed author names in Copyright section
Consolatis [Tue, 28 Mar 2023 17:23:49 +0000 (19:23 +0200)]
src/cursor.c: make sure the cursor is visible after startup
Before this patch, the cursor was invisible after labwc startup
unless manually moved by the user (or being positioned on top
of some some automatically spawned client surface). This patch
sets the cursor from its uninitialized value (LAB_CURSOR_CLIENT)
to the default cursor.
Consolatis [Mon, 27 Mar 2023 22:58:42 +0000 (00:58 +0200)]
src/cursor.c: fix invisible cursor on output loss / restore
Previously, the cursor image was only updated on output loss when the
cursor was on a labwc owned surface. This patch forces a re-enter of a
client surface in the remaining case of cursor being over a non-labwc
surface which causes the client to re-set its own cursor image.
Johan Malm [Sat, 25 Mar 2023 16:38:43 +0000 (16:38 +0000)]
desktop: move scene-tree node in move-to-back
view_minimize() does not need to call desktop_move_to_back() because the
stacking order is not changed and the windowSwitcher uses the scene-tree
nodes anyway.
Note: Movement of xwayland sub-views still relies on keeping server->views
in sync with z-order
Consolatis [Fri, 24 Mar 2023 19:21:21 +0000 (20:21 +0100)]
Decorations: always default to client side decorations
This is required as both decoration protocol variants, the xdg one
and the deprecated kde one, assume that an application that did not
negotiate any decorations will render client side decorations.
Before this patch, setting `<decoration>` to `client` would cause applications
which prefer server side decorations to not have any decorations at all. This
patch fixes it by respecting the result of earlier negotiations via the
xdg-decoration-unstable-v1 protocol.
Johan Malm [Thu, 23 Mar 2023 21:39:49 +0000 (21:39 +0000)]
cursor: fix focus.followMouse glitches
Update focus correctly when using `<focus><followMouse>` and (a) the
focused window is closed; and (b) after switching desktops using action
GoToDesktop. Issue #830
Consolatis [Tue, 7 Mar 2023 16:58:15 +0000 (17:58 +0100)]
src/keyboard.c: Fix wrong argument parsing
The `wlr_keyboard.events.modifiers` signal does not use
a `wlr_keyboard_key_event` as argument, instead it is a
pointer to the `wlr_keyboard` instance which caused the
signal.
Consolatis [Tue, 7 Mar 2023 16:51:28 +0000 (17:51 +0100)]
Prevent cursor based region-snapping when starting a move with A-Left
When wanting to snap to a region when starting the move
operation with A-Left (or a similar mousebind which includes a
modifier), the modifier - or another one - must be pressed again.
John Lindgren [Sat, 25 Feb 2023 17:05:22 +0000 (12:05 -0500)]
view: Anchor right/bottom edge only when resizing via top/left edge
Currently, we anchor the right/bottom edge of the view whenever the top/
left edge is moving (current.x/y != pending.x/y). Doing so doesn't make
much sense when the right/bottom edge is also moving. In that case it's
probably best to move the view (or at least its top/left corner)
directly to its final position.
The most noticeable effect of this change is with views that don't
accept their requested size exactly when tiled or maximized (examples:
havoc, xfce4-terminal). Previously, their right-bottom corner would be
aligned with the screen edge, leaving gaps on the left and top. Now the
top-left corner will be aligned and the gaps will be on the right and
bottom. This is still not ideal, but IMHO less surprising to the user.
John Lindgren [Mon, 20 Feb 2023 21:22:01 +0000 (16:22 -0500)]
view: Attempt to keep non-floating views on the same output
- Make view_discover_output() static
- Call view_discover_output() only for floating views
- Deprecate view_output(); make it use view->output when possible
Consolatis [Fri, 3 Mar 2023 17:16:46 +0000 (18:16 +0100)]
Add ToggleKeybinds action
This can be used to better control Virtual Machines, VNC clients, nested
compositors or similar. All keybinds other than ToggleKeybinds itself are
disabled when first called, a 2nd call will restore handling of all keybinds.
Johan Malm [Sun, 5 Feb 2023 19:29:24 +0000 (19:29 +0000)]
view: add move_to_front to `struct view_impl`
...to increase xwayland and xdg-shell encapsulation and to avoid passing a
function pointer as an argument in `xwayland_move_sub_views_to_front()`
which is inconsistent with labwc design patterns.
Rename view-impl.c to view-impl-common.c
Move function declarations that are common to view-implementations from
view.h into view-impl-common.h
John Lindgren [Mon, 20 Feb 2023 22:30:17 +0000 (17:30 -0500)]
xdg: Use wlr_xdg_surface_get_geometry() to get size
This fixes an issue with havoc not having a valid size on map().
Investigation showed that xdg_surface->current.geometry is set only by
the xdg_surface::set_geometry protocol message, which is optional. If
set_geometry is not called, then we are supposed to compute the size
from the surface buffer(s). wlr_xdg_surface_get_geometry() already
accounts for this, so we just need to use wlr_xdg_surface_get_geometry()
instead of reading xdg_surface->current.geometry directly.
John Lindgren [Fri, 17 Feb 2023 18:50:44 +0000 (13:50 -0500)]
Revert "xwayland: Fix size issue when starting VLC fullscreen"
The fix caused a couple of issues:
1. Ignoring client configure requests caused some clients to hang
and not repaint correctly. We are supposed to synthesize a
ConfigureNotify event when ignore/override a client configure
request, but this isn't possible with current wlroots.
2. Setting view->natural_geometry from client configure requests
resulted in overwriting good values with bad in some cases (e.g.
with tiled xfce4-terminal in xwayland mode).
For now, revert the fix. This does allow clients to mess with view
positioning for maximized/fullscreen/tiled views, but right now the
alternatives seem worse.
The original specific issue (VLC undoing its fullscreen geometry)
is arguably a bug in VLC anyway.
John Lindgren [Wed, 15 Feb 2023 07:12:22 +0000 (02:12 -0500)]
view: Tidy up view->output/view->fullscreen redundancy
A fullscreen view currently has its output specified twice by:
- struct output *output
- struct wlr_output *fullscreen
view->fullscreen may also become a dangling pointer if the output is
disconnected, because view_on_output_destroy() clears view->output but
not view->fullscreen.
To eliminate the redundancy and the dangling pointer, let's change
view->fullscreen to a Boolean and rely on view->output to specify the
output.
Along the way, change a few related usages of struct wlr_output to
struct output as well.
No functional change intended.
v2: Don't allow entering fullscreen on disabled output (makes
conditions for entering/leaving fullscreen symmetric)
v3: Use output_is_usable() helper