Commit graph

1608 commits

Author SHA1 Message Date
Consolatis
a4fb5b093b 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.

Fixes #761
2023-03-07 20:55:35 +00:00
Consolatis
a0b5a80ce1 Add FocusOutput action
Fixes #806

Suggested-by: @EysseW
Tested-by: @EysseW
2023-03-06 21:58:11 +00:00
Consolatis
037dace5bc src/workspaces.c: update cursor focus
Fixes #807
2023-03-05 21:07:58 +00:00
John Lindgren
1824fc4b9a xdg: Reduce log priority of timeout message 2023-03-05 08:46:55 +00:00
John Lindgren
ea09fc3850 xdg: Detect pending configure request timeouts 2023-03-05 08:46:55 +00:00
John Lindgren
31ec8f050c xdg: Fix visual glitch when resizing xfce4-terminal from left edge 2023-03-05 08:46:55 +00:00
John Lindgren
0b34b9f69f 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.
2023-03-05 08:46:55 +00:00
John Lindgren
9f00087a82 view: Comment updates 2023-03-05 08:44:03 +00:00
John Lindgren
331f62f662 view: Add view_set_output() 2023-03-05 08:44:03 +00:00
John Lindgren
55c6280322 view: Add documentation for view->output 2023-03-05 08:44:03 +00:00
John Lindgren
60fbb44f6a view: Eliminate view_output() and use view->output directly 2023-03-05 08:44:03 +00:00
John Lindgren
799f81ae05 view: Make view_apply_special_geometry() return void
This makes the conditions for calling it explicit and more obvious.
2023-03-05 08:44:03 +00:00
John Lindgren
0cc6ea2d8b view: Set output prior to view_apply_tiled_geometry() 2023-03-05 08:44:03 +00:00
John Lindgren
a9cbbe1e41 view: Set view->output prior to calling view_center() 2023-03-05 08:44:03 +00:00
John Lindgren
bdbbbb2e62 xdg: Set view->output prior to view_set_fullscreen() 2023-03-05 08:44:03 +00:00
John Lindgren
ed19bc4f9e xdg,xwayland: Set initial output for views 2023-03-05 08:44:03 +00:00
John Lindgren
64bea4f511 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
2023-03-05 08:44:03 +00:00
Consolatis
c33a404dc1 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.

Fixes #738
Fixes #810
2023-03-04 13:24:59 +00:00
Johan Malm
d571b0b28a xdg/xwayland: remove unnecessary assert()s 2023-02-24 22:56:00 +01:00
Johan Malm
6819dcee78 Move common xdg/xwayland handle_destroy() code to view_destroy() 2023-02-24 22:56:00 +01:00
Johan Malm
ecbe699f94 view: make request_activate listener xwayland only 2023-02-24 22:56:00 +01:00
Johan Malm
665b6503e1 src/xdg.c: remove all listeners in handle_destroy() 2023-02-24 22:56:00 +01:00
Consolatis
22ba7f6744 src/cursor.c: add cursor lock confinement 2023-02-24 21:32:25 +00:00
Ph42oN
c25e2c7a7d src/cursor.c: Implement cursor constraints 2023-02-24 21:32:25 +00:00
Johan Malm
06044799dd xwayland.c: prefix view_impl functions with xwayland_view_
...to make it consistent with xdg.c
2023-02-24 20:42:01 +00:00
Johan Malm
b8ec5a3e2e 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
2023-02-24 20:42:01 +00:00
Consolatis
440372c2da CI: Add hwdata to FreeBSD build requirements 2023-02-24 15:06:44 +01:00
Consolatis
0b68d58e84 CI: automatically rebuild labwc.github.io 2023-02-24 13:53:10 +01:00
NorwayFun
e9d507bbbf po: Add Georgian translation 2023-02-22 11:33:26 +01:00
NorwayFun
e8d06c5b2e po: Add Georgian translation 2023-02-22 11:33:26 +01:00
John Lindgren
976136299d output: Add output_nearest_to()
Reimplement output_from_cursor_coords() as output_nearest_to_cursor().
2023-02-21 08:46:22 +01:00
John Lindgren
84294c9cfb 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.
2023-02-21 08:30:10 +01:00
John Lindgren
2e1c360c71 xdg: Remove unused #include 2023-02-21 08:30:10 +01:00
Consolatis
397a8f4785 README.md: suggest using nested gamescope for gaming
Fixes #690
2023-02-20 18:50:13 +00:00
John Lindgren
f018ca708d view: Rediscover output in view_adjust_for_layout_change() 2023-02-20 13:45:40 -05:00
John Lindgren
d83e99ff66 view: Handle fullscreen also in view_apply_special_geometry() 2023-02-20 13:45:40 -05:00
John Lindgren
1f80cda061 view: Factor out set_fullscreen() helper from view_set_fullscreen() 2023-02-20 13:45:40 -05:00
John Lindgren
c639cdba06 xdg: Save natural_geometry.x/y with initially maximized view
Fixes an issue where, if Thunar was started maximized, it would
un-maximize to the top-left corner rather than the center.
2023-02-20 11:50:12 -05:00
John Lindgren
74bc16910a xdg: Use view_center() for parent-relative centering
- Add optional struct wlr_box* ref argument to view_center()
- Perform margin adjustment within view_center()
- Expose view_output() to fetch parent's output
2023-02-20 11:50:12 -05:00
John Lindgren
612c296d52 view: Align large views to usable area 2023-02-20 11:50:12 -05:00
John Lindgren
5062c5bea3 view: Add optional output parameter to view_center()
Allows centering the view on a specific output without the workaround of
overwriting view->current.x/y.
2023-02-20 11:50:12 -05:00
Flrian
df7c47b8d7 labwc-actions(5): update action format 2023-02-19 12:51:50 +01:00
John Lindgren
913f89b6c4 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.

This reverts commit 09599861ac.
2023-02-18 05:31:22 +01:00
John Lindgren
49c9466039 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
2023-02-17 06:59:39 -05:00
John Lindgren
6efc6a9db4 output: Add output_is_usable() helper 2023-02-17 06:59:39 -05:00
John Lindgren
fe7edf82d9 region: Add output pointer to struct region 2023-02-17 04:47:15 +01:00
John Lindgren
e0388ba8bf region: Add #include to make header dependency explicit 2023-02-17 04:47:15 +01:00
John Lindgren
d2fae39fe3 view: Add view_evacuate_region() helper
v2: Modify asserts as suggested by Consolatis
2023-02-17 04:47:15 +01:00
John Lindgren
0ca6c4c763 view: Unify view_move()/view_move_resize()
view->impl->move() is a specific case of view->impl->configure().
To reduce code duplication, we can use view->impl->configure() for
pure moves (without resize) as well.

xwayland's move() function also possibly contained a race condition
when there was a pending resize, as it used the current surface
width/height rather than the pending width/height. This is fixed.
2023-02-16 05:21:47 +01:00
John Lindgren
859eba1c6b desktop: Avoid centering views without initial geometry 2023-02-15 18:59:26 +00:00