Commit graph

1342 commits

Author SHA1 Message Date
Consolatis
ac5c9dae00 src/xwayland-unmanaged.c: Prevent racing configure event to reposition
Fixes #469

Reported-by: @Flrian
Suggested-by: @jlindgren90
2022-08-11 16:19:00 +01:00
01micko
32b176e05e README.md: fix broken link for 'environment' man page
- re: https://github.com/labwc/labwc.github.io/pull/1
2022-08-01 18:57:12 +01:00
Jan Beich
c22a991b2c CI: auto-update freebsd-vm within major version
Reduce the churn by transparently picking up bustage fixes.
2022-07-29 22:21:30 +02:00
Consolatis
4dce894fda src/config/session.c: Handle allocation failures
Reported-by: @heroin-moose
2022-07-29 06:45:24 +01:00
Consolatis
d6ea0d68cf src/config/session.c: Update dbus / systemd activation environment
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.

Based on PR #461 by @Joshua-Ashton
2022-07-29 06:45:24 +01:00
Consolatis
b8995e45dc src/view.c: Fix output handling with no outputs available
Reported-by: @Flrian
2022-07-24 23:04:26 +02:00
John Lindgren
5d0faa2333 xwayland: Process unmanaged client configure requests more quickly
This is a similar fix to 065c37d3f5 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.
2022-07-23 20:37:59 +02:00
Johan Malm
302b1e8299
Merge pull request #457 from Consolatis/fix/xwayland_seat
xwayland: (Re)set seat when xwayland is ready
2022-07-21 18:13:08 +01:00
Consolatis
3ba75fe2a0 CI: Use MacOS-12 for FreeBSD runner 2022-07-21 04:53:52 +02:00
Consolatis
819404c43b xwayland: (Re)set seat when xwayland is ready
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.
2022-07-21 03:57:42 +02:00
Consolatis
6e1dd2dbfa CI: Update FreeBSD runner 2022-07-21 03:57:07 +02:00
John Lindgren
065c37d3f5 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().
2022-07-18 22:06:12 +01:00
John Lindgren
a0a5cf706e resistance: Do not consider edges of disabled outputs 2022-07-18 22:06:12 +01:00
John Lindgren
2b7be71254 cursor: Move resistance_resize_apply() before view_adjust_size()
This ensures that screen edge resistance does not result in sizes
that violate WM_SIZE_HINTS constraints.

Also correct a coding style issue nearby.
2022-07-18 22:06:12 +01:00
Johan Malm
06cc21664f
Merge pull request #454 from Joshua-Ashton/bump-fd-limit
main: Increase FD limit
2022-07-17 14:24:05 +01:00
Joshua Ashton
722aa042b7 main: Increase FD limit
This defaults to 1024, which is tiny, but is a requirement
for processes using the deprecated `select` function.

We must reset this back whenever we fork to start a new process,
as this is inherited, and breaks applications using `select` otherwise.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2022-07-17 00:59:23 +00:00
Joshua Ashton
6c2bbb42ea common: Add helpers for raising/lowering FD limit
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2022-07-17 00:59:23 +00:00
Johan Malm
fd7ec0ab95 buf.c: fix bug in environment variable expansion
Allow underscore in environment variable names.

Closes issue #439

Helped-by: @Consolatis
...who both found the bug and told us how to fix it :)
2022-07-15 21:51:28 +02:00
Johan Malm
884ad60e1b NEWS.md: add notes on 0.5.3 2022-07-15 20:05:43 +01:00
Johan Malm
eea5a62ea3 NEWS.md: add notes on 0.6.0 2022-07-14 07:20:44 +01:00
Joshua Ashton
a74060381b cursor: Fix crash when creating a cursor constraint
Fix crash when creating a cursor constraint and there is no currently
focused view.

Fixes a crash starting Warhammer 40,000: Dawn of War II (15620)
2022-07-14 05:16:26 +02:00
Consolatis
79b1630724 config/rcxml.c: Fix parsing of adaptiveSync setting 2022-07-14 01:01:10 +02:00
Jan Beich
4b73eac41d CI: upgrade FreeBSD to 13.1
FreeBSD doesn't support /latest and /quarterly package repos on EOL
versions. 13.0 reaches EOL on 2022-08-31, so avoid CI breakage.
2022-07-13 23:43:05 +02:00
Krsna Mahapatra
e05d4600be CI: Add missing deps for Void Linux runner 2022-07-12 06:58:21 +01:00
Consolatis
f1ba0a89fc 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.
2022-07-11 15:58:33 +01:00
Johan Malm
1f0055a7e0 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/
2022-07-10 17:21:40 +01:00
Consolatis
ceca6afefc src/output.c: Always react to new output configuration
Without this fix we will never react to output configuration changes
via wlr-randr and friends.

