]> git.mdlowis.com Git - proto/labwc.git/log
proto/labwc.git
2 years agoaction: gracefully handle argument without key
Johan Malm [Tue, 25 Apr 2023 20:28:47 +0000 (21:28 +0100)]
action: gracefully handle argument without key

Fixes: issue #894
2 years agocommon/parse-bool.c: make parse_bool() generic
Johan Malm [Sun, 26 Mar 2023 21:34:44 +0000 (22:34 +0100)]
common/parse-bool.c: make parse_bool() generic

...to avoid multiple versions of a boolean-parser.

- Optionally take a default value
- Return -1 on error
- Rename get-bool.c to parse-bool.c

2 years agoaction: add get_arg_value_{str,bool} to simplify multi-arg handling
Johan Malm [Sun, 26 Mar 2023 21:19:47 +0000 (22:19 +0100)]
action: add get_arg_value_{str,bool} to simplify multi-arg handling

2 years agoaction: make action_arg_add_bool() static
Johan Malm [Sun, 26 Mar 2023 21:01:17 +0000 (22:01 +0100)]
action: make action_arg_add_bool() static

2 years agoAdd Polish translation
Marcin Puc [Mon, 24 Apr 2023 13:19:06 +0000 (15:19 +0200)]
Add Polish translation

2 years agoosd: set field width to ellipsize
Johan Malm [Fri, 21 Apr 2023 15:26:44 +0000 (16:26 +0100)]
osd: set field width to ellipsize

2 years agoconfig: move cycle_* bools to window_switcher struct
Johan Malm [Thu, 20 Apr 2023 21:31:26 +0000 (22:31 +0100)]
config: move cycle_* bools to window_switcher struct

2 years agoconfig: support window switcher field definitions
Johan Malm [Wed, 19 Apr 2023 13:44:41 +0000 (14:44 +0100)]
config: support window switcher field definitions

<windowSwitcher>
  <fields>
    <field content="type" width="25%" />
    <field content="app_id" width="25%" />
    <field content="title" width="50%" />
  </fields>
</windowSwitcher>

Relates to issues #852 #855 #879

2 years agoconfig: make <windowSwitcher> a toplevel element
Johan Malm [Wed, 19 Apr 2023 13:34:41 +0000 (14:34 +0100)]
config: make <windowSwitcher> a toplevel element

...rather than a child of <core>

2 years agoxwayland: validate PID before activating unmanaged surface
Johan Malm [Wed, 19 Apr 2023 19:40:40 +0000 (20:40 +0100)]
xwayland: validate PID before activating unmanaged surface

Check that an unmanaged surface trying to grab focus is actually a child
of the topmost mapped view.

2 years agoxwayland: handle unmanaged activate requests
Johan Malm [Wed, 19 Apr 2023 09:14:51 +0000 (10:14 +0100)]
xwayland: handle unmanaged activate requests

2 years agoxwayland: handle unmanaged override-redirect requests
Johan Malm [Mon, 17 Apr 2023 16:05:13 +0000 (17:05 +0100)]
xwayland: handle unmanaged override-redirect requests

Fixes: issue #874
2 years agoxwayland: split out xwayland_view constructor
Johan Malm [Mon, 17 Apr 2023 16:02:11 +0000 (17:02 +0100)]
xwayland: split out xwayland_view constructor

...and make it public in preparation for supporting override-redirect
requests from unmanaged xwayland surfaces.

2 years agopo: clean up language files
Flrian [Mon, 17 Apr 2023 14:58:24 +0000 (16:58 +0200)]
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

2 years agoUpdate es.po
umksan [Sun, 16 Apr 2023 16:07:18 +0000 (13:07 -0300)]
Update es.po

Small grammatical error

2 years agoAdd Indonesia translation
May Mantari [Fri, 14 Apr 2023 14:01:22 +0000 (21:01 +0700)]
Add Indonesia translation

2 years agoAdd Russian translation
Sunderland93 [Fri, 14 Apr 2023 11:25:40 +0000 (15:25 +0400)]
Add Russian translation

2 years agosrc/cursor.c: handle pointer constraint position hint
Jean-Luc Mackail [Wed, 12 Apr 2023 06:42:32 +0000 (16:42 +1000)]
src/cursor.c: handle pointer constraint position hint

Now cursor hints are respected once cursor movement occurs
after unlocking the pointer.

Fixes Overwatch 2 failing to center the mouse pointer when
opening the communication wheel in-game.

Fixes #872

