Consolatis [Sun, 6 Aug 2023 08:26:04 +0000 (10:26 +0200)]
Restore SnapToEdge and MoveToEdge default keybinds
When adding the fallback keybinds we add them as string but expect them being an int.
This commit fixes that by using the same parsing routines that are used when parsing
user supplied configuration.
Consolatis [Sun, 6 Aug 2023 07:47:37 +0000 (09:47 +0200)]
Fix crash when using _ToEdge actions when using the default keybinds
This happens because of two separate bugs:
- The action validation failed to verify the data type of the argument
- When adding the fallback keybinds we add them as string but expect them being an int
Johan Malm [Wed, 2 Aug 2023 19:57:39 +0000 (20:57 +0100)]
view: minimize parents/children together
Minimize the whole view-hierarchy from top to bottom regardless of which
one in the hierarchy requested the minimize. For example, if an 'About' or
'Open File' dialog is minimized, its toplevel is minimized also, and vice
versa.
For reference:
- This is consistent with in openbox, where child views (dialogs) can be
minimized, but when doing so the parent is also minimized.
- In mutter these types of dialogs cannot be minimized (via client-menu or
otherwise).
- In both openbox and mutter, when a toplevel window is minimized any open
children are also minimized.
Johan Malm [Fri, 4 Aug 2023 20:58:52 +0000 (21:58 +0100)]
xwayland: guard against mapping view without surface
...which may occur if a user minimizes an xwayland view (typically a
child view such as a dialog) at the same time as the client sends a
request-unmap, which xwayland clients sometimes do without actually
requesting destroy and just leave them dangling.
Johan Malm [Wed, 19 Jul 2023 16:19:37 +0000 (17:19 +0100)]
view: move (z-order) ancestors with modal dialogs
...so that other window cannot be positioned between modal dialogs and
their parent windows. This is consistent with Gtk3 and Qt5 applications on
mutter and openbox.
Johan Malm [Fri, 4 Aug 2023 21:37:39 +0000 (22:37 +0100)]
labwc-theme(5): describe color alpha value
...which has been supported for a long time but not been reflected in the
man page. Colors can be parsed as `#rrggbb aaa` with aaa representing a
decimal alpha value. This could be used to hide a button, for example:
Consolatis [Wed, 2 Aug 2023 02:30:50 +0000 (04:30 +0200)]
actions: use enum for _ToEdge actions
This also improves the config robustness as invalid edge names will now
prevent the action to be created in the first place and the user gets
notified about the issue.
Johan Malm [Mon, 17 Jul 2023 19:08:32 +0000 (20:08 +0100)]
keyboard: fallback on raw keysyms for bindings
When looking up keybinds, if the translated keysyms (based on the keymap
for the keyboard) do not match a defined keybind, try raw keysyms (as if
there were no modifier translation).
This allows a user to define for example keybind with "S-1" rather than
"S-exclam". It also supports "W-S-Tab".
Johan Malm [Mon, 10 Jul 2023 15:56:02 +0000 (16:56 +0100)]
dnd: fix focus at end of dnd operation
By default, leave keyboard-focus with the surface that originally had it
at the end of a dnd operation. This is consistent with the default
behaviour of openbox and mutter.
If the 'focus/followMouse' option is enabled, then focus on the surface
under the cursor at the end of the dnd operation.
Johan Malm [Wed, 7 Jun 2023 20:44:38 +0000 (21:44 +0100)]
window-rules: support matchOnce attribute
...allowing a rule to be applied to only the first window matching a
particular criteria. For example, the following can be used to apply a
window rule to lxqt-panel but not its configuration window with the same
app_id:
Johan Malm [Sun, 11 Jun 2023 14:57:58 +0000 (15:57 +0100)]
config: fix bug with default scroll mousebind
Specify attribute name when adding default mousebind actions.
This is required because in src/action.c action GoToDesktop requires an
argument with key 'to' and does not accept `action_get_first_arg()`
because the action supports other optional attributes so we could not
guarantee that 'to' is the first one.
Tomi Ollila [Sun, 14 May 2023 17:44:59 +0000 (20:44 +0300)]
action: support {Go,Send}ToDesktop 'wrap' option
Make wrap 'true' by default for both GoToDesktop and SendToDesktop,
in order to default to the current behaviour, and to stay consistent
with Openbox behaviour.
Consolatis [Thu, 11 May 2023 21:36:51 +0000 (23:36 +0200)]
src/action.c: validate action type when assigning arguments
Before this patch it was possible to assign an argument with an
existing name to an action that didn't support the given argument.
An example of this is using `direction` for `GoToDesktop`.
This patch now only creates action arguments that are actually
defined for the given action type and logs an error for
unsupported arguments.
The commit also makes sure to always supply the argument name.
This will reduce required checks in other parts of the codebase
in future commits.
Tomi Ollila [Sat, 13 May 2023 13:10:33 +0000 (16:10 +0300)]
includes: identifier consistency in include guards
Made all header files to have LABWC_ prefix in include guard identifers.
Converted from __LABWC_ in 35 include/ files.
Converted from __LAB_ in 5 include/ files.
Added LABWC prefix to 3 include/ files.
Added include guards to 3 include/ files.
The double underscores were removed since according to C standard
those "are always reserved for any use".
John Lindgren [Wed, 19 Apr 2023 22:10:07 +0000 (18:10 -0400)]
xwayland: Add mapped argument to xwayland_view_create()
This is a trivial cleanup to make xwayland_view_create() symmetrical with
xwayland_unmanaged_create(), and avoid the need to access view->impl from
xwayland-unmanaged.c.
The return value of xwayland_view_create() is no longer user, so return void.
Rules are applied if windows match the criteria defined by the
'identifier' attribute which relates to app_id for native Wayland windows
and WM_CLASS for XWayland clients.
Matching against patterns with '*' (wildcard) and '?' (joker) is
supported.
Prevent wayland clients that request the X11 clipboard but closing
their read fd prematurely to crash labwc because of the unhandled
SIGPIPE signal. It is caused by wlroots trying to write the X11
clipboard data to the closed fd of the wayland client.
See https://github.com/labwc/labwc/issues/890#issuecomment-1524962995
for a reproducer involving xclip and wl-paste | head -c 1.