]> git.mdlowis.com Git - proto/labwc.git/log
proto/labwc.git
2 years agoTranslation updates from weblate
Weblate [Thu, 21 Dec 2023 17:59:43 +0000 (18:59 +0100)]
Translation updates from weblate

Co-authored-by: Standreas <standreas@riseup.net>
Co-authored-by: Weblate <noreply@weblate.org>
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/
Translation: Labwc/labwc

2 years agoxwayland: fix issue with panel getting stuck offscreen
John Lindgren [Tue, 28 Nov 2023 05:38:18 +0000 (00:38 -0500)]
xwayland: fix issue with panel getting stuck offscreen

For unknown reasons, XWayland surfaces that are completely offscreen
seem not to generate commit events. In rare cases, this can prevent an
offscreen window from moving onscreen (since we wait for a commit event
that never occurs). As a workaround, move offscreen surfaces
immediately.

This fixes an issue that I can reproduce by having qmpanel displayed on
a (larger) external monitor, then undocking the laptop so that qmpanel
requests a simultaneous move+resize to the (smaller) laptop display.

2 years agomenu: move ToggleOmnipresent to workspaces
Johan Malm [Tue, 19 Dec 2023 21:24:55 +0000 (21:24 +0000)]
menu: move ToggleOmnipresent to workspaces

...and rename it to "Always on Visible Workspace"

Issue: #1316

2 years agotheme: move more button fallback logic to theme.c
Johan Malm [Mon, 18 Dec 2023 20:42:36 +0000 (20:42 +0000)]
theme: move more button fallback logic to theme.c

...and simplify button_xbm_load() by splitting it into one function that
loads an xbm file and another that creates an icon from a builtin
bitmap.

2 years agotheme: create hover button fallbacks
Consolatis [Sun, 17 Dec 2023 01:16:49 +0000 (02:16 +0100)]
theme: create hover button fallbacks

...by copying the non-hover variant and adding a transparent overlay.

Co-authored-by: @johanmalm
2 years agotheme: use non-hover button variants as fallback
John Lindgren [Sat, 16 Dec 2023 14:56:45 +0000 (09:56 -0500)]
theme: use non-hover button variants as fallback

Some themes don't have hover variants for button pixmaps.
It looks better visually to use the non-hover variants as fallbacks
rather than the built-in 6x6 pixmaps.

2 years agoseat: do not update active_view on layer-shell keyboard focus
Johan Malm [Tue, 19 Dec 2023 17:45:43 +0000 (17:45 +0000)]
seat: do not update active_view on layer-shell keyboard focus

...because layer-shell clients are not views and we want to be able to
use foreign-toplevel protocol on the active view even if a client such as
a panel has taken keyboard focus.

Written-by: @Consolatis
Fixes: #1336
2 years agos/focused_view/active_view/
Johan Malm [Tue, 19 Dec 2023 17:45:11 +0000 (17:45 +0000)]
s/focused_view/active_view/

2 years agooutput: do not call wlr_scene_output_layout_add_output() twice
John Lindgren [Wed, 13 Dec 2023 22:37:14 +0000 (17:37 -0500)]
output: do not call wlr_scene_output_layout_add_output() twice

Fixes an assertion failure that occurred if reconfiguring outputs after
an output had been disabled using wlopm --off.

Fixes: #1303
2 years agodocs: add png|svg icon descriptions for themes, fix minor typo
01micko [Sat, 16 Dec 2023 05:42:34 +0000 (15:42 +1000)]
docs: add png|svg icon descriptions for themes, fix minor typo

2 years agofix: fall-through to default cursor in cursor_get_from_edge()
Andrew J. Hesford [Sat, 16 Dec 2023 02:21:06 +0000 (21:21 -0500)]
fix: fall-through to default cursor in cursor_get_from_edge()

When assertions are disabled, providing an unexpected input to
cursor_get_from_edge will cause the non-void function to terminate
without a return value. This may be effectively unreachable in practice.
However, returning a default cursor as a fall-through case will both
silence a compiler warning and prevent catastrophy should the function
ever be called with a permitted value.

2 years agoCONTRIBUTING.md: update deprecated meson command
Florian [Sat, 16 Dec 2023 15:35:36 +0000 (16:35 +0100)]
CONTRIBUTING.md: update deprecated meson command

2 years agolabwc.pot: update for new OmniPresent menu
01micko [Tue, 12 Dec 2023 06:16:36 +0000 (16:16 +1000)]
labwc.pot: update for new OmniPresent menu

closes #1311

2 years agodocs/labwc-theme.5.scd: made text fit in max 80-column wide lines
Tomi Ollila [Mon, 11 Dec 2023 21:12:07 +0000 (23:12 +0200)]
docs/labwc-theme.5.scd: made text fit in max 80-column wide lines

For general consistency and better readability as source.

