Commit graph

1340 commits

Author SHA1 Message Date
Johan Malm
2a9a378176 output: test adaptive sync
Required by https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3637
See also swaywm/sway@07bfeb2

Fixes #516
2022-11-15 21:58:18 +00:00
bi4k8
2b753a98b8 Support smooth scroll and horizontal scroll
note that this changes Scroll mousebinds from taking a "button"
attribute to taking a "direction" attribute
2022-11-15 21:57:36 +00:00
John Lindgren
6164ba73ff cursor: Make update_pressed_surface() no-op except during grabs
This matches Weston behavior more closely and fixes Firefox context
menus.
2022-11-15 21:56:48 +01:00
Johan Malm
f37a3ffa86 view: survive setting fullscreen with no outputs
Fixes #608
2022-11-15 05:48:17 +01:00
bi4k8
92a98164c3 src/config/rcxml.c: distinguish no and unknown font places
Currently, the `rc.xml` parser applies font settings in a `<font>` tag with an
unknown value for its `place` attribute to all fonts. This means that whatever
the final unknown-`place` `<font>` tag is in a user's `rc.xml` applies to all
text drawn by labwc.

Instead, only treat `<font>` tags with an empty or missing `place` attribute as
applying globally, and warn when encountering unknown `place` attribute values
(which will help us find font places to support).
2022-11-11 22:45:47 +01:00
bi4k8
9ed800c5a1 keyboard: use 1000/rate msecs for keybind repeat event source delay 2022-11-11 22:19:34 +01:00
John Lindgren
e848bd2f6b xwayland: Better document/assert view/surface association
Each XWayland view is paired with a particular wlr_xwayland_surface and
its lifetime is tied to that surface.  This condition in handle_map():

    if (xsurface != view->xwayland_surface)

could never be true since the view is only registered to receive the
"map" signal from view->xwayland_surface, and no other.  So the code
updating view->xwayland_surface in handle_map() was dead.

So let's clean things up a little:

- Remove the dead code
- Add some comments, and slightly rearrange code to match
- Add/update assert()s in signal handlers for consistency
- Pass xsurface as <data> when calling handle_unmap() and
  handle_destroy() explicitly, to be consistent
2022-11-11 15:56:13 -05:00
bi4k8
00002d67ea fix typo 2022-11-10 20:32:50 +01:00
Arnaud Vallette d'Osia
97dc681c3b src/cursor.c: Use 'handled' for state of consumed cursor actions 2022-11-06 22:03:50 +01:00
Arnaud Vallette d'Osia
bd4a0f15b8 Scroll-Bindings: Add docs 2022-11-06 22:03:50 +01:00
Arnaud Vallette d'Osia
209e09a1f6 Scroll-Bindings: Add default config
By default we switch workspaces when scrolling
on the desktop to match the Openbox behavior.
2022-11-06 22:03:50 +01:00
Arnaudv6
063a26ae9d Scroll-Bindings: Add support for mouse wheel bindings 2022-11-06 22:03:50 +01:00
Johan Malm
e45e2c7e60 Fix coding style 2022-11-03 23:01:52 +01:00
Johan Malm
6a242d5739 checkpatch: ignore += UNNECESSARY_ELSE 2022-11-03 23:01:52 +01:00
Johan Malm
4305f54e37 checkpatch: add scripts/check for batch processing
Co-Authored-By: @Consolatis
2022-11-03 19:20:23 +00:00
Johan Malm
a361bae699 checkpatch: patch to suit labwc coding style
Coding style specific changes include:

