Commit graph

2574 commits

Author SHA1 Message Date
Johan Malm
44d1e199db tests: add buf_add_char() test
...to prove off-by-one test with ASAN.
2024-11-07 23:34:48 +01:00
John Lindgren
62a25da575 output: factor out configure_new_output() from new_output_notify()
... to make it possible in future to *not* immediately auto-configure
new outputs when connected. No functional change intended at this time.
2024-11-06 20:46:50 +00:00
John Lindgren
c38cb5f59c output: move a few calls from new_output_notify()
... to more specific/logical locations, to make it possible in future to
*not* immediately auto-configure new outputs when connected.

In particular:

- Move regions_reconfigure_output() and session_lock_output_create()
  into add_output_to_layout(), which would be called also if the output
  is enabled later.

- Move seat_output_layout_changed() to do_output_layout_change() so it
  is called for any layout change, not just adding new outputs.
2024-11-06 20:46:50 +00:00
Tomi Ollila
f052eaea6f menu: use only menu_separator_padding_width to pad separators w/o label
I.e. drop the extra padding from menu_item_padding_x that got there
when separators with labels were implemented.
2024-11-06 20:40:28 +00:00
Consolatis
aaf60b3520 CI: add discussion category to IRC notification 2024-11-06 14:36:58 +01:00
Consolatis
02e85b8298 CI: add IRC notification for discussion created 2024-11-06 14:22:25 +01:00
Weblate
0137ffaf8c Translation updates from weblate
Co-authored-by: Roberalz <lumintnian@outlook.com>
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/es/
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/eu/
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/gl/
Translation: Labwc/labwc
2024-11-05 17:55:23 +00:00
Ricardo Steijn
8f940358e4
tearing: avoid permanent disable due to rejected commits (#2295)
Currently, the cursor plane does not allow async page flips which causes tearing page flips to be rejected if the cursor was moved.

However, in games where no cursor image is present, the async page flips can still work as expected.

Instead of permanently disabling tearing after too many failures, test the output state first before each frame to see if we can commit with tearing_page_flip set to true.
2024-11-03 21:05:46 +00:00
Johan Malm
c29d8a2174 Add github issues template 2024-11-03 20:20:27 +00:00
tokyo4j
49587d48d6 docs: add documentation for window.button.height 2024-11-03 20:14:33 +09:00
Andrew J. Hesford
14aad38a2c query: fix three-state-parameter parsing, simplify match logic
Fixes: #2288.
2024-11-01 12:52:10 -04:00
Andrew J. Hesford
2b877d2293 config/rcxml.c: fix parsing of three-state query parameters 2024-10-30 21:53:23 -04:00
Orfeas
96da82c085 query: support additional conditions for matching clients
Co-authored-by: Andrew J. Hesford <ajh@sideband.org>

Closes: #2245.
2024-10-30 14:30:26 -04:00
John Lindgren
f394d03600 session-lock: make session_lock_output_create() safe to call twice
session_lock_output_create() can safely no-op if the lock output has
already been created for the specified output. This scenario doesn't
happen currently, and the change is in preparation for some other
output-related changes I am working on. But I think it's a nice code
improvement worth merging separately.
2024-10-29 21:41:48 +00:00
John Lindgren
7912665b0f output: remove ported wlr_output functions
We have several wlr_output_* functions which are just wrappers around
corresponding wlr_output_state_* functions and don't actually touch the
wlr_output itself. These probably made some sense historically, but IMHO
they are just confusing now. So remove them and call wlr_output_state_*
directly.

Rename wlr_output_commit() (still useful) to output_state_commit().
2024-10-29 21:39:19 +00:00
Simon Long
45a9bd95e7
Add mouse emulation for touch devices (#2277) 2024-10-29 19:22:01 +00:00
01micko
4d3efb4339 src/main.c: add environment variable LABWC_VER
src/config/session.c add env var LABWC_VER
This could be useful going forward for helper programs
such as `labwc-menu-generator` or `labwc-tweaks`
2024-10-28 21:40:01 +00:00
Johan Malm
3b00aabd93 keyboard: broadcast modifiers
...to all clients rather than just the one with keyboard focus on keyboard
enter/create, modifer press/release and wlr_seat_set_keyboard().

This enables:

- Clients such as panels to display the current keyboard layout without
  introducing new wayland protocols or other IPC.

- Unfocused xdg-shell clients to understand button press with keyboard
  modifiers for example Ctrl+click.

The keymap is forwarded to all clients in wlr_seat_set_keyboard(). When a
keymap contains multiple layouts, the selection is made via modifiers,
which previously were only sent to the client with keyboard focus.

Tested with: https://github.com/johanmalm/keyboard-layout

Ref: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4496

Fixes: #2271
2024-10-28 19:11:45 +00:00
Tomi Ollila
ad2d24fb42 menu: use "MenuHeader" font height in separators with label 2024-10-28 19:06:32 +00:00
Weblate
6cb8f18fe1 Translation updates from weblate
Co-authored-by: Peter  Jespersen <flywheel@illogical.dk>
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/da/
Translation: Labwc/labwc
2024-10-27 16:12:32 +00:00
Johan Malm
6bd36e8512 build: bump version to 0.8.1 2024-10-25 19:51:27 +01:00
Johan Malm
c00cdf2616 NEWS.md: update for 0.8.1 2024-10-25 19:28:50 +01:00
Johan Malm
3a4e0cf981 build: require libsfdo >=0.1.3 2024-10-24 23:10:08 +02:00
Johan Malm
e912964f73 menu: fix UAF in client-list-combined-menu after window destruction
Update client-list-combined-menu when a window is destroyed to avoid
SEGFAULT when selecting an that window entry in it.
2024-10-24 20:52:17 +01:00
Tomi Ollila
2b1a694154 docs: replace two 'we's with passive forms
To match the common style in docs/
2024-10-22 06:04:29 +01:00
Consolatis
5d595e034a src/icon-loader.c: skip non application entries for wmclass lookup
Fixes: #2254
2024-10-20 22:52:19 +02:00
Jens Peters
e67fda50cf input: add comments about tablet mouse emulation 2024-10-20 21:51:02 +01:00
Hiroaki Yamamoto
c6a6be8219
src/action.c: fix client-send-to-menu not properly updated (#2246)
Before this commit, client-menu needed to be opened for
client-send-to-menu to be updated.
2024-10-20 09:58:09 +01:00
Hiroaki Yamamoto
bb87ca5493
menu: fix memory leak in update_client_send_to_menu() (#2252) 2024-10-20 09:44:32 +01:00
Hiroaki Yamamoto
1d79e34c2b
menu: fix the calculation for centered titles (#2251) 2024-10-20 09:41:53 +01:00
Johan Malm
c237ffa667
cursor: guard against NULL dereference (#2250)
...in apply_constraint()

Reported-by: Blackb|rd
2024-10-19 19:44:50 +01:00
Johan Malm
6918169aa3
icon-loader: use relaxed load options (#2248) 2024-10-19 19:44:24 +01:00
Hiroaki Yamamoto
a567b4dc3b
cursor: send a frame event after emulated button events (#2244)
This fixes the issue that emulated tablet/touchscreen button events
sometimes don't take effect on applications immediately.
2024-10-17 20:12:15 +01:00
Johan Malm
da68df5f5b NEWS.md: interim update 2024-10-14 21:11:54 +01:00
tokyo4j
5f3600b0b8 src/theme.c: fix misuse of wl_list_for_each
The iterator value of `wl_list_for_each` should never be referenced
outside the loop because it points to invalid memory location when the
list is empty.
2024-10-14 20:02:26 +01:00
Johan Malm
1934d0bf09 theme: tidy up documentation 2024-10-14 18:07:13 +09:00
tokyo4j
7cc79edd62 cursor: fix button release events sometimes not being sent
When `wlr_seat_pointer_notify_button()` is called on a button press event,
that funtion must also be called on the subsequent button release event
because otherwise wlroots thinks the button is kept pressed and it
causes issues with validating DnD requests from clients, where only one
button must be pressed. This was the case when a CSD client opens a
client-menu via `show_window_menu` request after pressing its window with
the right button because we were always not notifying button release
events while a menu is open.

So let's keep track of bound (pressed but not notified) buttons and notify
button release events only when the button is not bound, like we are doing
for key-state.
2024-10-13 20:45:16 +01:00
tokyo4j
e0848da70d key-state.c: generalize set operations 2024-10-13 20:45:16 +01:00
Jens Peters
c4aa3fe3e6 server: add dmabuf feedback
Co-authored-by: Consolatis <35009135+Consolatis@users.noreply.github.com>
2024-10-13 13:54:34 +01:00
Weblate
84c811ee08 Translation updates from weblate
Co-authored-by: bittin <bittin@reimu.nl>
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/sv/
Translation: Labwc/labwc
2024-10-13 12:50:07 +01:00
tokyo4j
fe6b3c1c35 theme: replace *.hover.bg.shape with *.hover.bg.corner-radius 2024-10-13 12:31:51 +01:00
Johan Malm
1f1ac27bf5
Merge pull request #2189 from johanmalm/window-button-height
Titlebar related breaking changes
2024-10-09 07:04:09 +01:00
tokyo4j
2055e6d92c theme: round the corner button correctly
The rounded mask buffer to be applied to the corner button buffer should
be resized and shifted when there's a vertical gap between the button
and the window border.
2024-10-09 06:51:32 +09:00
Johan Malm
707c188975 ssd: minor logic simplification
No functional change intended
2024-10-08 21:28:17 +01:00
Johan Malm
e16e78e7a4 theme: add window.titlebar.padding.{width,height}
...to replace padding.{width,height} to minimize breaking changes with the
visual appearance of the titlebar.

With the diverging labwc specification for the titlebar (listed below)
we have to choose between (a) not supporting the padding.{width,height}
option which exist in many extant Openbox themes to keep titlebar height
(almost) the same; or (b) making the allocated button areas much smaller
and not keeping the default hover going all the way to the edges. All in
all it just seems a lot simpler and cleaner to break this link to the
openbox spec.

Examples of previous change driving the requirement for this change:

- SVG and PNG support which often results in large icons with hover
  effects.
- Theme option window.button.{height,width}
- Larger default areas for icons (26x26)

In way of an example, Numix theme sets a padding.height of 6 which would
have resulted in a titlebar 12px taller without this change.
2024-10-08 20:04:05 +01:00
Johan Malm
383fb20bf4 theme: change padding.height default to 0
...because now that window.button.height determines the height of button
hover effect the visible appearance of the titlebar will change unless
we reduce the padding to zero.

Backward compatibility notice: If a users theme sets padding.height to a
value greater than zero, the titlebar will be taller compared with
openbox. This can be fixed by either reducing window.button.height or
overriding padding.height
2024-10-08 20:04:05 +01:00
Johan Malm
3a61cd89dd theme: derive titlebar height from its objects
...including the new window.button.height
2024-10-08 20:04:05 +01:00
Johan Malm
2884f77b30 theme: remove titlebar.height option
This theme setting does not exist in Openbox spec and has just been an
additional 'knob' to tweak the height which is otherwise derived from the
sizes of the objects within it plus padding.
2024-10-08 20:04:05 +01:00
Johan Malm
0aa4cfe32d theme: add window.button.height
window.button.{height,width} determine the space allocated for buttons.
Buttons can be smaller than this size and will then just be center aligned
within the allocated space. However, buttons will be clamped at this size
to prevent them from going outside of the allocated space.
2024-10-08 20:04:05 +01:00
Johan Malm
be18050479 xdg-shell: fix popup on wrong output 2024-10-08 07:34:25 +09:00