2 years agoSupport ext-session-lock protocol
Johan Malm [Thu, 30 Mar 2023 21:19:05 +0000 (22:19 +0100)]
Support ext-session-lock protocol

2 years agoREADME.md: simplify configuration section
Johan Malm [Sat, 1 Apr 2023 21:19:58 +0000 (22:19 +0100)]
README.md: simplify configuration section

2 years agoview: Add view_move_to_front/back().
John Lindgren [Sat, 1 Apr 2023 18:06:52 +0000 (14:06 -0400)]
view: Add view_move_to_front/back().

This avoids calling view->impl functions from cursor.c and desktop.c.

v2: Add an explicit recursion guard in cursor_update_focus().

2 years agoserver: add wlr_backend_autocreate() trouble-shooting message
Johan Malm [Sat, 1 Apr 2023 18:46:41 +0000 (19:46 +0100)]
server: add wlr_backend_autocreate() trouble-shooting message

2 years agosrc/cursor.c: make sure the cursor is visible after startup
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.

2 years agosrc/cursor.c: fix invisible cursor on output loss / restore
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.

This fixes a regression caused by 4dc99e2f3856650f3b61778f015a823cfae978d2.
Thanks to @Flrian for finding the root cause of the issue.

Fixes #820

Reported-by: @Flrian
Tested-by: @Flrian
2 years agoconfig: support scroll-factor
Johan Malm [Sat, 25 Mar 2023 15:57:47 +0000 (15:57 +0000)]
config: support scroll-factor

Fixes: issue #846
2 years agoImplement action "Lower"
Juliusz Chroboczek [Mon, 20 Mar 2023 02:31:49 +0000 (03:31 +0100)]
Implement action "Lower"

2 years agodesktop: move scene-tree node in move-to-back
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

2 years agofollowMouse: allow focus switching via A-Tab
Consolatis [Sun, 26 Mar 2023 04:14:48 +0000 (06:14 +0200)]
followMouse: allow focus switching via A-Tab

Fixes a regression caused by the recent enhancement of followMouse behavior.

Fixes: #849
Reported-by: mitigate via IRC
2 years agoaction: support SendToDesktop 'follow' option
Johan Malm [Sun, 26 Mar 2023 09:57:53 +0000 (10:57 +0100)]
action: support SendToDesktop 'follow' option

Make follow 'true' by default as per Openbox 3.6 specification.
Note: this is an interface change.

Fixes: issue #841
2 years agoMove get_bool() to src/common/
Johan Malm [Sun, 26 Mar 2023 09:56:10 +0000 (10:56 +0100)]
Move get_bool() to src/common/

...in preparation for sharing it more widely

2 years agoDecorations: always default to client side decorations
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.

2 years agoDecorations: handle results of kde-server-decoration negotiations
Johan Malm [Wed, 22 Mar 2023 19:56:59 +0000 (19:56 +0000)]
Decorations: handle results of kde-server-decoration negotiations

2 years agoDecorations: minor refactoring, no logical changes intended
Consolatis [Thu, 23 Mar 2023 19:55:14 +0000 (20:55 +0100)]
Decorations: minor refactoring, no logical changes intended

2 years agoDecorations: respect earlier client side decoration negotion result
Consolatis [Wed, 22 Mar 2023 18:53:17 +0000 (19:53 +0100)]
Decorations: respect earlier client side decoration negotion result

Before this patch, it was impossible to differentiate between negotiations
resulting in client side decorations and no negotiations at all.

By adding an enum we are now able to differentiate between the two states.

2 years agoDecorations: prepare for the KDE protocol implementation
Consolatis [Mon, 20 Mar 2023 22:00:36 +0000 (23:00 +0100)]
Decorations: prepare for the KDE protocol implementation

2 years agoDecorations: respect earlier decoration negotiation results
Consolatis [Mon, 20 Mar 2023 21:36:35 +0000 (22:36 +0100)]
Decorations: respect earlier decoration negotiation results

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.

Fixes #297
Fixes #831

2 years agocursor: fix focus.followMouse glitches
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

Written-by: @Consolatis
Reported-by: @jech
2 years agobuild: bump version to 0.6.2
Johan Malm [Mon, 20 Mar 2023 20:17:19 +0000 (20:17 +0000)]
build: bump version to 0.6.2

2 years agoNEWS.md: add notes on 0.6.2
Johan Malm [Sat, 11 Mar 2023 19:58:42 +0000 (19:58 +0000)]
NEWS.md: add notes on 0.6.2

2 years agoREADME.md: update gaming section on cursor confinement
Johan Malm [Mon, 20 Mar 2023 19:47:48 +0000 (19:47 +0000)]
README.md: update gaming section on cursor confinement

