Commit graph

1990 commits

Author SHA1 Message Date
Johan Malm
f73e9ded1c view: fix regression whereby cursor is not updated
...on view destruction because focus_change_notify() in seat.c changes
server->active_view so the logic introduced by 6c6e406 (which checks if
view =! active_view) is no longer right.

The glitches described in the commit below have not come back.
6c6e406507

Fixes #1393
2024-01-19 20:37:23 +00: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
Johan Malm
d0aff49c81 button: save a few cycles by returning early
...and in preparation for the merge-config patch, avoid building
directory lists for empty filenames.
2024-01-18 20:20:36 +00:00
Andrew J. Hesford
4238d7fc33 view: assign output on surface creation instead of mapping...
...and notify the client of the preferred output scale when doing so.
This should allow clients to better determine an optimal size if they
are initially configured (unmapped) with zero size.

In particular, this fixes an issue with foot:

    https://codeberg.org/dnkl/foot/issues/1579
2024-01-17 21:07:33 +00:00
Weblate
02d274e32c Translation updates from weblate
Co-authored-by: Ettore Atalan <atalanttore@googlemail.com>
Co-authored-by: Jouni Järvinen <jounijarvis@gmail.com>
Co-authored-by: Masamichi Ito <ito32bit+github@gmail.com>
Co-authored-by: Moo <hazap@hotmail.com>
Co-authored-by: Weblate <noreply@weblate.org>
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/de/
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/ja/
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/lt/
Translation: Labwc/labwc
2024-01-15 22:06:52 +00:00
Johan Malm
774eb2170f keyboard: cancel key repeat on vt change
...(calling `wlr_session_change_vt()`) because when the session is
switched, the access to the keyboard is lost and therefore the RELEASE
event will not be passed to the compositor.

Fixes bug whereby compositor crashes on VT change on FreeBSD.

Fixes #1424
2024-01-15 21:56:18 +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
722a802de0 docs: add touch section 2024-01-13 22:18:20 +00:00
Jens Peters
6d6f243ff5 seat: re-map pointer to output on output change 2024-01-13 22:18:20 +00:00
Jens Peters
f5f5a7b036 seat: configure libinput for touch on reconfigure 2024-01-13 22:18:20 +00:00
Jens Peters
ffc4b0fdee seat: remove not needed device type test
The device type is already validated in the calling
function.
2024-01-13 22:18:20 +00:00
Jens Peters
516423f9ba seat: re-map touch to output on output change 2024-01-13 22:18:20 +00:00
Jens Peters
0eb1ae4d66 seat: re-map touch to output on reconfigure 2024-01-13 22:18:20 +00:00
Jens Peters
21cf3071e3 seat: map touch to configured output name
The output name linked to the touch device
has preference when set. This happens when
the compositor runs in nested mode.
2024-01-13 22:18:20 +00:00
Jens Peters
614ce35f31 config: add touch output mapping configuration 2024-01-13 22:18:20 +00:00
Tomi Ollila
42afdf9193 Fixed some typos, whitespace, periods, 80-column lines
- typos: LINGUAS manually, rest with help of aspell(1)
- whitespace: some trailing spaces/tabs, one utf-8 NBSP (#xC2 #xA0)
- made most text in docs/ fit in max 80-column wide lines
- consistent trailing periods in sentences in labwc-actions.5.scd and
  labwc-config.5.scd; labwc-theme.5.scd had different consistency,
  changed it follow these other files with sentence-ending periods
- and ", respectively" (comma often used to separate)
2024-01-13 19:05:50 +00:00
Jens Peters
52b9b4292f docs: fix element ending 2024-01-12 21:01:29 -05:00
bi4k8
9d63c803d3 view: fix crash when a minimized fullscreen window closes
Do not call view methods after invalidating an invariant of the view
(view->scene_tree != NULL)
2024-01-11 20:56:47 +00:00
Johan Malm
e9023f51c6 menu: run actions on button release
...and call actions after closing menus so that virtual keyboard input
caused by actions are sent to the surface with keyboard-focus rather
than being consumed by the open menu.

Fixes: #1366
2024-01-11 20:31:24 +00:00
Jens Peters
cc8f4f943a docs: extend tablet section
Also change order to be in line with the xml elements.
2024-01-10 21:10:11 +00:00
Jens Peters
17e15ed987 seat: re-map tablet to output on output change 2024-01-10 21:10:11 +00:00
Jens Peters
8de5d7e653 seat: re-map tablet to output on reconfigure 2024-01-10 21:10:11 +00:00
Jens Peters
354c5cf967 seat: map tablet to output on init 2024-01-10 21:10:11 +00:00
Jens Peters
80075df0b7 seat: extract function 2024-01-10 21:10:11 +00:00
Jens Peters
cef2214023 seat: change order
More in line with other functions.
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
58ee4b7e07 config: change order
More in line with the xml structure.
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
67a984e9ae
Merge pull request #1419 from ahesford/bond-james-bond
view, xwayland: fixes for new size constraints
2024-01-09 21:56:45 +00:00
Andrew J. Hesford
6f72f4a368 xwayland: only constrain initial size for unsized clients 2024-01-08 20:13:08 -05:00
Andrew J. Hesford
313a80f6aa view: only constrain sizes for oversized views
...and ensure initial position is on the target display.
2024-01-08 20:12:55 -05:00
Andrew J. Hesford
417fa21a8e rcxml: avoid crash when checking environment for WLR_DRM_NO_ATOMIC 2024-01-08 19:28:03 -05:00
Johan Malm
78418b6dd3 xdg: rename function to align with xwayland.c
s/position_xdg_toplevel_view/set_initial_position/
2024-01-08 22:08:27 +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
72f3ce6b41 docs: extend supported mouse buttons 2024-01-06 19:37:41 +00:00
Jens Peters
e51c3fc5d4 config: reuse mousebind_button_from_str() 2024-01-06 19:37:41 +00:00
Jens Peters
4c59a8c3d7 config: add more mouse button definitions 2024-01-06 19:37:41 +00:00
Jens Peters
c4d6695bf1 docs: add tablet section 2024-01-06 19:19:40 +00:00
Jens Peters
ff5b00c170 docs: improve formatting 2024-01-06 19:19:40 +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
Ph42oN
1b5af86402 fix adaptive sync fullscreen 2024-01-06 15:37:18 +00:00
Tomi Ollila
785a34e8ad Fixed some typos 2024-01-04 19:32:51 +00:00
Consolatis
6cf19d1cdb src/theme.c: fix loading of alt_name hover icon
Fixes #1395
2024-01-03 20:07:38 +00:00
Consolatis
d86c7aad91 protocols: allow using a .wrap file
Fixes #1356
2024-01-03 20:05:57 +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