Commit graph

1701 commits

Author SHA1 Message Date
Johan Malm
c293886911 NEWS.md: use latest keep-a-changelogs link format
...which points to https://github.com/.../compare/v0.0.1...v0.0.2
rather than a 'release' page.
2023-09-23 16:49:54 +01:00
Johan Malm
ccc3d14658 common/buf.c: do not use memcpy for overlapping regions 2023-09-23 16:28:23 +01:00
Johan Malm
881d788bee action: do not expand env vars in Exec action
...<command> argument (but still resolve tilde).

This makes it easier to write sh -c '' constructs without turning labwc
into a shell parser in order to expand environment variables, whilst
respecting single quotes and escaped characters as well as ignoring
subshells syntax like $(foo) and backticks.

Also, fix bug where buffer length+alloc get out-of-sync
2023-09-23 14:52:59 +01:00
Johan Malm
c6c1f8e04b buf: do not expand $() in buf_expand_shell_variables() 2023-09-23 14:52:59 +01:00
Consolatis
e8ec8ea7ff src/ssd: use view->ssd_titlebar_hidden for ssd_thickness calculations
Before this patch we were using the internal .enabled flag of the titlebar
tree node. This failed due to ssd_thickness() not having view->ssd assigned
when initially called. Instead of assigning view->ssd within ssd_create()
we just always use the view boolean flag directly. This fixes an issue
where a border-only view that has been snapped to an edge or region would
have a gap in the size of the titlebar on top after a Reconfigure.

Fixes #1083
2023-09-21 22:21:19 +01:00
Consolatis
e5d459aa0c Ensure xdg and xwayland string_prop() handlers deal with destroying views
When a view is destroyed (including override_redirect in the xwayland
case), the view_destroy() handler is called which checks for a currently
open A-Tab window switcher and causes an update there to remove the
destroying view from the list. Before view_destroy() is called, both
xwayland and xdg handlers reset the xdg_surface / xwayland_surface.

The window switcher update then creates a list of all windows which do
not have the 'skipWindowSwitcher' window rule property set. If there is
at least one 'matchOnce' window rule configured, this also tries to get
string properties of the destroying view which already had their
xdg_surface / xwayland_surface reset and thus run into an assert.

This patch fixes that so that the string_prop() handlers always return
an empty string in those cases rather than running into the assert.

For a more in-depth analyses and alternative solutions see the linked
issue.

Fixes #1082
2023-09-21 22:16:11 +01:00
Standreas
44e65e7930 Added note for localization support to menu.xml
Maybe mention it in the man page too?
2023-09-20 19:08:46 +02:00
Johan Malm
8d3b15576b Add ARRAY_SIZE() macro 2023-09-19 22:03:59 +01:00
Standreas
ae676c1607 Fix typo in labwc-theme.5.scd 2023-09-19 22:06:12 +02:00
Johan Malm
715405fe29 build: make svg buttons optional
Add -Dsvg=disabled to your meson setup/configure command to disable svg
buttons even if the correct version of librsvg is available.

Note that regardless of this patch and the value of the 'svg' variable,
the build will gracefully fall back to not using librsvg if the correct
version is not available.

Helped-by: @01micko
2023-09-17 19:26:41 +01:00
Johan Malm
c598cf7f11 button-png.c: s/png_load/button_png_load/ 2023-09-17 19:26:41 +01:00
Johan Malm
c62df26c2a Support svg buttons
In the theme directory add close-{active,inactive}.svg instead of
close.xbm - and similarly for iconify, menu and max.
2023-09-17 19:26:41 +01:00
Johan Malm
a386133068 common/file-helpers.c: share file_exists() to reduce duplication 2023-09-17 19:26:41 +01:00
Johan Malm
a8951c4b75 button/common.c: share button_filename() to reduce duplication 2023-09-17 19:26:41 +01:00
redtide
143714f1c9 src/common/parse-bool.c: support on/off boolean values 2023-09-13 05:27:27 +01:00
Consolatis
bd6efe4849
Merge pull request #1072 from Consolatis/feature/keycode_binds
Keybinds: keyboard layout agnostic keybinds
2023-09-11 22:00:39 +02:00
Consolatis
c1c624daf0 keybinds: add optional layoutDependent argument
This allows to define keybinds as layout dependent. E.g. keybinds
only trigger if the configured key exists in the currently active
keyboard layout. The keybind will also only trigger on the physical
key that is mapped to the configured key in the active layout.

By default the new argument is false which means all keybinds by
default are layout agnostic. This optional argument can be used
to restore the earlier default behavior of having keys layout
dependent.
2023-09-11 15:41:19 +02:00
Consolatis
6b80751010 keybinds: prefer keycodes over keysyms
This allows keyboard layout agnostic keybinds
in a multi layout configuration.

Fixes: #1069
2023-09-11 15:39:34 +02:00
Standreas
8a67476ab3 docs: clarify keyboard modifiers can be used for mousebinds
Fixes: #1075
2023-09-10 19:36:24 +02:00
Consolatis
97ac960fee src/cursor: ensure interactive move/resize ends correctly for CSD clients
Before this patch, when moving a CSD client below a layershell surface -
like a panel that was configured with either the "top" or "overlay"
layers - we'd only send a matching release button event to the client but
not actually end the interactive move operation. That caused the drag to
continue even though the user already released the mouse button.

In comparison, SSD clients were not suffering from the same issue because
the initial mouse "down" event was not attached to any client surface and
thus it would not take the first early return because there was no surface
attached to the release event.

This patch fixes the issue by reordering the conditions where we return
early. It also ensures that when we finish the move, we still send the
release event to CSD clients.

