Commit graph

3022 commits

Author SHA1 Message Date
tokyo4j
6f70cd0d6e layers: don't send configure events in unmap handler
Alternative to 7bf08af which was reverted in the previous commit.

7bf08af fixed the problem that layer-shell clients are terminated when
it's unmapped, by sending configure events in node-destroy handler
rather than in unmap handler. But it caused a UAF bug when an output
with layer-shell clients is destroyed.

So this patch fixes the original issue by simply skipping the surface in
arrange_one_layer() if it's being unmapped.
2025-06-27 22:03:37 +01:00
tokyo4j
cc0fe78ceb Revert "layers: arrange layers on destroy"
This reverts commit 7bf08af210.
2025-06-27 22:03:37 +01:00
Weblate
d1f7d3a320 Translation updates from weblate
Co-authored-by: Weblate <noreply@weblate.org>
Co-authored-by: mirek <mirek.binas@gmail.com>
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/sk/
Translation: Labwc/labwc
2025-06-27 21:26:19 +01:00
Consolatis
448c61a295 scaled-icon-buffer: reduce the need for updates 2025-06-27 14:05:42 +02:00
Consolatis
acd2a23f1b scaled-icon-buffer: add icon priority
Co-Authored-By: tokyo4j <hrak1529@gmail.com>
2025-06-27 14:05:42 +02:00
Sumandora
e72f862650
src/workspaces.c: allow dragged views to be moved to other workspaces 2025-06-27 13:30:30 +02:00
tokyo4j
d12751c781 ssd: work around the translucent titlebar in pixman renderer
Due to wlroots/pixman bug, the widened 1px buffer for the gradient
titlebar become translucent with WLR_RENDERER=pixman and
WLR_SCALE_FILTER_BILINEAR filter mode. This patch works around this
problem by using WLR_SCALE_FILTER_NEAREST filter mode if pixman
renderer is used.
2025-06-27 16:21:25 +09:00
Johan Malm
aedf279656 NEWS.md: interim update 2025-06-26 19:45:26 +01:00
tokyo4j
e5a236eef4 ime: revert workarounds for wlroots 0.18.2
The workarounds added in #2498 and #2437 fixed stuck key/modifier bug
caused by wlroots commit e218990. But now that the commit was reverted in
0.19, the workarounds are no longer needed.

Removing the workarounds also fixes a minor regression with Fcitx5+Firefox
that pressing Ctrl+Enter in an input box causes stuck modifier.
2025-06-26 03:20:11 +09:00
Johan Malm
db7c72ef39 labwc-theme(5): document x11-color-names 2025-06-24 01:09:30 -04:00
Johan Malm
4fd5d7747e README.md: update keybind section 2025-06-23 21:33:15 +02:00
Johan Malm
fda63058b2 config: use Super modifier instead of Alt for default mousebinds
...A-Left and A-Right (for move and resize) to avoid interfering with some
clients like CAD programs and games.
2025-06-22 20:43:30 +01:00
Johan Malm
e62f403f56 config: deprecate A-F3
...because A-F3 is too close to A-F4 and it is better to be agnostic to
choice of launcher.
2025-06-22 20:43:30 +01:00
Johan Malm
26a9c637d8 config: deprecate A-<arrow> keybinds
...because Alt- keybinds should be for clients to use and the A-<arrow>
default combination is a frequent user complaint because it prevents some
common usage patterns like alt-left/right in web browers.
2025-06-22 20:43:30 +01:00
daniel
26192a9b5a README.md: improve the documentation 2025-06-19 20:40:28 +01:00
Johan Malm
6117e85820 theme: change builtin menu fallback button to arrow 2025-06-18 21:15:56 +01:00
Johan Malm
84858967e4 docs: document gradients
(v2: small fixes)
2025-06-18 15:48:24 -04:00
John Lindgren
ec145a14ca theme: support basic vertical titlebar gradients
Only Vertical and SplitVertical gradients are supported,
and only for window.*.title.bg.

