Commit graph

1650 commits

Author SHA1 Message Date
John Lindgren
db1d6fa308 xdg: Fix positioning of initially-maximized views
- Don't overwrite pending size in map() if it was already set
- Don't reposition view in map() if maximized/fullscreen

Also, as future-proofing in case we one day allow initially-tiled views,
replace explicit maximized/fullscreen checks with view_is_floating().
2023-02-10 10:45:16 +01:00
John Lindgren
a1b5e1939d xdg: Just call view_center() now that it uses pending width/height 2023-02-09 18:26:44 +01:00
John Lindgren
cf6eb29ef5 view: Use pending rather than current dimensions in positioning
This should fix race conditions (such as #671) when multiple
position changes occur in rapid succession.
2023-02-09 18:26:44 +01:00
John Lindgren
0181e5f4ae xdg: Set initial pending dimensions for the view at map
We would like to use the pending dimensions in view positioning
logic, so make sure they are set early on.
2023-02-09 18:26:44 +01:00
John Lindgren
b75dbd5b38 view: Use wlr_box for current/pending geometry 2023-02-09 10:44:15 -05:00
John Lindgren
3941991505 menu: Compute usable area for the correct output
If a menu was opened via keybind while the cursor was on another,
differently-sized output, the wrong usable area was used to
position the menu.
2023-02-09 00:33:56 -05:00
John Lindgren
103a2a8f6c xdg: Handle corner case of move with pending resize correctly
If xdg_toplevel_view_move() is called when a resize is pending
(e.g. after xdg_toplevel_view_resize() but before handle_commit()),
the newer x/y coordinates passed to move() should take precendence
over the older pending_move_resize.x/y coordinates.

This is consistent with the logic used in xwayland.c's move().
2023-02-08 22:22:10 +00:00
John Lindgren
cfc3c93102 xdg: Eliminate redundant update_x/update_y flags
struct view's pending_move_resize.update_x/update_y flags appear to
be redundant, since we can easily determine whether x/y have been
update via a simple comparison in handle_commit().

The only corner case I can think of where this change might affect
behavior, is if xdg_toplevel_view_move() is called while a resize
is still pending (e.g. after xdg_toplevel_view_configure() but
before handle_commit()). This corner case will be addressed in the
following commit.
2023-02-08 22:22:10 +00:00
John Lindgren
a417c1c761 xwayland: Save natural geometry from initially maximized views 2023-02-08 22:19:25 +00:00
John Lindgren
09599861ac xwayland: Fix size issue when starting VLC fullscreen 2023-02-08 22:15:14 +00:00
Consolatis
44a15b16ce CI: adapt to new debian.sources format 2023-02-06 04:39:52 +01:00
Johan Malm
f829a78918
Merge pull request #735 from Consolatis/feature/clear_action
Allow clearing key/mouse bindings
2023-02-04 18:59:38 +00:00
Johan Malm
6a51764884
Merge pull request #747 from Consolatis/feature/foreign_output_tracking
src/foreign.c: track outputs
2023-02-03 21:59:12 +00:00
Consolatis
4a8b50603e src/config/rcxml.c: allow clearing key/mouse bindings
Fixes #567
2023-02-03 03:30:10 +01:00
Consolatis
27218cd2c9 src/view.c: make view_wlr_output() static
.. as there are no external consumers left.
2023-02-02 13:40:21 +01:00
Consolatis
3a21c39509 src/foreign.c: track outputs
Fixes #744
2023-02-02 13:26:53 +01:00
Consolatis
14a0c83ae0 src/foreign.c: refactor 2023-02-01 17:47:34 +00:00
Consolatis
82e9e866ec Enable more compiler warnings 2023-02-01 10:42:22 +01:00
Consolatis
1995a33df9 CodeStyle: prevent space in code indents 2023-01-31 21:22:40 +00:00
Johan Malm
a3fff9f87b build: bump version to 0.6.1 2023-01-29 16:22:09 +00:00
Johan Malm
649b324446 NEWS.md: add notes on 0.6.1 2023-01-29 16:20:58 +00:00
Consolatis
dd1a8f01dd src/output.c: only overwrite the automatic layout if necessary
The wlroots wlr_output_layout provides two different modes of operation:
- automatically
- manually

In automatic mode wlroots reacts to new / removed outputs and resolution
changes and then adjusts the output positions within the layout itself.

The manual mode disables this behavior and thus it is the whole
responsibility of the caller (e.g. us relaying whatever wdisplays /
kanshi provides) to ensure that the layout is somewhat sane. E.g. that
it doesn't have any holes between outputs and there are no overlapping
outputs.

The mode is set for each output individually. To use (and keep using)
the automatic mode, outputs have to be added via the _add_auto() variant
(which we do) and they are not allowed to be moved via _move() (which
we currently do and thus break the automatic layout).

To fix that, this patch compares the user (tool) supplied position to the
automatically calculated position and only if they differ we call _move().
2023-01-29 14:36:15 +00:00
Johan Malm
6f3043b08d layer: improve keyboard-interactivity
- Process layer-shell keyboard interactivity in the map and commit
  handlers only, rather than in layers_arrange(). This allows handling of
  the layer-surface that emitted the event rather than iterating over all
  surfaces in the output layer-tree, and therefore avoids having to guess
  which surface should have keyboard preference (and it might not be the
  last one added to the list which was the assumption previously).

- Prevent seat_focus_surface() from setting keyboard focus if a layer-shell
  surface with exclusive keyboard-interactivity has the focus.

- Set cursor_context type for layer-surfaces without node-descriptors
  in order to set keyboard focus correctly in cursor_button_press().

Tested satisfactorily with xfce4-panel and gtk-layer-demo.

Fixes #725 and #704
2023-01-29 14:31:49 +00:00
Consolatis
4dc99e2f38 cursor: update cursor image on scale change 2023-01-26 22:02:13 +00:00
bi4k8
58382260de ensure cursor is correctly scaled at startup 2023-01-24 05:17:13 +01:00
Consolatis
6c42aced3d Support flicker free boot
Fixes #724
2023-01-23 22:10:22 +01:00
Johan Malm
5ebaf3ff52 Enable single-pixel-buffer-v1
...in order to enable cool clients like chayang

References:

- https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3428
- https://git.sr.ht/~emersion/chayang
2023-01-14 22:14:13 +01:00
Johan Malm
1bcc0aa5db
Merge pull request #433 from Consolatis/feature/regions
Add SnapToRegion
2023-01-11 20:24:07 +00:00
Consolatis
111f48b485 SnapToRegion: Add documentation 2023-01-11 18:52:24 +01:00
Consolatis
07ee56176d SnapToRegion: Allow for live config updates 2023-01-11 18:52:24 +01:00
Consolatis
550e40b56b SnapToRegion: Respect core.gap setting 2023-01-11 18:52:24 +01:00
Consolatis
eb5c8cfdad SnapToRegion: Add dynamic overlay
Either uses a half transparent single rect if running
hardware accelerated or uses a solid struct multirect
outline if not.
2023-01-11 18:52:24 +01:00
Consolatis
4edd67de17 SnapToRegion: Evacuate tiled views from destroying outputs 2023-01-11 18:52:24 +01:00
Consolatis
25cea94a32 SnapToRegion: Snap when ending a move while pressing a modifier 2023-01-11 18:52:24 +01:00
Consolatis
7e99d8ba08 SnapToRegion: Add overlay while moving and pressing a modifier 2023-01-11 18:52:24 +01:00
Consolatis
0c31886061 SnapToRegion: Add regions_from_cursor() 2023-01-11 18:52:24 +01:00
Consolatis
96a591297d SnapToRegion: Add SnapToRegion action 2023-01-11 18:52:24 +01:00
Consolatis
9d3e309a22 SnapToRegion: Add view_snap_to_region() 2023-01-11 18:52:24 +01:00
Consolatis
67952cd749 SnapToRegion: Wire up output and handle usable_area changes 2023-01-11 18:52:24 +01:00
Consolatis
43fe138385 SnapToRegion: Add config parser 2023-01-11 18:52:23 +01:00
Consolatis
51727cf8f7 SnapToRegion: Add implementation 2023-01-10 23:29:10 +01:00
John Lindgren
45e0a4f48c xwayland: Add xwayland.h and move more things to xwayland.c
- Move xwayland-specific struct definitions to new xwayland.h header
- Move xwayland_move_sub_views_to_front() from desktop.c to xwayland.c
- Split out xwayland_server_init/finish() from server_init/finish()
- Rename new_xwayland_surface -> xwayland_new_surface and
  xwayland_surface_new() -> handle_new_surface() for consistency
- Add "mapped" argument to xwayland_unmanaged_create() so that we can
  make unmanaged_handle_map() private to xwayland-unmanaged.c
2023-01-07 22:22:55 -05:00
Consolatis
b62159fe06 docs/rc.xml: Overwrite the default W-Return keybind
.. instead of adding a new one.
Also change from sakura to foot and add comments.
2023-01-06 21:40:49 +00:00
Consolatis
b12b6b320e src/action.c: Improve debugging by adding action argument to debug log 2023-01-06 21:38:12 +00:00
Consolatis
bc4108fec0 output: Use better arg naming for output_update_all_usable_areas()
This restores the original approach of naming the argument `layout_changed`
which fits much better than `enforce_view_arrange`. Especially when extending
the function to also handle region updates once merged.
2023-01-06 20:39:04 +01:00
Consolatis
7b48da4ab2 include/labwc.h: Provide MIN/MAX macros 2023-01-06 18:33:25 +01:00
Consolatis
9d7386effd include/ssd.h: prefix defines with SSD_ 2023-01-06 18:32:36 +01:00
Consolatis
7790da7b4e src/view.c: move xwayland specific function to xwayland.c
Also remove the `<xcb/xcb_icccm.h>` include as its already included
by `"labwc.h"` -> `<wlr/xwayland.h>` -> `<wlr/xwayland/xwayland.h>`.
2023-01-06 14:54:28 +01:00
John Lindgren
ed31381eb8 output: Add output_update_usable_area/all_usable_areas()
Move the desktop_arrange_all_views() call outside layers_arrange() into
a new function, output_update_usable_area().  The new function currently
does exactly what layers_arrange() used to, but will be expanded in a
later commit.

Add output_update_all_usable_areas(), which is the same as calling
output_update_usable_area() for each output, but only calls
desktop_arrange_all_views() once.

Rebased and slightly modified by @Consolatis
2023-01-06 14:51:46 +01:00
Johan Malm
af56b68041 theme: support theme setting override
...by reading <config-dir>/themerc-override where <config-dir> is normally
$HOME/.config/labwc can be other locations as described in labwc-config(5)
and can also be specified by the command line option -C.

The reason for supporting theme override is to give users more fine-
grained control of settings without making local copies and modifying
themes.
2023-01-03 21:21:21 +00:00