Fixes: #1053
Reported-by: @DynamoFox (thanks)
2023-09-10 16:49:54 +01:00
Consolatis
bb235337d8 window-rules: add ignoreFocusRequest property
This allows to reject focus requests from specific applications.
2023-09-10 13:31:15 +02:00
Consolatis
272222e3c9 keybinds: allow non-english based keybinds 2023-09-07 23:24:36 +01:00
tokyo4j
19ffbae320 config: replace enums with int to handle negative values
This commit also fixes that an invalid value in <accelProfile> is interpreted as "flat"
2023-09-07 22:55:50 +01:00
tokyo4j
3c3656f74e config: support <tapAndDrag> and <dragLock> 2023-09-07 22:55:50 +01:00
tokyo4j
4268991105 CodeStyle: double indent in if statement 2023-09-07 22:55:50 +01:00
Consolatis
1703b4d6cc src/menu/menu.c: support keyboard driven selection
Fixes: #1058
Requested-by: @stefonarch
2023-09-05 19:57:14 +01:00
Consolatis
a9ab8ebdaf src/menu/menu.c: convert to wl_list_append() 2023-09-05 19:57:14 +01:00
bi4k8
a49e12e112 touch: store initial coordinate adjustments
this avoids touch offsets jumping when a touch point moves off of a surface
2023-08-27 23:13:24 +02:00
Consolatis
a3a5d9a21b src/osd.c: prevent crash with theme setting osd.window-switcher.width: 0
Fixes: #1050
Reported-by: @4ffy (thanks)
2023-08-27 21:25:32 +02:00
Consolatis
ef8709d7fe src/ssd: ensure unround corners + disabled borders are set on reload
E.g. when using Reconfigure or ToggleDecorations with a maximized view.
2023-08-25 15:54:22 +02:00
Consolatis
72936ccb3e src/ssd: fix tiling via keybind when maximized
The previous PR introduced an issue with tiling based actions
like SnapToEdge and SnapToRegion using outdated SSD margin
values when called via keybind while maximized. That resulted
in wrong offsets for the tiled windows.

This commit restores the functionality by forcing a re-calculation
of the SSD margin when changing the maximized state.

Thanks to @Flrian for reporting the issue via IRC.
2023-08-25 15:54:22 +02:00
Consolatis
f42f5f41c5 src/ssd: un-round corners on maximize 2023-08-25 11:34:52 +02:00
Consolatis
10f22a8f5b src/ssd: disable border on maximize
Fixes #1044
2023-08-25 11:34:52 +02:00
Johan Malm
206db43786 config: s/app_id/identifier/ for window-switcher field
...to be consistent with window rules.

The use of 'app_id' for window-switcher fields is hereby deprecated.
2023-08-20 20:49:27 +01:00
Johan Malm
e5a6c57a6e Move isfocusable() from desktop.c to view.c 2023-08-20 17:00:23 +01:00
Johan Malm
602d59a3b2 Add common/array.h with wl_array_len() 2023-08-20 13:08:45 +02:00
Johan Malm
7fde7ed2cc view: add for_each_view()
Helped-by: @Consolatis and @heroin-moose (by a significant amount)
2023-08-20 09:56:49 +01:00
Johan Malm
a9e123393c osd: refactor to remove get_osd_height() 2023-08-20 09:56:49 +01:00
Johan Malm
f2479090a2 osd: simplify to only use one view-array 2023-08-20 09:56:49 +01:00
Johan Malm
57b9efeb45 view: add view_array_append()
...to reduce code duplication.

The function populates an array with views which meet any set of critera
from:

  - current-workspace
  - no-always-on-top
  - no-skipWindowSwitcher (window-rule)

Make src/osd.c use this new interface. Note that always-on-top views are
still filtered out from the window-switcher and that desktop_cycle_view()
needs to be re-worked before always-on-top views can be opted in.
2023-08-20 09:56:49 +01:00
Consolatis
58b33fb0c9 Add window resize indicator 2023-08-19 18:37:16 +02:00
Consolatis
c8321e3264 src/xwayland.c: make size_hints globally accessible 2023-08-19 18:37:16 +02:00
Johan Malm
a89bcc3c60 cursor: prevent press on layer-subsurface from cancelling popup grab
Fixes: #1030
2023-08-15 20:25:58 +01:00
Johan Malm
be1ef03412 find-idents.c: fix typo
...which so far has caused any bugs!
2023-08-12 21:31:46 +02:00
Johan Malm
c4b9173afd checkpatch.pl: check single statement brace 2023-08-11 21:54:52 +01:00
Johan Malm
b149526d03 foreign: set parent
Tested with wlroots/examples/foreign-toplevel.c

Helped-by: @Consolatis
2023-08-11 07:53:19 +02:00
Johan Malm
2b9a6914a6 button: move button-png.c to button/
...so that all button code is in the same place.
2023-08-10 16:33:03 +01:00
Johan Malm
03bc2ada47 button: refactor xbm code
- Rename src/xbm/ to src/button/
- Combine xbm.c parse.c tokenize.c into button-xbm.c

No functional change
2023-08-10 16:33:03 +01:00
Johan Malm
3111c57d6f cursor: cancel popup grab on mouse-press outside client itself
...for example on any part of the server side decoration

Supercedes #826 for xdg-shell popups

Helped-by: @Consolatis
2023-08-10 15:33:56 +01:00
Consolatis
e39744f1d3 Add keepBorder <theme> option and enable it by default
With the new keepBorder option enabled, the
ToggleDecorations action now has 3 states:

- the first time only disables the titlebar
- the second time disables the whole SSD
- the third time enables the whole SSD again

When the keepBorder action is disabled, the old 2-state
behavior is restored, e.g. the ToggleDecorations action
only toggles between on and off.

Fixes #813
2023-08-10 16:09:20 +02:00