John Lindgren [Thu, 8 Sep 2022 17:20:48 +0000 (13:20 -0400)]
config: Redefine Title context to include blank areas of Titlebar
... and use Title for the Drag (Move) and DoubleClick (Maximize)
titlebar actions, which are unexpected when the cursor is over one
of the window buttons.
John Lindgren [Fri, 2 Sep 2022 20:41:27 +0000 (16:41 -0400)]
desktop: Cycle first to topmost view if not already focused
The topmost view may not always be the focused view; for example,
when Audacious's main window is focused but the floating Search
Tool window remains on top of it. In that case the floating window
(not the main window) should be the first view selected in the
window switcher.
John Lindgren [Sat, 3 Sep 2022 21:46:53 +0000 (17:46 -0400)]
cursor: Update focus at various additional points
- When XDG and XWayland views are positioned (view_moved()).
- When unmanaged XWayland surfaces are mapped, unmapped, or moved.
Do not update cursor focus during an out-of-surface drag.
Along with the existing call in desktop_move_to_front(), this
should hopefully cover the majority of cases where the cursor focus
could get out-of-date, with the possible exception of layer-shell
surfaces.
John Lindgren [Sat, 3 Sep 2022 17:10:33 +0000 (13:10 -0400)]
xwayland: Factor out focus_next_surface() from unmanaged_handle_unmap()
- Eliminate multiple "return" paths in unmanaged_handle_unmap(), which
were a bug waiting to happen.
- Use wl_list_for_each_reverse() rather than wl_list_for_each() to find
the topmost (most-recently-created) unmanaged surface.
- Only call desktop_focus_topmost_mapped_view() if the unmapped surface
was actually focused.
Consolatis [Tue, 30 Aug 2022 18:10:21 +0000 (20:10 +0200)]
src/xwayland-unmanaged.c: Give keyboard focus back to topmost mapped view
Previously, when unmapping and not finding another unmanaged surface
to give keyboard focus to we were not doing anything. With this patch
we will give focus to the topmost mapped view which is the same
behavior that also happens when an usual X11 surface unmaps.
Consolatis [Mon, 29 Aug 2022 21:43:13 +0000 (23:43 +0200)]
src/config/rcxml.c: Add support for <devault /> mousebinds
This loads default mousebinds and provides a way to keep config files
simpler whilst allowing user specific binds.
Note that if no rc.xml is found, or if no <mouse><mousebind> entries
exist, the same default mousebinds will be loaded even if the <devault />
element is not provided.
Consolatis [Tue, 30 Aug 2022 00:10:56 +0000 (02:10 +0200)]
src/view.c: Fix minimizing the last window
Before this patch, minimizing the last un-minimized window would
not cause it to be set to inactive. This in turn would confuse panels
which depend on the 'active' flag to decide when to either activate or
minimize the clicked on window.
Johan Malm [Sat, 27 Aug 2022 12:26:30 +0000 (13:26 +0100)]
osd: position preview border within SSD max extents
This makes the border visible when alt-tabbing maximized windows and
prevents it from rendering on other outputs or on top of exclusive
layer-surfaces such as panels.
Johan Malm [Tue, 16 Aug 2022 20:56:39 +0000 (21:56 +0100)]
cursor: do not clamp motion coordinates for xdg-shell surfaces
...when pointer moves off the xdg-shell surface which is possible when
for example grabbing a scroll-bar or selecting text.
Clamping results in undetected pointer motion when applied in the
direction of movement (for example clamping at view->y masks vertical
movement when the y-coordinate is greater than view->y), which in turn
can appear as sporadic to the end-user.
John Lindgren [Sat, 13 Aug 2022 15:36:07 +0000 (11:36 -0400)]
cursor: Do not clamp motion coordinates for XWayland surfaces.
X11 apps expect to be able to receive motion events outside
the window area (this is necessary for client-side move/resize
handles to work properly). So do not clamp the motion
coordinates for XWayland surfaces.
Before this change, attempting to enlarge an XWayland window
using a client-side resize handle resulted in the window size
lagging behind the mouse cursor quite severely, since each
motion event was in effect allowed to expand the window by
only a few pixels. The closer the initial button-press was
to the edge of the window, the worse the lag would be.
Consolatis [Fri, 12 Aug 2022 12:12:31 +0000 (14:12 +0200)]
src/ssd/ssd_titlebar.c: Completely hide title when running out of space
Before this commit the window title could overflow in certain conditions,
usually when rapidly resizing. This commit fixes it by completely hiding
the corresponding scene node when there is no space available.
This allows xdg-desktop-portal-wlr to work out of the box for screen-recording.
If systemd or dbus is not available the environment update will fail gracefully.
This patch will set XDG_CURRENT_DESKTOP=wlroots but a user may change this by
either having the environment variable set before starting labwc or by having
a different value set in ~/.config/labwc/environment.
John Lindgren [Sat, 23 Jul 2022 15:20:34 +0000 (11:20 -0400)]
xwayland: Process unmanaged client configure requests more quickly
This is a similar fix to 065c37d3f5ee but for unmanaged windows. The issue
could be seen for example when moving the undocked Search Tool window in
Audacious. For unmanaged windows, we don't track any pending move/resizes,
so just process all client configure requests immediately.
For some reason wlroots will reset the seat assigned to xwayland
to NULL whenever Xwayland terminates. This patch restores the seat
whenever Xwayland is ready again.
Fixes #166
Fixes #444
Thanks @droc12345 for figuring out the actual issue.
John Lindgren [Mon, 18 Jul 2022 03:42:04 +0000 (23:42 -0400)]
xwayland: Process move-only client configure requests more quickly
For a move-only client configure request, treat it similarly to
view_move() by updating the scene-graph immediately, rather than waiting
for handle_commit(). Move-and-resize requests are handled the same as
before.
This (mostly?) fixes the glitchiness that was noticeable when dragging
an undecorated XWayland window (e.g. Audacious in Winamp mode).
Also:
- Reduce some code duplication in handle_request_configure() by
simply calling configure(), as suggested by @johanmalm in #428.
- Factor out common logic after a move and/or resize into view_moved().
src/view.c: Prevent crash by killing a moving application
When a view is destroyed labwc calls interactive_end(view) which
may reposition the view which is partly destroyed and doesn't own
any surface anymore. To prevent this scenario from happening don't
call interactive_end() at all and just reset server->grabbed_view
and server->input_mode directly.
Before this patch, the bug could be reproduced by:
- xcalc &
- sleep 5; killall xcalc
- move the xcalc window completely to one of the edges
The change in src/xwayland.c is not required for this bug
to be fixed but may prevent something similar in the future.
Johan Malm [Sun, 10 Jul 2022 15:43:05 +0000 (16:43 +0100)]
README.md: refresh and refactor
- Use &nsbp; in links with spaces
- Change headings from verbs to nouns
- Combine build and install headings
- In 'What is this', use the text on the labwc website
- Remove video links; one wasn't working and the other were very old
- Use more recent screenshot
- Simplify the 'labwc supports the following' bullet points
- Split dependencies into build and run-time
- Remove dependecy version numbers and let meson.build be the source of
truth
- Simplify config file table by taking out middle column
- Split the configuration section into configuration and theming
- s/roadmap/scope
- Change man page links from docs/ to labwc.github.io/
John Lindgren [Sat, 2 Jul 2022 17:18:31 +0000 (13:18 -0400)]
(Partly) fix handling of client-initiated configure requests
- Add missing call to wlr_scene_node_set_position() in
unmanaged_handle_commit() -- this fixes moving unmanaged XWayland
windows.
- Update view->pending_move_resize when we receive a configure request
for a managed XWayland surface -- this fixes moving managed but
undecorated XWayland windows.
- Also update view->pending_move_resize when we move a surface while a
configure request is already pending -- this fixes a discrepancy
between displayed and actual position for XWayland windows that try to
set their own initial position, but then get overridden by labwc's
positioning.
Moving undecorated XWayland windows is still really glitchy -- it appears
that an XWayland window gets sent incorrect mouse motion coordinates when
there is a pending configure request moving the window itself.