Commit graph

776 commits

Author SHA1 Message Date
Andrew J. Hesford
cf34e60240 edges: limit edge attraction and resistance...
...to edges actually encountered by motion during interactive moves and
resizes.

In addition, ignore edge resistance and attraction for minimized views.
2024-02-05 22:05:22 +00:00
Andrew J. Hesford
e7e6d29237 edges, resistance, snap: unified resistance and snapping engine 2024-01-30 15:02:17 -05:00
Andrew J. Hesford
3162bbb3c2 xdg: add snapping.notifyClient option to control tiling events 2024-01-30 07:30:07 -05:00
Andrew J. Hesford
c1a2dd3e27 view, xdg: notify clients when tiling windows 2024-01-30 07:30:07 -05:00
Consolatis
a04b394e59 xwayland: support querying window types 2024-01-25 21:14:30 +00:00
Andrew J. Hesford
9ecd8c2b43 view: ensure midpoint is visible on layout change
Fixes: #1476.
2024-01-25 20:22:10 +01:00
Consolatis
396a4b93d1 src/output.c: expose output configuration test to clients 2024-01-23 20:14:24 +00:00
Jens Peters
b1d626fbfd view: add move_to_output() function 2024-01-22 22:27:08 +00:00
Jens Peters
982df84407 view: expose view_get_adjacent_output 2024-01-22 22:27:08 +00:00
Jens Peters
099929cf46 view: allow overriding of cursor placement policy 2024-01-22 22:27:08 +00:00
Jens Peters
3f77514459 config: add finding touch configurations 2024-01-22 21:50:18 +00:00
Jens Peters
2c3ab16f39 config: parse multiple touch configurations
Also temporary disable touch output mapping.
Will be restored later.
2024-01-22 21:50:18 +00:00
Jens Peters
9d64b56367 config: introduce touch config structure 2024-01-22 21:50:18 +00:00
Jens Peters
6def1319d1 input: move function to config
This function is only about rc, so fits better
in config.
2024-01-22 21:50:18 +00:00
Andrew J. Hesford
57ea197e6c resistance: add window-edge resistance for interactive moves/resizes 2024-01-21 16:10:50 -05:00
Johan Malm
c066821046 string-helpers.c: add string_empty() 2024-01-19 20:00:37 +00:00
Simon Long
8c9be2f0d1 keyboard: set keyboard layout on reconfigure
If keyboard-layout-per-toplevel-window is used, reset the group (index)
for each window on --reconfigure whenever the keymap has changed.

Refactor to use a common configure function for reconfigure and
keyboard-group creation.

Co-authored-by: @johanmalm

Fixes #1407
2024-01-19 18:59:14 +00:00
Johan Malm
dfb6664906 Honour -c <file> on --reconfigure 2024-01-18 20:20:36 +00:00
Johan Malm
698c7ace07 config: support merging multiple config files
Add the -m|--merge-config command line option to iterate backwards over
XDG Base Dir paths and read config/theme files multiple times.

For example if both ~/.config/labwc/rc.xml and /etc/xdg/labwc/rc.xml
exist, the latter will be read first and then the former (if
--merge-config is enabled).

When $XDG_CONFIG_HOME is defined, make it replace (not augment)
$HOME/.config. Similarly, make $XDG_CONFIG_DIRS replace /etc/xdg when
defined.

XDG Base Dir Spec does not specify whether or not an application (or a
compositor!) should (a) define that only the file under the most important
base directory should be used, or (b) define rules for merging the
information from the different files.

ref: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html

In the case of labwc there is a use-case for both positions, just to be
clear, the default behaviour, described by position (a) above, does NOT
change.

This change affects the following config/theme files:
  - rc.xml
  - menu.xml
  - autostart
  - environment
  - themerc
  - themerc-override
  - Theme buttons, for example max.xbm

Instead of caching global config/theme directories, create lists of paths
(e.g.  '/home/foo/.config/labwc/rc.xml', '/etc/xdg/labwc/rc.xml', etc).
This creates more common parsing logic and just reversing the direction
of iteration and breaks early if config-merge is not wanted.

Enable better fallback for themes. For example if a particular theme does
not exist in $HOME/.local/share/themes, it will be searched for in
~/.themes/ and so on. This also applies to theme buttons which now
fallback on an individual basis.

Avoid using stat() in most situations and just go straight to fopen().

Fixes #1406
2024-01-18 20:20:36 +00:00
Consolatis
e05bedb140 feat: add Shade/Unshade/ToggleShade actions
This builds on the work of @Consolatis in #1018.

Co-authored-by: Consolatis <35009135+Consolatis@users.noreply.github.com>
Co-authored-by: Andrew J. Hesford <ajh@sideband.org>
2024-01-15 21:37:36 +00:00
Jens Peters
614ce35f31 config: add touch output mapping configuration 2024-01-13 22:18:20 +00:00
Jens Peters
17e15ed987 seat: re-map tablet to output on output change 2024-01-10 21:10:11 +00:00
Jens Peters
1df3ada636 config: add tablet output mapping configuration
Also add missing default for 'tablet.rotation'.
2024-01-10 21:10:11 +00:00
Jens Peters
b01d7dbf38 input: add missing new lines 2024-01-10 21:10:11 +00:00
Johan Malm
c646c7bd1b view: constrain window size to that of usable area
...on first map (when application is started).