2 years agoconfig: enable windowSwitcher preview by default
Johan Malm [Sat, 11 Mar 2023 21:29:17 +0000 (21:29 +0000)]
config: enable windowSwitcher preview by default

2 years agoconfig: change <cycleView*> to <windowSwitcher*>
Johan Malm [Sat, 11 Mar 2023 22:15:32 +0000 (22:15 +0000)]
config: change <cycleView*> to <windowSwitcher*>

Use `<windowSwitcher show="yes" preview="no" outlines="yes" />`
instead of

- `<cycleViewOSD>yes</cycleViewOSD>`
- `<cycleViewOutlines>yes</cycleViewOutlines>`
- `<cycleViewPreview>no</cycleViewPreview>`

2 years agoMerge pull request #800 from Consolatis/ci/web_deploy
Johan Malm [Sat, 18 Mar 2023 21:20:50 +0000 (21:20 +0000)]
Merge pull request #800 from Consolatis/ci/web_deploy

CI: automatically rebuild labwc.github.io

2 years agoprotocols: remove redundant wlr-output-management
Johan Malm [Sat, 11 Mar 2023 19:28:32 +0000 (19:28 +0000)]
protocols: remove redundant wlr-output-management

2 years agosrc/config/rcxml.c: reset default values on Reconfigure
Consolatis [Wed, 8 Mar 2023 22:53:34 +0000 (23:53 +0100)]
src/config/rcxml.c: reset default values on Reconfigure

Reported-by: <umk3> via IRC
3 years agoosd: add config option to disable osd
Flrian [Wed, 8 Mar 2023 14:26:49 +0000 (15:26 +0100)]
osd: add config option to disable osd

3 years agoPrevent rare crash due to layering move / resize / menu operations
Consolatis [Tue, 7 Mar 2023 21:59:56 +0000 (22:59 +0100)]
Prevent rare crash due to layering move / resize / menu operations

Fixes #817

Reported-by: @kode54
3 years agosrc/keyboard.c: Fix wrong argument parsing
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.

3 years agoPrevent cursor based region-snapping when starting a move with A-Left
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.

Fixes #761

3 years agoAdd FocusOutput action
Consolatis [Sun, 5 Mar 2023 16:16:23 +0000 (17:16 +0100)]
Add FocusOutput action

Fixes #806

Suggested-by: @EysseW
Tested-by: @EysseW
3 years agosrc/workspaces.c: update cursor focus
Consolatis [Sun, 5 Mar 2023 15:34:41 +0000 (16:34 +0100)]
src/workspaces.c: update cursor focus

Fixes #807

3 years agoxdg: Reduce log priority of timeout message
John Lindgren [Sun, 5 Mar 2023 07:03:41 +0000 (02:03 -0500)]
xdg: Reduce log priority of timeout message

3 years agoxdg: Detect pending configure request timeouts
John Lindgren [Tue, 28 Feb 2023 16:30:42 +0000 (11:30 -0500)]
xdg: Detect pending configure request timeouts

3 years agoxdg: Fix visual glitch when resizing xfce4-terminal from left edge
John Lindgren [Mon, 27 Feb 2023 01:25:05 +0000 (20:25 -0500)]
xdg: Fix visual glitch when resizing xfce4-terminal from left edge

3 years agoview: Anchor right/bottom edge only when resizing via top/left edge
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.

3 years agoview: Comment updates
John Lindgren [Sun, 5 Mar 2023 06:58:24 +0000 (01:58 -0500)]
view: Comment updates

3 years agoview: Add view_set_output()
John Lindgren [Tue, 28 Feb 2023 16:46:48 +0000 (11:46 -0500)]
view: Add view_set_output()

3 years agoview: Add documentation for view->output
John Lindgren [Tue, 21 Feb 2023 13:14:11 +0000 (08:14 -0500)]
view: Add documentation for view->output

3 years agoview: Eliminate view_output() and use view->output directly
John Lindgren [Mon, 20 Feb 2023 21:35:23 +0000 (16:35 -0500)]
view: Eliminate view_output() and use view->output directly

3 years agoview: Make view_apply_special_geometry() return void
John Lindgren [Mon, 20 Feb 2023 21:29:41 +0000 (16:29 -0500)]
view: Make view_apply_special_geometry() return void

This makes the conditions for calling it explicit and more obvious.

3 years agoview: Set output prior to view_apply_tiled_geometry()
John Lindgren [Mon, 20 Feb 2023 21:14:27 +0000 (16:14 -0500)]
view: Set output prior to view_apply_tiled_geometry()