If output_config_apply() commits the new config, handle_output_layout_change()
is called but doesn't do anything because the config is still pending.

This patch moves the code into its own function do_output_layout_change()
which additionally gets called after all output configs are committed.

The original handler is turned into a wrapper around do_output_layout_change().

Reported-by @heroin-moose
2022-07-09 09:37:48 +01:00
Johan Malm
bfff9d02c7 xwayland.c: fix position bug
Set node position in the configure/set_geometry handlers when moving a
window in response to a client request.

Steps to reproduce weird positioning fixed by this patch:

1. Start leafpad
2. Open Help->About
3. Move the dialog
4. Close the dialog
5. Open it again
6. Drag it and observe a jump in position

There is also an xwayland PyQt5 script in PR #428 which demonstrates
jumpy position.
2022-07-04 18:25:52 +01:00
Consolatis
9b49f19a73 src/action.c: Convert action->arg to a list of action_arg
In preperation for Actions that require multiple arguments
2022-07-04 16:19:28 +01:00
Consolatis
baaee26937 src/view.c: Fall back to default geometry when changing state
This makes sure that applications starting in maximized of fullscreen
mode always have their natural_geometry set to sensible values.

Partly fixes #403
2022-07-03 13:46:47 +01:00
John Lindgren
80792d446f (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.
2022-07-03 12:59:36 +01:00
Consolatis
3c345201cd Restore original geometry when moving a tiled window
Fixes #391
2022-07-02 16:21:32 +01:00
Consolatis
5585977f72 Rename unmaximized_geometry to natural_geometry 2022-07-02 16:21:32 +01:00
Consolatis
02595eefaa src/view.c: Unmaximize on SnapToEdge 2022-07-02 12:43:23 +01:00
Consolatis
7bdcef51b7 src/view.c: Prevent SnapToEdge while in fullscreen 2022-07-02 12:43:23 +01:00
Consolatis
2f7b1fd5fb src/view.c: Re-arrange tiled windows on un-fullscreen and un-maximize 2022-07-02 12:43:23 +01:00
Consolatis
2d02fec4b2 src/view.c: Re-arrange tiled windows on decoration change 2022-07-02 12:43:23 +01:00
Consolatis
8ed62b4860 src/view.c: Re-arrange tiled windows on layout change 2022-07-02 12:43:23 +01:00
Consolatis
3a4b55886d src/view.c: Convert SnapToEdge to use view_apply_xxx_geometry framework 2022-07-02 12:43:23 +01:00
Consolatis
992089e901 src/layers.c: Prevent re-arranging views if usable_area didn't change 2022-07-02 12:43:23 +01:00
Consolatis
f4aa6118e9 src/layers.c: Adjust views based on usable_area changes 2022-06-30 20:41:54 +01:00
Consolatis
09915b8f43 src/ssd/ssd.c: Keep view->margin in sync when toggling decorations
Fixes #409
2022-06-30 06:45:18 +01:00
Consus
ef3dbbf29a Fix usable area calculation
Currently if a surface with exclusive zone is created prior to regular
surfaces, the size of the exclusize zone does not affect the usable area
for regular surfaces. This for example results in notifications being
rendered over the statusbar.

This commit fixes the issue by handling the surfaces with exclusive
zones first.

Fixes #420.
2022-06-28 21:38:42 +01:00
Consolatis
a3d3878d28 Chase wlroots: wlr_input_device refactor
To update the wlroots subproject use
meson subprojects update wlroots

Chases wlroots 91943a68a6976ef7c4cc70afc07954a00fae678b
wlr_input_device: remove anon union field

Fixes #415
2022-06-25 17:13:55 +01:00
Johan Malm
437230b3a0 menu: support <separator />
Add theme options:
- menu.separator.width
- menu.separator.padding.width
- menu.separator.padding.height
- menu.separator.color

Support separator lines defined by <separator />

Note that separator labels (with text) defined by <separator label="" />
are not supported.
2022-06-25 14:56:35 +02:00
Consolatis
f13fbd7aa6 CI: add FreeBSD runner
Fixes #413
2022-06-23 22:37:20 +02:00
Johan Malm
6f93c9981b README: add link to website 2022-06-22 21:19:50 +01:00
Johan Malm
3f10880545 README: update links to scope document 2022-06-22 21:12:54 +01:00
Consolatis
c49f4e735d src/action.c: Fix includes for kill() and getpid()
Fixes #410
2022-06-22 01:19:43 +02:00
Consolatis
69350b676b CI: add Void Linux in musl variant 2022-06-22 01:06:54 +02:00