2 years agoAdd theme option to configure boxes from workspace OSD
kyak [Mon, 11 Dec 2023 09:41:33 +0000 (12:41 +0300)]
Add theme option to configure boxes from workspace OSD

This allows to configure width and height of "boxes" displayed in the
workspace OSD. A setting of `0` disables the boxes.

2 years agosrc/output.c: fix strncpy warning
kyak [Mon, 11 Dec 2023 09:33:06 +0000 (12:33 +0300)]
src/output.c: fix strncpy warning

Fixes #1307

2 years agotheme: partially revert c79b8ba
Johan Malm [Sat, 9 Dec 2023 19:49:23 +0000 (19:49 +0000)]
theme: partially revert c79b8ba

...so that svg and png icons only support the max_toggled_hover format.

There is no need to support max_hover_toggled because there are no
backward compatibility considerations as Openbox does not handle png and
svg icons.

2 years agotheme: use max_toggled_hover.xbm
Johan Malm [Sat, 9 Dec 2023 19:37:35 +0000 (19:37 +0000)]
theme: use max_toggled_hover.xbm

...and treat max_hover_toggled.xbm as an alternative name supported for
compatibility reasons.

Use the following button filename schema: "BUTTON [TOGGLED] [STATE]"
with the words separted by underscore and with the following meaning:
  - BUTTON can be one of 'max', 'iconify', 'close', 'menu'
  - TOGGLED is either 'toggled' or nothing
  - STATE is 'hover' or nothing.

This is consistent with the openbox.org wiki and it is believed that this
is how the vast majority of extant openbox themes out there are written.

But please be aware that it is actually different to vanilla Openbox which
uses: "BUTTON [STATE] [TOGGLED]" following a commit in 2014 which broke
themes and led to some distros patching Openbox:
https://github.com/danakj/openbox/commit/35e92e4c2a45b28d5c2c9b44b64aeb4222098c94

Arch Linux and Debian patch Openbox to keep the old syntax (the one that
this commit aligns us with).
https://gitlab.archlinux.org/archlinux/packaging/packages/openbox/-/blob/main/debian-887908.patch?ref_type=heads

2 years agotheme: make button array definition easier to read
Johan Malm [Sat, 9 Dec 2023 19:20:54 +0000 (19:20 +0000)]
theme: make button array definition easier to read

No functional change intended.