3 years agoview: Set view->output prior to calling view_center()
John Lindgren [Mon, 20 Feb 2023 21:23:53 +0000 (16:23 -0500)]
view: Set view->output prior to calling view_center()

3 years agoxdg: Set view->output prior to view_set_fullscreen()
John Lindgren [Mon, 20 Feb 2023 18:36:15 +0000 (13:36 -0500)]
xdg: Set view->output prior to view_set_fullscreen()

3 years agoxdg,xwayland: Set initial output for views
John Lindgren [Fri, 3 Feb 2023 19:45:04 +0000 (14:45 -0500)]
xdg,xwayland: Set initial output for views

3 years agoview: Attempt to keep non-floating views on the same output
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

3 years agoAdd ToggleKeybinds action
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.

Fixes #738
Fixes #810

3 years agoxdg/xwayland: remove unnecessary assert()s
Johan Malm [Fri, 24 Feb 2023 21:50:16 +0000 (21:50 +0000)]
xdg/xwayland: remove unnecessary assert()s

3 years agoMove common xdg/xwayland handle_destroy() code to view_destroy()
Johan Malm [Fri, 24 Feb 2023 21:45:03 +0000 (21:45 +0000)]
Move common xdg/xwayland handle_destroy() code to view_destroy()

3 years agoview: make request_activate listener xwayland only
Johan Malm [Fri, 24 Feb 2023 21:27:11 +0000 (21:27 +0000)]
view: make request_activate listener xwayland only

3 years agosrc/xdg.c: remove all listeners in handle_destroy()
Johan Malm [Fri, 24 Feb 2023 21:15:11 +0000 (21:15 +0000)]
src/xdg.c: remove all listeners in handle_destroy()

3 years agosrc/cursor.c: add cursor lock confinement
Consolatis [Fri, 24 Feb 2023 09:20:14 +0000 (10:20 +0100)]
src/cursor.c: add cursor lock confinement

3 years agosrc/cursor.c: Implement cursor constraints
Ph42oN [Wed, 12 Oct 2022 21:35:25 +0000 (00:35 +0300)]
src/cursor.c: Implement cursor constraints

3 years agoxwayland.c: prefix view_impl functions with xwayland_view_
Johan Malm [Mon, 6 Feb 2023 20:01:18 +0000 (20:01 +0000)]
xwayland.c: prefix view_impl functions with xwayland_view_

...to make it consistent with xdg.c

3 years agoview: add move_to_front to `struct view_impl`
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

3 years agoCI: Add hwdata to FreeBSD build requirements
Consolatis [Fri, 24 Feb 2023 13:46:24 +0000 (14:46 +0100)]
CI: Add hwdata to FreeBSD build requirements

3 years agoCI: automatically rebuild labwc.github.io
Consolatis [Fri, 24 Feb 2023 11:56:27 +0000 (12:56 +0100)]
CI: automatically rebuild labwc.github.io

3 years agopo: Add Georgian translation
NorwayFun [Wed, 22 Feb 2023 08:45:41 +0000 (09:45 +0100)]
po: Add Georgian translation

3 years agopo: Add Georgian translation
NorwayFun [Wed, 22 Feb 2023 08:45:22 +0000 (09:45 +0100)]
po: Add Georgian translation

3 years agooutput: Add output_nearest_to()
John Lindgren [Fri, 3 Feb 2023 20:22:54 +0000 (15:22 -0500)]
output: Add output_nearest_to()

Reimplement output_from_cursor_coords() as output_nearest_to_cursor().

3 years agoxdg: Use wlr_xdg_surface_get_geometry() to get size
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.

3 years agoxdg: Remove unused #include
John Lindgren [Mon, 20 Feb 2023 18:26:01 +0000 (13:26 -0500)]
xdg: Remove unused #include

3 years agoREADME.md: suggest using nested gamescope for gaming
Consolatis [Fri, 27 Jan 2023 05:52:42 +0000 (06:52 +0100)]
README.md: suggest using nested gamescope for gaming

Fixes #690

3 years agoview: Rediscover output in view_adjust_for_layout_change()
John Lindgren [Mon, 20 Feb 2023 17:53:00 +0000 (12:53 -0500)]
view: Rediscover output in view_adjust_for_layout_change()

3 years agoview: Handle fullscreen also in view_apply_special_geometry()
John Lindgren [Wed, 15 Feb 2023 18:46:29 +0000 (13:46 -0500)]
view: Handle fullscreen also in view_apply_special_geometry()