Fixes #1399
2024-01-08 22:08:27 +00:00
Ph42oN
bce0c6ce56
Add tearing support (#1390)
Co-authored-by: Andrew J. Hesford <ajh@sideband.org>
2024-01-08 20:58:58 +00:00
Jens Peters
e51c3fc5d4 config: reuse mousebind_button_from_str() 2024-01-06 19:37:41 +00:00
Andrew J. Hesford
c229f6edc0 view: try to honor original geometry with layout changes
Whenever the output layout changes, each view's original geometry will
be captured as last_layout_geometry (if it has not already been captured
by a previous layout change), which will remain valid unless the user
modifies the view's geometry (i.e., by tiling, maximizing, moving,
resizing or full-screening). On subsequent output layout changes, views
with valid last_layout_geometry will be back to their original position
if possible, or else to the closest possible output.
2024-01-06 19:04:11 +00:00
Tomi Ollila
785a34e8ad Fixed some typos 2024-01-04 19:32:51 +00:00
Jens Peters
d48126bf97 config: add user names for pad butttons 2024-01-02 21:28:42 +00:00
Jens Peters
c2687d9281 input: add tablet pad setup and button handler
Split pad initialization from tablet initialization to
avoid conflicting handler names.
Also reuse 'get_mapped_button'.
2024-01-02 21:28:42 +00:00
Jens Peters
f0abd9304f config: add tablet area configuration 2024-01-01 22:11:33 +00:00
Johan Malm
af5d80a583 config: s/enum device_type/enum lab_libinput_device_type/ 2024-01-01 22:04:21 +00:00
Johan Malm
673c745cff config: prefix enums with LAB_LIBINPUT_DEVICE_ 2024-01-01 22:04:21 +00:00
Johan Malm
5337eda242 config: remove duplication in libinput-category parsing
Related-to: #1382
2024-01-01 22:04:21 +00:00
Andrew J. Hesford
b1c5e95c05 view: honor automatic placement when adjusting floating geometry
The view_adjust_floating_geometry function is called when un-maximizing
a window or changing the output layout to ensure that views are well
placed. Rather than always centering these views should they fall
offscren, use the automatic placement strategy if so configured.
2023-12-30 16:50:09 +00:00
Ph42oN
08045d7843 config: add adaptive sync fullscreen option 2023-12-30 15:46:35 +00:00
Jens Peters
23ecc32562 config: add tablet rotate configuration
Co-authored-by: Consolatis <35009135+Consolatis@users.noreply.github.com>
2023-12-29 22:32:41 +00:00
Jens Peters
20bba35570 input: rename drawing_tablet to tablet 2023-12-29 20:22:46 +00:00
Jens Peters
567b81ea10 config: add tablet button mapping configuration
Co-authored-by: Consolatis <35009135+Consolatis@users.noreply.github.com>
2023-12-29 20:22:46 +00:00
Jared Baur
6faee17d20 Add touchpad device type
It is nice to have finer granularity for device types to allow for
configurations such as using `naturalScroll` on touchpads, but not on
regular pointer devices such as mice.
2023-12-29 08:08:32 +00:00
Jens Peters
2b96799a05 input: add drawing tablet setup and event listeners
Co-authored-by: Consolatis <35009135+Consolatis@users.noreply.github.com>
2023-12-27 11:09:26 +00:00
Jens Peters
58e9724007 input: add cursor move and button emulation
Co-authored-by: Consolatis <35009135+Consolatis@users.noreply.github.com>
2023-12-27 11:09:26 +00:00
kyak
d2d469133f
osd: support full app_id in window switcher (#1309)
Support showing full application
identifier or the trimmed variant in window switcher OSD.

Regression notice: For anyone using ‘identifier’ in window-switcher field configuration, change it to ‘trimmed_identifier’.
2023-12-27 10:55:49 +00:00
Andrew J. Hesford
52aafcc054 feat: automatic window placement
With automatic placement, new top-level windows will be placed to
minimize overlap with other windows already on screen.
2023-12-26 19:20:06 +00:00
Andrew J. Hesford
ef62d47ad1 feat: under-cursor window placement
With under-cursor placement, new top-level windows will be centered
under the cursor rather than centered on the active view.
2023-12-26 19:20:06 +00:00
Johan Malm
b7ee8b16f3 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.
2023-12-21 02:42:23 +01:00
Consolatis
27de4e6398 theme: create hover button fallbacks
...by copying the non-hover variant and adding a transparent overlay.

Co-authored-by: @johanmalm
2023-12-21 02:42:23 +01:00
John Lindgren
d207e97992 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.
2023-12-21 02:42:23 +01:00
Johan Malm
3a959cc74b s/focused_view/active_view/ 2023-12-19 20:34:07 +00:00