2 years agoImplement key binds to control virtual outputs (#1287)
kyak [Sat, 9 Dec 2023 09:01:11 +0000 (12:01 +0300)]
Implement key binds to control virtual outputs (#1287)

Add actions `VirtualOutputAdd` and `VirtualOutputRemove`

2 years agoview: continue move-to-edge behavior to adjacent outputs
Andrew J. Hesford [Wed, 6 Dec 2023 01:05:23 +0000 (20:05 -0500)]
view: continue move-to-edge behavior to adjacent outputs

2 years agolabwc-config(5): update <margin> description
Johan Malm [Fri, 8 Dec 2023 22:34:18 +0000 (22:34 +0000)]
labwc-config(5): update <margin> description

...to include that it is a workaround which is usually not required.

2 years agoPartially revert a bit more of ddc9047
Johan Malm [Fri, 8 Dec 2023 22:08:46 +0000 (22:08 +0000)]
Partially revert a bit more of ddc9047

...to enable re-size of nested labwc instances

2 years agoPartially revert ddc9047
Johan Malm [Tue, 5 Dec 2023 16:19:04 +0000 (16:19 +0000)]
Partially revert ddc9047

...to just call wlr_scene_output_commit() as was previously the case and
thus avoid freezing screens reported by a number of users.

Fixes: #1273
2 years agosrc/ssd: refactor button hover and maximize toggle
Consolatis [Wed, 6 Dec 2023 21:07:06 +0000 (22:07 +0100)]
src/ssd: refactor button hover and maximize toggle

2 years agosrc/layers.c: move popups from the background layer to the top layer
Consolatis [Thu, 7 Dec 2023 10:05:49 +0000 (11:05 +0100)]
src/layers.c: move popups from the background layer to the top layer

Previously we would only do that for the bottom layer.

Fixes #1293

Reported-by: @spl237
2 years agofeat: implement <font place="InactiveWindow"> (ref scope: 2.4.7) (#1292)
Ludgie [Thu, 7 Dec 2023 08:28:27 +0000 (09:28 +0100)]
feat: implement <font place="InactiveWindow"> (ref scope: 2.4.7) (#1292)

* feat: implement <font place="InactiveWindow"> (ref scope: 2.4.7)
* docs: add inactivewindow

2 years agosrc/layers.c: calculate usable_area before positioning clients
Consolatis [Wed, 6 Dec 2023 13:24:17 +0000 (14:24 +0100)]
src/layers.c: calculate usable_area before positioning clients

This ensures that the usable area is completely calculated
before non exclusive-zone clients are positioned / resized.

Fixes #1285
Reported-by: @spl237
2 years agotheme: fix icon bug
Johan Malm [Wed, 6 Dec 2023 21:55:31 +0000 (21:55 +0000)]
theme: fix icon bug

Do not carry over previous alt_filename for icons that don't have one.

2 years agoSupport hover icons in titlebar (#1280)
Simon Long [Wed, 6 Dec 2023 20:33:26 +0000 (20:33 +0000)]
Support hover icons in titlebar (#1280)

Allow both max_toggled_hover and max_hover_toggled names for icons

2 years agoImplement cursor-shape-v1 protocol
Consus [Sat, 2 Dec 2023 14:56:32 +0000 (17:56 +0300)]
Implement cursor-shape-v1 protocol

This protocol allows Wayland clients to request a buffer for a cursor
shape from a compositor.

Tested with foot.

2 years agoFix a typo
Consus [Tue, 5 Dec 2023 08:56:10 +0000 (11:56 +0300)]
Fix a typo

2 years agoUnwrap #define value
Consus [Sun, 3 Dec 2023 21:57:31 +0000 (00:57 +0300)]
Unwrap #define value

In the name of constistency do not wrap the value in parenthesis if the
value is a single number.

2 years agoImplement fractional-scale-v1 protocol
Consus [Sat, 2 Dec 2023 14:53:12 +0000 (17:53 +0300)]
Implement fractional-scale-v1 protocol

This protocol allows Wayland clients to properly scale on outputs with
fractional scale factor.

Tested with foot and transmission-qt (Qt6).

2 years agochase (dnd): refactor to use wlroot's scene_drag_icon
nullableVoidPtr [Sun, 3 Dec 2023 08:38:52 +0000 (16:38 +0800)]
chase (dnd): refactor to use wlroot's scene_drag_icon

2 years agochase: use wlroots tree node getters
nullableVoidPtr [Sun, 3 Dec 2023 08:36:20 +0000 (16:36 +0800)]
chase: use wlroots tree node getters

2 years agosrc/output.c: ensure we don't carry around a stale output pointer
Consolatis [Sat, 2 Dec 2023 14:05:26 +0000 (15:05 +0100)]
src/output.c: ensure we don't carry around a stale output pointer

Prevent carrying around the wlr_output->data pointer when
destroying an output. The set_gamma handler may be called
during the destruction of a wlr_output after our own
destroy handler has already been called. This patch resets
the wlr_output->data pointer in our destroy handler and
adds a check in the set_gamma handler to verify the output
is actually valid.

Fixes #1270

Reported-by: @Flrian
2 years agochase: handle gamma-control-v1 set_gamma events
Johan Malm [Fri, 1 Dec 2023 17:07:05 +0000 (17:07 +0000)]
chase: handle gamma-control-v1 set_gamma events

References:
- https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4046
- https://github.com/swaywm/sway/pull/7494/files

Fixes: #1262
2 years agoAdd ResizeTo action
Johan Malm [Fri, 1 Dec 2023 17:03:58 +0000 (17:03 +0000)]
Add ResizeTo action

Fixes: #1261
2 years agokeyboard: allow back by arrow-up or arrow-left in cycle view OSD
Jens Peters [Thu, 30 Nov 2023 22:25:13 +0000 (23:25 +0100)]
keyboard: allow back by arrow-up or arrow-left in cycle view OSD

All non-modifier keys cycle forward which makes sense for
e.g. tab but is not very intuitive for arrow-up or arrow-left.
Handle those keys separately to provide a feel of navigation
by arrow keys in the cycle view OSD.

2 years agokeyboard: break up handle_compositor_keybindings()
John Lindgren [Wed, 15 Nov 2023 16:33:55 +0000 (11:33 -0500)]
keyboard: break up handle_compositor_keybindings()

This function has grown quite large over time. Breaking out various
smaller functions makes the logic easier to follow.

No functional change intended, but there is a minor logical change:

- Due to factoring out match_keybinding(), each keypress can only
  match a single keybinding now. Previously, it was theoretically
  possible for a single keypress to map to multiple keysyms which could
  each match a different keybinding.

2 years agoxwayland: treat X11 panel views as if fixedPosition rule is set
John Lindgren [Mon, 27 Nov 2023 22:11:29 +0000 (17:11 -0500)]
xwayland: treat X11 panel views as if fixedPosition rule is set

2 years agooutput,xwayland: Add support for _NET_WM_STRUT_PARTIAL
John Lindgren [Tue, 22 Nov 2022 10:11:50 +0000 (05:11 -0500)]
output,xwayland: Add support for _NET_WM_STRUT_PARTIAL

Account for space taken up by XWayland panels (as indicated by the
_NET_WM_STRUT_PARTIAL property) in the usable_area calculation.

This makes it possible to use labwc in a "transitional" setup, where it
replaces the X11 window manager and compositor, but most other parts of
a existing X11 desktop environment can still be used via XWayland.

(Some remaining drawbacks of such a setup would be the lack of desktop
icons, and native Wayland clients not showing up in X11-based taskbars.)

2 years agouse the GTK+ 3 notebook header color as the default active title color
Dima Krasner [Tue, 28 Nov 2023 06:22:54 +0000 (08:22 +0200)]
use the GTK+ 3 notebook header color as the default active title color

2 years agoAdd omnipresent flag for views
Brandon Nason [Sat, 25 Nov 2023 23:54:36 +0000 (17:54 -0600)]
Add omnipresent flag for views

2 years agoxwayland: set _NET_WORKAREA property based on usable area
John Lindgren [Tue, 24 Oct 2023 17:49:15 +0000 (13:49 -0400)]
xwayland: set _NET_WORKAREA property based on usable area

XWayland clients use the _NET_WORKAREA root window property to determine
how much of the screen is not covered by panels/docks. The property is
used for example by Qt to determine areas of the screen that popup menus
should not overlap (see QScreen::availableVirtualGeometry).

Depends on wlroots MR:
https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4406

v2: prevent calling wlr_xwayland_set_workareas() too early
v3: fix segfault at exit (server->xwayland == NULL)

2 years agoxwayland: prevent overriding maximized/fullscreen/tiled geometry
John Lindgren [Fri, 17 Feb 2023 19:08:27 +0000 (14:08 -0500)]
xwayland: prevent overriding maximized/fullscreen/tiled geometry

Fixes an issue where some XWayland views (example: xfce4-terminal)
do not end up with exactly the correct geometry when tiled.

2 years agowlroots.wrap: set revision = 0.17
Johan Malm [Sun, 26 Nov 2023 14:58:13 +0000 (14:58 +0000)]
wlroots.wrap: set revision = 0.17

2 years agoChase wlroots: use output commit event state
Consolatis [Fri, 6 Oct 2023 17:47:40 +0000 (19:47 +0200)]
Chase wlroots: use output commit event state

Chases: 5fb0007e0249388792f3772c30bfabf8d551dec0
output_event_commit: Remove committed and buffer

2 years agoChase wlroots: drop KDE idle protocol
Consolatis [Thu, 5 Oct 2023 10:48:59 +0000 (12:48 +0200)]
Chase wlroots: drop KDE idle protocol

Chases: a289f812d62059d5aac92cbd374dcb7b03bb08a6
drop KDE idle protocol support

2 years agoChase wlroots: add output to scene_output_layout explicitly
John Lindgren [Fri, 22 Sep 2023 01:33:12 +0000 (21:33 -0400)]
Chase wlroots: add output to scene_output_layout explicitly

Chases: f5917f0247600b65edec1735234d00de57d577a8
scene_output_layout: make output adding explicit

2 years agoRestore nested resize
Consolatis [Mon, 30 Jan 2023 04:30:24 +0000 (05:30 +0100)]
Restore nested resize

Chases: 756ecf8ee9f1e75bc7b8297dc84f97c7d699174b
backend/wayland: use request_state when toplevel is resized

Chases: 3ef68a484243555b020200c6f95246d994932c3f
backend/x11: use request_state when window is resized

Ref: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/2693

We now delay requested resolution changes by the backend until
the next frame event which causes us to render the new content
on the already enlarged buffer. Before this change, an empty
(black) buffer would have been shown instead before the next
frame event caused a new render of the actual contents.

Keep commiting the new state and then scheduling a frame event
would not help as due to the commit call it would still show an
empty buffer in the meantime.

Just modifying wlr_output->pending wouldn't work either because
wlr_scene_output_commit() *completely* ignores it (and it will
be removed in future wlroots commits). For this reason we move
to wlr_scene_output_build_state() directly because it allows us
to supply the current wlr_output->pending state and thus apply
any resolution change in lockstep with new rendering. Result:
No more flickering in the wayland backend and resizing is again
smooth as butter.

This prevents constant flicker while resizing
when running nested via the wayland backend.

For the X11 backend (can be tested via `WLR_BACKENDS=x11 labwc`),
it is still rather janky but at least doesn't cause endless self-
resizing anymore.

2 years agoChase wlroots: xdg-decoration now references a toplevel
Consolatis [Mon, 21 Aug 2023 15:59:22 +0000 (17:59 +0200)]
Chase wlroots: xdg-decoration now references a toplevel

Chases: bdc34401ba8e4a59b3464c17fa5acf43ca417e57
xdg-decoration: store an xdg_toplevel instead of xdg_surface

2 years agoChase wlroots: Remove workaround for missing forward declares
Consolatis [Mon, 27 Nov 2023 01:17:18 +0000 (02:17 +0100)]
Chase wlroots: Remove workaround for missing forward declares

Chases: 657ca2205ff4d5f70cf294d9b5720acf2eaf76b4
wlr_gamma_control: add missing forward declarations

2 years agoChase wlroots: add options argument to wlr_scene_output_commit()
John Lindgren [Mon, 17 Jul 2023 06:03:33 +0000 (02:03 -0400)]
Chase wlroots: add options argument to wlr_scene_output_commit()

Chases: 214df8eda07d18b032abfcf525c8344e077c0c7e
scene_output: optionally record and report timings

2 years agoChase wlroots: Use wlr_cursor_set_xcursor()
John Lindgren [Mon, 17 Jul 2023 06:01:02 +0000 (02:01 -0400)]
Chase wlroots: Use wlr_cursor_set_xcursor()

Chases: 18bafbfc57039e16d1dabd78b882b3d6477f76b5
xcursor-manager: drop wlr_xcursor_manager_set_cursor_image()

2 years agoChase wlroots: Add workaround for missing forward declares
Consolatis [Mon, 27 Nov 2023 01:14:21 +0000 (02:14 +0100)]
Chase wlroots: Add workaround for missing forward declares

Chases 70c1a5724814d2f786f7d3a0e55a05f11af14029
gamma-control-v1: introduce set_gamma event

2 years agoChase wlroots: Unified mapping
Christopher Snowhill [Thu, 15 Jun 2023 09:35:43 +0000 (02:35 -0700)]
Chase wlroots: Unified mapping

Need to handle new unified mapping, where mapping is attached to the
wlr_surface objects instead of their parents. Also, most of them require
a new associate event for xsurface objects, their surface member will be
NULL before this event is received.

Refactored by jlindgren:
- add struct mappable
- unify map/unmap logic

2 years agoCI: add libdisplay-info
Consolatis [Thu, 20 Apr 2023 08:44:04 +0000 (10:44 +0200)]
CI: add libdisplay-info

This is a new dependency of wlroots.

2 years agoChase wlroots: Pass version to wlr_compositor_create()
John Lindgren [Wed, 19 Apr 2023 21:52:34 +0000 (17:52 -0400)]
Chase wlroots: Pass version to wlr_compositor_create()

Chases: 0bb574239d3b164596677bf4cec371ff0671dc4f
compositor: pass version in wlr_compositor_create

2 years agoCI: add libxcb-ewmh-dev for Debian (new wlroots dependency)
John Lindgren [Wed, 15 Feb 2023 16:01:40 +0000 (11:01 -0500)]
CI: add libxcb-ewmh-dev for Debian (new wlroots dependency)

2 years agoChase wlroots: wlr_scene_surface_from_buffer renamed
John Lindgren [Tue, 7 Feb 2023 19:28:40 +0000 (14:28 -0500)]
Chase wlroots: wlr_scene_surface_from_buffer renamed

Chases: 7b32c25a4fbdcde4197a06c8e0ff638c54753bd7
wlr_scene: Rename wlr_scene_surface_from_buffer

2 years agoChase wlroots: convert to try_from
John Lindgren [Fri, 3 Feb 2023 19:53:26 +0000 (14:53 -0500)]
Chase wlroots: convert to try_from

Chases: 711a1a3ed42150fdbc716e80719d482006075f69
xdg-shell: convert to try_from

Chases: f9bd416d4156942ce3951a6c5cf9f81a3cf4a3dd
layer-shell-v1: convert to try_from

Chases: fbf5982e3838ee28b5345e98832f6956c402b225
xwayland/xwm: introduce wlr_xwayland_surface_try_from_wlr_surface()

2 years agoChase wlroots: wlr_output_layout refactor
Consolatis [Tue, 24 Jan 2023 02:57:10 +0000 (03:57 +0100)]
Chase wlroots: wlr_output_layout refactor

Chases 097ea84cda70a71ad8ea5940b3b3d277167424e5
output-layout: improve API

2 years agoChase wlroots: wlr_session refactor
Consolatis [Tue, 24 Jan 2023 03:12:02 +0000 (04:12 +0100)]
Chase wlroots: wlr_session refactor

Chases 41b7acbab78597e2eb0724e415ed94b910d113c1
backend: return wlr_session in wlr_backend_autocreate() call

2 years agoChase wlroots: wlr_surface refactor
Consolatis [Tue, 24 Jan 2023 02:32:45 +0000 (03:32 +0100)]
Chase wlroots: wlr_surface refactor

Chases 258bf9be1e44d8a2fb953d727ff4ffcf9ebd6503
compositor: drop wlr_surface.{sx,sy}

2 years agoChase wlroots: Layershell version
Consolatis [Tue, 24 Jan 2023 02:35:13 +0000 (03:35 +0100)]
Chase wlroots: Layershell version

Chases 9f793d350379872aeee56ea5c476adfeedc8bc88
layer-shell-v1: specify version in constructor

2 years agoChase wlroots: Update meson.build wlroots requirement to >= 0.17
Consolatis [Tue, 24 Jan 2023 02:29:38 +0000 (03:29 +0100)]
Chase wlroots: Update meson.build wlroots requirement to >= 0.17

2 years agobuild: bump version to 0.6.6
Johan Malm [Sat, 25 Nov 2023 21:08:56 +0000 (21:08 +0000)]
build: bump version to 0.6.6

2 years agoNEWS.md: update notes for 0.6.6
Johan Malm [Sat, 25 Nov 2023 21:07:20 +0000 (21:07 +0000)]
NEWS.md: update notes for 0.6.6

2 years agoxwayland: assign view->surface earlier in map handler
Johan Malm [Sat, 25 Nov 2023 17:40:44 +0000 (17:40 +0000)]
xwayland: assign view->surface earlier in map handler

...as it needs to be set before honouring xwayland_surface->fullscreen
because that calls desktop_update_top_layer_visiblity() which relies on
view->surface being set in view_is_focusable() since 13d0b14.

Fix bug introduced by PR #1237 which fails to hide the xfce4-panel (or
any other layer-shell client in the top layer) whilst gaming in
fullscreen. The bug can be observed with the following games:

- Alan Wake 2 (wine)
- Starfield (steam+proton)
- Cyberpunk (steam+proton)
- Quake 1 Remaster (steam-native)

Fixes: #661 (the last bit of it)
Reported-by: @ScarecrowDM
Helped-by: @Consolatis
2 years agoxwayland: do not re-set deocrations on unminimize
Johan Malm [Tue, 21 Nov 2023 22:02:22 +0000 (22:02 +0000)]
xwayland: do not re-set deocrations on unminimize

Reproduce issue by:

1. Run an XWayland client
2. ToggleDecorations twice to hide deco
3. Minimize/unminimize from panel
4. Observe that deco is back

Reported-by: @Consolatis
2 years agoKeep xwayland stacking order in sync when switching workspaces
Consolatis [Tue, 21 Nov 2023 02:09:22 +0000 (03:09 +0100)]
Keep xwayland stacking order in sync when switching workspaces

Until we expose the workspaces to xwayland we need a way to
ensure that xwayland views on the current workspace are always
stacked above xwayland views on other workspaces.

If we fail to do so, issues arise in scenarios where we change
the mouse focus but do not change the (xwayland) stacking order.

Reproducer:
- If followMouse is enabled, raiseOnFocus must be disabled
- Open at least two xwayland windows which allow scrolling
  (some X11 terminal with 'man man' for example)
- Switch to another workspace, open another xwayland window
  which allows scrolling and maximize it
- Switch back to the previous workspace with the two windows
- Move the mouse to the xwayland window that does *not* have
  focus
- Start scrolling
- All scroll events should end up on the maximized window on
  the other workspace

This patch fixes the issue by simply raising all windows from
the current workspace again in their original stacking order
when switching workspaces.

Reported-by: Domo via IRC (thanks!)
2 years agocommon/array.h: add wl_array_for_each_reverse macro
Consolatis [Tue, 21 Nov 2023 02:07:10 +0000 (03:07 +0100)]
common/array.h: add wl_array_for_each_reverse macro

2 years agosrc/view.c: add always_on_top criteria
Consolatis [Tue, 21 Nov 2023 02:08:04 +0000 (03:08 +0100)]
src/view.c: add always_on_top criteria

2 years agokeyboard: fix key repeat bug on surface focus change
Johan Malm [Tue, 14 Nov 2023 18:57:40 +0000 (18:57 +0000)]
keyboard: fix key repeat bug on surface focus change

The bug can be reproduced by using the following keybinds and then taking
the steps below with an XWayland client, for example xterm:

    <keybind key="C-S-h">
      <action name="GoToDesktop" to="left" wrap="yes"/>
    </keybind>
    <keybind key="C-S-l">
      <action name="GoToDesktop" to="right" wrap="yes"/>
    </keybind>

1. Press C-S-h
2. Press C-S-l
3. Observe llllllll.... in xterm

Store the key-state in `handle_keybind()` before any call to
`action_run()` as this may lead to `seat_focus()` which passes
'pressed-sent' keys to the new surface.

This partially reverts 7571c4b, which as a standalone commit was fine, but
when 'pressed_mods' were then included in 'bound' in 98bf316,
`key_state_store_pressed_keys_as_bound()` was again required in
`handle_keybind()` to ensure modifers are not passed as non-modifiers in
`wlr_seat_keyboard_notify_enter()` in `seat_focus()`

2 years agokey-state.c: add logging for 'pressed-sent'
Johan Malm [Tue, 14 Nov 2023 18:57:22 +0000 (18:57 +0000)]
key-state.c: add logging for 'pressed-sent'

2 years agoNEWS.md: interim update for 0.6.6
Johan Malm [Sun, 12 Nov 2023 21:32:21 +0000 (21:32 +0000)]
NEWS.md: interim update for 0.6.6

2 years agoUpdate top layer visiblity on workspace switch
Consolatis [Fri, 10 Nov 2023 22:58:25 +0000 (23:58 +0100)]
Update top layer visiblity on workspace switch

Fixes: #1158
2 years agokeyboard: include pressed modifiers in bound set
John Lindgren [Sat, 11 Nov 2023 04:43:46 +0000 (23:43 -0500)]
keyboard: include pressed modifiers in bound set

This prevents applications from seeing and handling the release event
for a modifier key that was part of a keybinding (e.g. Firefox displays
its menu bar for a lone Alt press + release).

2 years agokeyboard: remove exceptions from storing pressed keys
John Lindgren [Sat, 11 Nov 2023 03:53:17 +0000 (22:53 -0500)]
keyboard: remove exceptions from storing pressed keys

These exceptions were added to prevent certain keys (modifiers and
synthetic layout switch key-events) from disabling keybindings (due to
the "nr_pressed_keys > 1" check). That check no longer exists, so the
exceptions should no longer be necessary.

Partially reverts e77330bc3fe7 and 3e2baa3f05ac.

2 years agokeyboard: remove nr_pressed_keys == 1 restriction for keybindings
John Lindgren [Sat, 11 Nov 2023 03:00:04 +0000 (22:00 -0500)]
keyboard: remove nr_pressed_keys == 1 restriction for keybindings

This restriction should be unnecessary now (see the previous commit for
details) and caused issues with keybindings not working on some systems
where irregular keypress events are received (e.g. XF86XK_WakeUp)
without an accompanying release event.

Kept separate from the previous commit for the sake of potential future
bisects.

Partially reverts e77330bc3fe7.

2 years agokeyboard: avoid stuck keys due to keybindings (alternate approach)
John Lindgren [Sat, 4 Nov 2023 05:23:43 +0000 (01:23 -0400)]
keyboard: avoid stuck keys due to keybindings (alternate approach)

Before commit e77330bc3fe7, there were issues with keys becoming "stuck"
if other keys were pressed at the time a keybinding was matched, because
those other keys were included in the "bound" set and the release events
were incorrectly eaten by labwc.

Commit e77330bc3fe7 solved that issue with the "big hammer" approach of
preventing keybindings from working at all if other keys were pressed:

        if (key_state_nr_pressed_keys() > 1) {
                return false;
        }

This is an alternate approach to solving the original problem, by (1)
not including those other keys in the "bound" set and (2) making sure we
always forward release events for un-bound keys to clients (even if a
menu or OSD is displayed).

Details:

- Since we only ever want to store the single matched keycode as bound,
  key_state_store_pressed_keys_as_bound() doesn't really make sense in
  the plural, so rename it to key_state_store_pressed_key_as_bound() and
  pass in the keycode.

- The calls to key_state_store_pressed_keys_as_bound() within
  handle_keybinding() appear to be redundant since it is also called
  from the parent function (handle_compositor_keybindings()). So remove
  these calls.

- Finally, rework the logic for handling key-release events so that we
  always forward release events for keys not in the "bound" set.

This PR does not remove the "key_state_nr_pressed_keys() > 1" check, and
because of that should not result in any functional change. It should
however make it possible to relax or remove that check in future.

2 years agoCI: avoid heavy dependency in FreeBSD job
Jan Beich [Sun, 12 Nov 2023 00:59:20 +0000 (01:59 +0100)]
CI: avoid heavy dependency in FreeBSD job

Not testing runtime yet, so disable Mesa drivers.

2 years agoCI: run FreeBSD job on Ubuntu
Jan Beich [Sat, 11 Nov 2023 23:31:49 +0000 (00:31 +0100)]
CI: run FreeBSD job on Ubuntu

2 years agokeyboard: fix shifted keystroke delay
Johan Malm [Sat, 11 Nov 2023 22:04:14 +0000 (22:04 +0000)]
keyboard: fix shifted keystroke delay

Remove wlr_seat_set_keyboard() from `keyboard_modifiers_notify()`
but leave it in `keyboard_key_notify()`

Fixes regression introduced in 984aeb0

Reported-by: @jlindgren90
Fixes: #1238
2 years agowindow-rules: add fixedPosition property
Johan Malm [Thu, 9 Nov 2023 21:44:51 +0000 (21:44 +0000)]
window-rules: add fixedPosition property

...to address regression introduced by 57075ce and enables panel/desktop
clients which rely on window rules to remain in the same position when
the usable-area changes (normally because an exclusive layer-shell
clients is started/finished).

Also disallows interactive move/resize, for example by alt +
mouse-press.

Fixes: #1235
2 years agointeractive: Make window snapping with mouse more intuitive
tokyo4j [Tue, 7 Nov 2023 05:43:53 +0000 (14:43 +0900)]
interactive: Make window snapping with mouse more intuitive

1. Prevent window snapping triggered by mouse from moving the window
 into the adjacent output.
2. Make the coordinates used to check whether window snapping is
 triggered relative to the output the cursor is at, not the output the
 view is belonging to. This allows users to grab a tiled window and move
 it into another output or tile it again in another output in a single
 drag.

2 years agoAdd unfocus action
Johan Malm [Tue, 7 Nov 2023 18:53:27 +0000 (18:53 +0000)]
Add unfocus action

...to enable unfocusing currently focused window on desktop click.

Works with:

    <mouse>
      <default />
      <context name="Root">
        <mousebind button="Left" action="Press">
          <action name="Unfocus" />
        </mousebind>
      </context>
    </mouse>

Fixes: #1230
2 years agoxdg: try to handle missing set_window_geometry with Qt apps
John Lindgren [Sat, 21 Oct 2023 23:49:38 +0000 (19:49 -0400)]
xdg: try to handle missing set_window_geometry with Qt apps

Qt applications occasionally fail to call set_window_geometry after a
configure request, but do correctly update the actual surface extent.
This results in a mismatch between the window decorations (which follow
the logical geometry) and the visual size of the client area. As a
workaround, try to detect this case and ignore the out-of-date window
geometry.

Fixes: #1194
2 years agoview: ensure that floating views don't overlap top panels
John Lindgren [Fri, 3 Nov 2023 16:38:07 +0000 (12:38 -0400)]
view: ensure that floating views don't overlap top panels

The top_left_edge_boundary_check() function in xwayland.c ensures that
views trying to position themselves at 0,0 don't end up with a titlebar
offscreen. However, it doesn't take into account the usable area and
thus these views can still end up overlapping a top panel.

Also, there is no good reason for top_left_edge_boundary_check() to be
xwayland-specific. This logic should really be part of
view_adjust_for_layout_change().

To fix all this, add a new view_adjust_floating_geometry() function,
which replaces the existing similar (and duplicated) logic in
view_apply_natural_geometry() and view_adjust_for_layout_change().

view_adjust_for_layout_change() is already being called from xwayland's
set_initial_position(), so top_left_edge_boundary_check() is now
redundant and can just be deleted.

Lightly tested with waybar and feh --geometry 640x480+0+0. The feh
window is now correctly positioned below waybar, even if started before
waybar (in that case, the feh window is moved when waybar starts).

2 years agokeyboard: allow applying keyboard layout per window
Consolatis [Thu, 7 Sep 2023 14:41:47 +0000 (16:41 +0200)]
keyboard: allow applying keyboard layout per window

Fixes #1076

It can be enabled with a config like

~/.config/labwc/rc.xml:
<keyboard layoutScope="window">

~/.config/labwc/environment:
XKB_DEFAULT_LAYOUT=de,us
XKB_DEFAULT_OPTIONS=grp:alt_shift_toggle,grp_led:scroll

With a configuration like this each window should now remember
the active keyboard layout when switching between windows.

By default, the keyboard layout keeps being a global state.

2 years agoNEWS.md: interim update for 0.6.6
Johan Malm [Wed, 1 Nov 2023 21:43:12 +0000 (21:43 +0000)]
NEWS.md: interim update for 0.6.6

2 years agoNEWS.md: minor style fixes
Johan Malm [Thu, 2 Nov 2023 18:16:53 +0000 (18:16 +0000)]
NEWS.md: minor style fixes

2 years agocursor: allow re-focusing xwayland-unmanaged surfaces
John Lindgren [Thu, 2 Nov 2023 03:01:19 +0000 (23:01 -0400)]
cursor: allow re-focusing xwayland-unmanaged surfaces

We already allow some xwayland-unmanaged surfaces to take focus on map,
if indicated by wlr_xwayland_or_surface_wants_focus(). But once these
surfaces lose focus, they never regain it again.

Add desktop_focus_view_or_surface() and call it in the appropriate
places to allow these views to regain focus in the usual ways (e.g.
clicking on them or focus-follows-mouse).

2 years agoview.h: changed the type of tiled in struct view to enum view_edge
Tomi Ollila [Tue, 31 Oct 2023 20:12:12 +0000 (22:12 +0200)]
view.h: changed the type of tiled in struct view to enum view_edge

The type enum view_edge used to be defined in a .c file, so a
structure member 'tiled' in struct view had to be defined to
use another type.

Later (2023-08-02, commit 1ee8715) the definition of enum view_edge
was moved to view.h, so now 'tiled' can be defined to use that type.

2 years agohow to specify variant layout
GNUser [Tue, 31 Oct 2023 18:01:31 +0000 (14:01 -0400)]
how to specify variant layout

2 years agoMove input handler init() and finish() functions to input/input.c
Consolatis [Sun, 3 Sep 2023 17:21:16 +0000 (19:21 +0200)]
Move input handler init() and finish() functions to input/input.c

2 years agoMove keyboard functions into input/keyboard.h
Consolatis [Sun, 3 Sep 2023 17:15:50 +0000 (19:15 +0200)]
Move keyboard functions into input/keyboard.h

2 years agoMake touch depend on cursor to prevent racing
Consolatis [Sun, 3 Sep 2023 17:07:55 +0000 (19:07 +0200)]
Make touch depend on cursor to prevent racing