3 years agoview: Factor out set_fullscreen() helper from view_set_fullscreen()
John Lindgren [Thu, 16 Feb 2023 21:30:38 +0000 (16:30 -0500)]
view: Factor out set_fullscreen() helper from view_set_fullscreen()

3 years agoxdg: Save natural_geometry.x/y with initially maximized view
John Lindgren [Sat, 18 Feb 2023 05:55:42 +0000 (00:55 -0500)]
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.

3 years agoxdg: Use view_center() for parent-relative centering
John Lindgren [Sun, 19 Feb 2023 17:42:21 +0000 (12:42 -0500)]
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

3 years agoview: Align large views to usable area
John Lindgren [Sun, 19 Feb 2023 14:56:58 +0000 (09:56 -0500)]
view: Align large views to usable area

3 years agoview: Add optional output parameter to view_center()
John Lindgren [Sat, 18 Feb 2023 05:23:19 +0000 (00:23 -0500)]
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.

3 years agolabwc-actions(5): update action format
Flrian [Sun, 19 Feb 2023 11:36:32 +0000 (12:36 +0100)]
labwc-actions(5): update action format

3 years agoRevert "xwayland: Fix size issue when starting VLC fullscreen"
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.

This reverts commit 09599861ac726b142a79ed60035809f04c151457.

3 years agoview: Tidy up view->output/view->fullscreen redundancy
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

3 years agooutput: Add output_is_usable() helper
John Lindgren [Thu, 16 Feb 2023 17:24:27 +0000 (12:24 -0500)]
output: Add output_is_usable() helper

3 years agoregion: Add output pointer to struct region
John Lindgren [Thu, 16 Feb 2023 17:01:23 +0000 (12:01 -0500)]
region: Add output pointer to struct region

3 years agoregion: Add #include to make header dependency explicit
John Lindgren [Thu, 16 Feb 2023 16:49:23 +0000 (11:49 -0500)]
region: Add #include to make header dependency explicit

3 years agoview: Add view_evacuate_region() helper
John Lindgren [Thu, 16 Feb 2023 16:54:18 +0000 (11:54 -0500)]
view: Add view_evacuate_region() helper

v2: Modify asserts as suggested by Consolatis

3 years agoview: Unify view_move()/view_move_resize()
John Lindgren [Thu, 9 Feb 2023 06:07:07 +0000 (01:07 -0500)]
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.

3 years agodesktop: Avoid centering views without initial geometry
John Lindgren [Wed, 15 Feb 2023 17:52:57 +0000 (12:52 -0500)]
desktop: Avoid centering views without initial geometry

3 years agossd: Fix segfault when disabling output with fullscreen view
John Lindgren [Wed, 15 Feb 2023 07:32:18 +0000 (02:32 -0500)]
ssd: Fix segfault when disabling output with fullscreen view

wlr_output_layout_get() returns NULL for disabled outputs.

Backtrace (abbreviated):

     #0  lab_wlr_output_layout_layout_coords at ../src/ssd/ssd_extents.c:33
     #1  ssd_extents_update at ../src/ssd/ssd_extents.c:133
     #2  ssd_extents_create at ../src/ssd/ssd_extents.c:95
     #3  ssd_create at ../src/ssd/ssd.c:161
     #4  decorate.part.0.lto_priv.0 at ../src/view.c:637
     #5  decorate at ../src/view.c:636
     #6  view_set_fullscreen at ../src/view.c:716
     #7  view_adjust_for_layout_change ../src/view.c:745
     #8  desktop_arrange_all_views ../src/desktop.c:52
     #9  output_update_all_usable_areas at ../src/output.c:495
     #10 output_update_for_layout_change at ../src/output.c:263
     #11 do_output_layout_change at ../src/output.c:423
     #12 do_output_layout_change at ../src/cursor.c:267
     #13 output_config_apply at ../src/output.c:334
     #14 handle_output_manager_apply at ../src/output.c:354

3 years agosrc/xdg.c: sync move with pending resize
Consolatis [Sun, 12 Feb 2023 06:44:01 +0000 (07:44 +0100)]
src/xdg.c: sync move with pending resize

Before this patch, configuring a surface with a new size,
immediately followed up by one or more view_move() calls
would move the surface to the new coordinates immediately
without waiting for the resize. This caused visual glitches
when for example dragging a maximized window: the position
would change but the size was still that of a maximized
window.

This patch fixes that by just ignoring view_move() requests
(but still updating view->pending) if there is a configure
request pending. Once the client commit comes in the new
size will be applied as usual.