Not supported at this time:

- horizontal or diagonal gradients
- gradients for window.*.label.bg, buttons, or menus
- any type of border (raised, sunken, etc.)
2025-06-18 15:48:24 -04:00
John Lindgren
990706b081 ssd: allow arbitrary cairo pattern as titlebar background
The titlebar background is now first rendered to a 1px wide buffer,
then stretched horizontally. This allows vertical gradients to be used.
2025-06-18 15:48:24 -04:00
John Lindgren
54b236e027 common/font: add scaled_font_buffer_create_for_titlebar()
Co-authored-by: tokyo4j <hrak1529@gmail.com>
2025-06-18 15:48:24 -04:00
John Lindgren
3ca7adace0 common/graphic-helpers: add a few cairo pattern helpers 2025-06-18 15:48:24 -04:00
John Lindgren
ee6f9a6baa theme: parse more color string formats for Openbox compatibility 2025-06-18 15:48:24 -04:00
John Lindgren
c4bae87c04 common/graphic-helpers: adopt lookup_named_color from xpm parser 2025-06-18 15:48:24 -04:00
Consolatis
30248e1ba3 Destroy xdg_popups when its parent is destroyed
Fixes: #2845
2025-06-18 20:19:48 +01:00
Consolatis
a8df2487b2 xwayland: support _NET_WM_ICON 2025-06-18 14:31:05 +09:00
Jens Peters
e0d3bebbb7 input: clear SSD hover effects after touch-up
Having a hover effect visible without interaction looks out of
place when there is no cursor (the cursor becomes hidden for/after
touch interaction until next mouse or tablet interaction). Just
clear the hover effect after touch-up to prevent this.
Note that SSD hover effects are still shown during touch-move and
touch-down.
2025-06-16 22:56:46 +02:00
Jens Peters
31dd21de5b input: use mouse emulation for touch when labwc menu is open
Only use the touch protocol when no labwc menu is open.
This ensure that labwc menus will be closed on first touch
down/up since cursor emulation takes care of closing a
menu.
This prevents that a labwc menu stay open during touch
interactions in native touch mode.
2025-06-14 14:07:35 +01:00
Jens Peters
bdd1b8dc60 input: handle tablet tool creation internally
No need anymore to expose this function.
2025-06-14 13:45:51 +01:00
Jens Peters
6f6fcbc2e1 input: move tablet tool functions into tablet.c
Just a big move and a rename of the tablet tool destroy handler.
2025-06-14 13:45:51 +01:00
Jens Peters
b3c1ef41c3 input: remove zero initialization
This is already done by `znew()`.
2025-06-14 13:45:51 +01:00
Jens Peters
9cf9e129e1 input: move tablet axis members to tablet tool
It doesn't matter much since those are about the combination
of tablet and tablet tool. That said, this feels slightly more
natural.
As a consequence we always create a tablet tool and decide
indirectly via `tablet_get_coords()` and the returning surface
if mouse emulation should be used or not. Now we can also
add a `motion_mode` to the tablet tool which is slightly cleaner.
2025-06-14 13:45:51 +01:00
tokyo4j
ab9cf4dc97 Bump xdg-shell version from 3 to 6
- Send xdg_toplevel.wm_capabilities
- Send xdg_toplevel.configure_bounds so that clients can map a window that
  fits within the usable area, without relying on
  view_constrain_size_to_that_of_usable_area() which is called after map.
- (The new "suspended" state should be handled by wlr_scene in the future)
2025-06-13 20:43:12 +01:00
Johan Malm
145de91932 config: add <core><primarySelection>
...to enable/disable primary selection clipboard support. This only works
on launch.

The reason it is useful to be able to disable this is that some clients
(like browsers) support middle-button-click to start scrolling up/down.

With some clients can be disabled via

   gsettings set org.gnome.desktop.interface gtk-enable-primary-paste false

...but for others (like chromium and electron based programs) a compositor
setting is required.

