Commit graph

1690 commits

Author SHA1 Message Date
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
Johan Malm
a6a03daae3 Support png buttons
In the theme directory add close-{active,inactive}.png instead of
close.xbm - and similarly for iconify, menu and max.
2023-08-09 07:38:17 +01:00
Johan Malm
eca98a9b6e theme: simplify loading of xbm buttons
No functional change.
2023-08-09 07:38:17 +01:00
Consolatis
7a19184e5e src/cursor.c: end popup grab on desktop click
Fixes #949
2023-08-07 09:59:30 +02:00
Consolatis
43db75f43c 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.

Fixes 1ee8715d57
actions: use enum for _ToEdge action
2023-08-06 10:37:36 +02:00
Consolatis
8d0ee4811b 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

This commit fixes the first bug.

Fixes 1ee8715d57
actions: use enum for _ToEdge actions
2023-08-06 10:37:36 +02:00
Johan Malm
2c14a5a406 view: make move_sub_views() use append_children method
...to share common code with minimize_sub_views()

Also, fix a bug in the move-to-back functions to move the window
hierarchy in the right order.

Helped-by: @Consolatis
2023-08-05 21:06:28 +02:00
Johan Malm
e991eae103 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.
2023-08-05 15:25:00 +01:00
Johan Malm
d961dbf9b0 xwayland: fix client request-unmap bug
Remove foreign-toplevel handle when a client sends a request-unmap to a
minimized (therefore unmapped) view.
2023-08-05 15:25:00 +01:00
Johan Malm
dfc0dfba6d 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.
2023-08-05 15:25:00 +01:00
Johan Malm
1212f34825 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.
2023-08-05 15:25:00 +01:00
Johan Malm
e1743e1de2 xdg: show modal dialog above parent window
This behaviour is consistent with that of mutter and openbox.

Fixes: issue #823
2023-08-05 15:25:00 +01:00