Commit graph

3043 commits

Author SHA1 Message Date
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
tokyo4j
667755ed1a CI: use wlroots0.19 package for Arch Linux 2025-06-09 19:45:14 +02:00
Jens Peters
33fc1c6d05 input: emulate cursor axis for tablet tool mouse
We only have to deal with non-high-res mouses, so we can
emulate it even without having delta_discrete being
exposed by wlroots.
2025-06-08 05:31:23 +09:00
Jens Peters
8584e073de input: always use mouse emulation for tablet tool mouse
Using mouse emulation for a tablet tool mouse is just a practical
decision to let such a tool work more smootly, e.g. it avoids weird
menu issues in GTK applications. Since such a tool doesn't have
pen specifix axis like pressure or distance, no functionality is lost.

A solution fully in line with the protocol, which would pass the tool
mouse buttons to the client, would leave us with  e.g. non-working
buttons in current GTK4 since they don't handle the buttons
reported from the tool mouse.
May be this changes in future. But for now, let's just be practical.
2025-06-08 05:31:23 +09:00
Jens Peters
cf032b1fc1 input: do not bind motion mode to tablet
Instead, always derive it from the current tool. This prevents any
mismatches when working with multiple tools.
2025-06-08 05:31:23 +09:00
Jens Peters
36c1948d0b input: add tool_v2 NULL check
Should be quite unusual, but tool_v2 can be NULL.
2025-06-08 05:31:23 +09:00
Jens Peters
a73b866129 config: support tablet tool mouse buttons
Those are regular mouse buttons, but attached
to a tablet tool (which looks like a mouse).
2025-06-08 05:31:23 +09:00
Jens Peters
1859d5f113 config: formatting to improve readability 2025-06-08 05:31:23 +09:00
may
e96b5af42d libinput: implement threeFingerDrag feature 2025-06-07 21:30:07 +09:00
tokyo4j
22d319cce8 libinput: support <dragLock>sticky<dragLock> and enable it by default
It is recommended by libinput:
https://lists.freedesktop.org/archives/wayland-devel/2024-November/043860.html
2025-06-07 12:46:53 +01:00
tokyo4j
cc84cee75b scaled-icon-buffer: don't render twice in scaled_icon_buffer_set_view() 2025-06-07 08:54:34 +01:00
tokyo4j
624cf85afe view: simplify freeing of view->icon 2025-06-07 08:51:37 +01:00
Consolatis
74018495cd view.c: free icon name on view destroy 2025-06-07 08:33:22 +01:00
Consolatis
4d79f0057f Ensure the view signals are initialized early
This prevents a crash observed by the scaled-icon-buffer listening
to the `view->events.set_icons` signal before it is initialized.
For this to happen, the application needs to use the kde decoration
protocol and set it on the xdg_surface before creating the xdg_toplevel.

Fixes: #2798
2025-06-07 05:03:57 +02:00
Johan Malm
6cb34f994c labwc-config(5): add example to unset mousebind 2025-06-06 23:46:33 +02:00
tokyo4j
073d8c39c1 scaled-icon-buffer: fix window icons not loaded after Reconfigure
This patch fixes the issue that window icons become the fallback
one after Reconfigure, by setting scaled_icon_buffer->view_app_id (and
other properties) in scaled_icon_buffer_set_view().

The reason why the window icons were displayed before Reconfigure is that
applications usually enable decorations and then set app_id which fires
handle_view_set_icon().
2025-06-06 21:47:43 +02:00
tokyo4j
fb077c0095 Support xdg-toplevel-icon protocol
This patch also changes the semantics of scaled_icon_buffer: rather than
calling scaled_icon_buffer_set_app_id() every time an app_id is set, we
can now call scaled_icon_buffer_set_view() just once so that multiple
scaled_icon_buffers bound to a window are automatically updated when an
app_id is set or new icon is set via xdg-toplevel-icon-v1.
2025-06-07 02:12:56 +09:00
tokyo4j
649773b4f8 buffer: add buffer_create_from_wlr_buffer() 2025-06-07 02:12:56 +09:00
tokyo4j
82b0235aca buffer: add buffer_resize() 2025-06-07 02:12:56 +09:00
tokyo4j
0657a1d767 view: add destroy signal 2025-06-07 02:12:56 +09:00
DreamMaoMao
614c008bea feat: add left-occupied and right-occupied to workspaces_find 2025-06-06 18:35:32 +02:00
DreamMaoMao
5cf4aa83e2 view.c: add new NO_OMNIPRESENT criteria 2025-06-06 18:35:32 +02:00
dd
c5b9e2665d
ssd: add configurable drop-shadows for tiled windows 2025-06-05 22:46:58 +02:00
John Lindgren
0908bb5dd1 xdg: add missing tracking of configure serials
In some cases, we would schedule a configure event but not record that
we had done so, leaving view->pending_configure_serial incorrect. This
caused incorrect handling of in-flight commits that had not yet taken
the new configure into account, such as assuming that the client had
ignored the configured size and incorrectly resetting view->pending.

Fixes: #2774
2025-06-05 05:49:17 +09:00
Johan Malm
ea294dbcf5 labwc-config(5): describe environment file comment syntax 2025-06-03 17:23:14 +01:00
Johan Malm
7bf08af210 layers: arrange layers on destroy
...rather than unmap because that is the approach of sway and it also
avoids wshowkeys crashing.

Fixes: #1153
2025-06-02 22:00:43 +01:00
Consolatis
ca94abbef1 CI: wlroots package for Arch has been renamed 2025-06-01 23:34:46 +02:00
tokyo4j
949d769198 docs: update documentations for osd fields 2025-05-29 11:19:26 +09:00
tokyo4j
f2be08822f osd: always show output name with <field content="output">
Before this patch, output names were not shown if there's only one output.
2025-05-29 04:10:55 +02:00
tokyo4j
a157999925 osd: always show title with <field content="title">
Before this patch, titles were not shown if they are identical to the
identifiers.
2025-05-29 04:10:55 +02:00