Fixes: #2815
2025-06-13 20:27:49 +01:00
Jens Peters
c63ba3c7fa cursor: omit pointer cursor shape for tablet tool
Omit cursor notifications from a pointer when a tablet
tool (stylus/pen) is in proximity. This is equivalent
to `handle_request_set_cursor()` and prevents a resize
cursor for out-of-surface scrolling with a tablet tool in
recent GTK4 (which uses the cursor shape protocol).
2025-06-13 19:24:20 +01:00
John Lindgren
9782ffa868 desktop: give focus to a modal dialog rather than its parent
Fixes: #2722
2025-06-13 18:40:29 +01:00
Consolatis
ea1df930e9 Wayland protocols: support ext_data_control_manager_v1 2025-06-13 17:44:16 +01:00
Consolatis
1f1e8dbf64 Wayland protocols: support wp_alpha_modifier_v1 2025-06-13 17:44:16 +01:00
Consolatis
f08a56aac9 server.c: prefix protocol version define with LAB_ 2025-06-13 17:44:16 +01:00
Consolatis
ba604e3a8c scene-helpers: use wlr_scene_output_needs_frame 2025-06-13 18:37:44 +02:00
John Lindgren
5a50a02ba3 xwayland: fix possible loss of focus when multiple views are unmapped
Due to the asynchronous nature of view_offer_focus(), there was a race
condition that could result in no view remaining active when multiple
views were unmapped at once. Check for this and prevent it.
2025-06-12 20:33:25 +01:00
John Lindgren
1b937ed247 xwayland: correctly return seat focus from menus/tooltips in CLion
CLion's main window uses the Globally Active input model, and since
8fb2ecefcb it is given focus asynchronously via view_offer_focus().
However, we need to return seat focus immediately after an unmanaged
surface (e.g. popup) is unmapped, or focus is lost completely.
2025-06-12 20:33:25 +01:00
John Lindgren
5a1466d355 xwayland: handle rare case of focus_in event occurring before map
This fixes a timing-dependent issue where the CLion main window was
sometimes not correctly focused at startup.
2025-06-12 20:33:25 +01:00
Johan Malm
d7f1b021b3 NEWS.md: interim update 2025-06-10 20:06:18 +01:00
John Lindgren
8fb2ecefcb xwayland: always offer focus in Globally Active case
In 9e3785f8cd, a heuristic was added to assume that NORMAL and DIALOG
window types were always focusable. (This was before we had the "offer
focus" mechanism in place.)

However, we should still call wlr_xwayland_surface_offer_focus() for
these views, in case they actually don't want focus. (This is uncommon
but has recently been seen with WeChat popups, which have both NORMAL
and UTILITY type.)

To make this possible, refine view_wants_focus() to return either
LIKELY or UNLIKELY for Globally Active input windows. This decouples
the question of "should we try to focus this view" from the actual
mechanism used to do so.
2025-06-10 11:03:54 -04:00
tokyo4j
97ce4131bb Replace scaled_rect_buffer with lab_scene_rect
This fixes the gap between menu items and the menu border in an output
with a fractional scale due to the semantic gap between cairo and
wlroots's position-independent scene renderer.
2025-06-10 06:03:03 +09:00
tokyo4j
ffd400503e Replace multi_rect with lab_scene_rect
lab_scene_rect accepts the arbitrary number of borders and a background
color.
2025-06-10 06:03:03 +09:00
tokyo4j
4cc6b354b0 server: remove server->sig{int,term,chld}_source in server_finish() 2025-06-09 21:57:51 +01:00
tokyo4j
85388d194e server: eliminate use of global vars 2025-06-09 21:57:51 +01:00
tokyo4j
88b15f1ca6 Bump wl_compositor version from 5 to 6 2025-06-09 21:56:08 +01:00
tokyo4j
0bae05b964 CI: use wlroots019 package for FreeBSD 2025-06-09 19:45:14 +02:00