- Accept pango, glib and libxml2 CamelCase variables
- Remove "need consistent spacing around '*'" warning
- Do not warn about "structs that should be const"
- Do not warn on braces {} around single statements
- Do not warn about braces {} for single statement blocks
- Do not warn about wanting { on previous line for functions
- Remove check for missing blank line after declaration
- Ignore SPLIT_STRING COMPLEX_MACRO PREFER_KERNEL_TYPES
  LOGICAL_CONTINUATIONS PARENTHESIS_ALIGNMENT OPEN_ENDED_LINE
  MACRO_ARG_REUSE PREFER_FALLTHROUGH ARRAY_SIZE INITIALISED_STATIC

Other changes include:

- Do not complain about missing spelling.txt
- Print filename for each file, but no summary line
2022-11-03 19:20:23 +00:00
Johan Malm
b4b3e1b28d checkpatch: import checkpatch.pl from Linux kernel
https://raw.githubusercontent.com/torvalds/linux/4ce9f970457899defdf68e26e0502c7245002eb3/scripts/checkpatch.pl
2022-11-03 19:20:23 +00:00
Consolatis
1aeae4b57e Chase wlroots: output test assert
This fixes an assert on output test when
running with the headless backend.

To update the wlroots subproject use
meson subprojects update wlroots

Chases wlroots 05454618cd2d49fb3a5f0c560b0d2c455cf32467
xwayland: split headers

Fixes #605
2022-11-03 18:02:07 +00:00
John Lindgren
3b55b31070 keyboard: Implement key repeat for keybindings
It seems that every Wayland client is expected to implement its own
key-repeat logic, rather than doing it server-side as in X11.  This
means that labwc also has to implement its own key-repeat logic for
compositor keybindings.

This is a very simplistic timer-based implementation.  It doesn't
attempt to synthesize accurate timestamps, and may lag depending
on system load, but it appears to get the job done.

v2: Use server->wl_event_loop
v3: Comments and formatting
2022-11-02 21:52:33 +00:00
John Lindgren
b163045fa9 key-state: Prevent array overflow
- Prevent adding the same keycode more than once
- Prevent adding more keycodes than MAX_PRESSED_KEYS
2022-11-02 21:52:33 +00:00
Consolatis
ec8bc6e2d6 src/menu/menu.c: Add comments 2022-11-01 17:54:02 +01:00
Johan Malm
8909afcd7c README: add link to pre-0.6.0 video 2022-10-31 21:45:09 +00:00
Johan Malm
cce2fffa1d rcxml.c: combine common code in fill_{key,mouse}bind() 2022-10-30 18:26:45 +00:00
Johan Malm
e9c3080f76 rcxml.c: support 'to.action' in mousebind
...in support to specifying 'left', 'right' and so on with actions
GoToDesktop and SendToDesktop.

For example:

    <mouse>
      <default/>
      <context name="Desktop">
        <mousebind button="Up" action="Scroll">
          <action name="GoToDesktop" to="left"/>
        </mousebind>
        <mousebind button="Down" action="Scroll">
          <action name="GoToDesktop" to="right"/>
        </mousebind>
      </context>
    </mouse>
2022-10-30 18:26:45 +00:00
John Lindgren
5fb18a7016 xwayland: Hide unmanaged nodes on unmap()
Since xwayland commit 9e4b7948df5a9a67632bb606150ec171b5519672
there is a one-second delay between XWayland surfaces being
unmapped and destroyed.  This revealed that we were not actually
handling the unmap() signal correctly for unmanaged surfaces.
2022-10-27 15:03:13 -04:00
Consolatis
deb658b672 cursor: Restore drag icon after the move to scene-graph
Also move everything DnD related to src/dnd.c
2022-10-17 21:22:12 +01:00
Johan Malm
3e1a800c14 Add --exit and --reconfigure 2022-10-15 00:19:18 +02:00
Johan Malm
8c139e4185 Add long command line options 2022-10-15 00:19:18 +02:00
Johan Malm
ee00a897a4 server: do not set WAYLAND_DISPLAY twice 2022-10-15 00:19:18 +02:00
Johan Malm
22aa31cb7f labwc(1): describe SIGTERM and SIGHUP 2022-10-15 00:19:18 +02:00
Johan Malm
2c06b902f4 Set environment variable LABWC_PID
...to the pid of the compositor so that SIGHUP and SIGTERM can be sent to
specific instances using `kill -s <signal> <pid>` rather than
`killall -s <signal> labwc`

Issue #573
2022-10-15 00:19:18 +02:00
Johan Malm
3d8f528266 build: simplify protocol paths
No need for arrays here.

swaywm/sway@04f8a65
2022-10-15 00:09:21 +02:00
John Lindgren
cd970945f4 cursor: Call wlr_seat_pointer_notify_clear_focus() only if needed
@Consolatis determined that apparently the extra "clear focus"
event confuses the drag source during drag-and-drop.

Fixes drag-and-drop of files into folders within the same Thunar
window.
2022-10-14 21:56:34 +01:00
01micko
cfdf60b1da Chase wlroots: unreadable displays
This fixes an issue of unreadable displays in some
multiple output configurations.

To update the wlroots subproject use
meson subprojects update wlroots

Chases wlroots 694e9bbb9d7114f39311d93e885e010606a88dae
backend/drm: allocate connector CRTC on lease creation

Fixes #583
2022-10-08 01:27:56 +02:00
Johan Malm
54b34e5bd7 CONTRIBUTING.md: describe coding style more accurately
- Clarify the coding style relative to Linux kernel and Devault rules
- Add g_pattern_match_simple() example
- Add namespace advice and preference
- Elaborate on preferred header documentation style.
- Add table of contents
- Simplify API section and add wl_list_append()
2022-10-05 20:16:06 +01:00
Consolatis
89ad0b808f s/wl_list_insert(list.prev...)/wl_list_append(list...)/ 2022-10-05 19:50:36 +01:00
Johan Malm
042af48925 common: add wl_list_append() 2022-10-05 19:50:36 +01:00
Johan Malm
cc5d364f0f NEWS.md: update notes on 0.6.0 2022-09-30 07:23:09 +01:00
Consolatis
2aa00d9ab2 CI: Switch Void mirror to repo-ci.voidlinux.org 2022-09-30 05:31:03 +02:00
Consolatis
d15f30057e Chase wlroots: output cursor
To update the wlroots subproject use
meson subprojects update wlroots

Chases wlroots 68c8cef38edafa5e52532e0b43a4888554168361
cursor: Don't warp to (0,0) when last output is disconnected

Fixes #561
2022-09-29 14:10:21 +02:00
Consolatis
d0fd7b42df CI: FreeBSD switch from 'quarterly' to 'latest'
Latest wlroots requires libdrm-2.4.113 but 'quarterly' only
provides libdrm-2.4.112. Switch to 'latest' to fix this.
2022-09-29 14:10:21 +02:00
Consolatis
92976f30d0 src/osd.c: Ensure destroying views are not used as preview anchors 2022-09-27 17:35:10 +01:00
Consolatis
c83c1beace src/osd.c: Prevent showing invalid windows
This might happen when closing the last
application "to tray" like VLC, Discord or Steam.

Reported-by: @Flrian
2022-09-27 17:35:10 +01:00
Johan Malm
f2277c37c3 keyboard: put modifier/key listeners in keyboard struct
...so that it can be determined what wlr_keyboard events come from.

This is required to manage virtual keyboards alongside the keyboard_group
of physical keyboards.
2022-09-27 17:31:00 +01:00
Joshua Ashton
76d5fb1dda seat: implement virtual keyboard protocol 2022-09-27 17:31:00 +01:00
Joshua Ashton
4b8d0ba4b2 seat: implement virtual pointer protocol 2022-09-27 17:31:00 +01:00
Joshua Ashton
065b015fbb seat: add seat_add_device helper 2022-09-27 17:31:00 +01:00
Joshua Ashton
d7d11a079a seat: add seat_update_capabilities helper 2022-09-27 17:31:00 +01:00
Johan Malm
d83c58919f view: no gap for top/left align big window
On initial positioning of toplevel windows we call view_center().
During the centering process, if it turns out that the view is larger than
the output usable-area then we just top/left align it with no gap.

Relates to the gap aspect of issue #403

Reported-by: @Flrian
2022-09-27 17:26:51 +01:00
Consolatis
c4b85041ba CI: Add Debian testing 2022-09-23 22:12:20 +02:00