Commit graph

1357 commits

Author SHA1 Message Date
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
Johan Malm
d424514e24 Fix minor coding-style violations
...based on https://github.com/johanmalm/checkpatch.pl
2022-09-22 22:39:44 +01:00
Johan Malm
439cf4f848 CONTRIBUTING.md: improve all sections
...including guidelines on:

- the use of glib
- the use of GNU C extensions
- what commit messages should look like
- coding-style
2022-09-22 22:35:09 +01:00
Consolatis
2c83a5fcb8 cursor: Prevent setting cursor icon on drag
Partly fixes #549
2022-09-21 21:55:28 +01:00
Johan Malm
76d8982d3e
Merge pull request #438 from johanmalm/fix/repeat
Revert "keyboard: cancel repeat when handling key-bind" and
only pass on pressed+sent keycodes to surfaces on keyboard-focus.
2022-09-21 21:35:06 +01:00
Johan Malm
de99a8ba33 seat: only pass on sent keys on surface-focus
Key events associated with keybindings (both pressed and released) are not
sent to clients. When using wlr_seat_keyboard_notify_enter() it it
therefore important not to send the keycodes of _all_ pressed keys, but
only those that were actually _sent_ to clients (that is, those that were
not bound).

This approach is consistent with sway's implementation in input/seat.c
cffb006feb/sway/input/seat.c (L173-L175)

Fixes issue #510
2022-09-21 21:25:13 +01:00
Johan Malm
4108313f96 src/keyboard.c: register keys before inhibit check
Call key_state_set_pressed() before checking
seat->active_client_while_inhibited to avoid missing release events for
clients using the inhibit protocol (for example swaylock).
2022-09-21 21:25:13 +01:00
Johan Malm
20c4ffa539 src/keyboard.c: do not end window-cycling on modifier release only
If a user lets go of the modifier (e.g. alt) before the 'normal' key (e.g.
tab) when window-cycling, we do not end the cycling until both keys have
been released.  If we end the window-cycling on release of the modifier
only, some XWayland clients such as hexchat realise that tab is pressed
(even though we did not forward the event) and because we absorb the
equivalent release event it gets stuck on repeat.

Just to clarify the position here: Issue #176 describes a behaviour
whereby dmenu gets stuck on repeat after being launched with a keybind.
This patch does not resolve that issue but reflects that in Wayland, the
client is responsible for implementing "key repeat".

Changing the key repeat rate/delay in (labwc/labwc@e62bb51) was dirty fix
that need should never have been made.
2022-09-21 21:25:13 +01:00
John Lindgren
7233495c3a output: Call do_output_layout_change() at end of new_output_notify().
This fixes an issue with the wlr_output_cursor not being properly
initialized on new outputs, because wlr_output_layout.events.change
is triggered too soon, before the wlr_output_cursor exists.
2022-09-21 07:33:00 +02:00
Consolatis
dcedfee5d1 src/menu.c: Clamp separator width
Reported-by: @Flrian
2022-09-20 21:06:31 +01:00
Johan Malm
ffb2efe733 src/keyboard.c: reflow comment to shorten line 2022-09-20 20:52:48 +01:00
Johan Malm
e1467b9aac src/keyboard.c: stored handled keys as bound when window-cycling
...and changing TTY
2022-09-20 20:52:48 +01:00
Johan Malm
a363f73e02 Revert "keyboard: cancel repeat when handling key-bind"
This reverts commit e62bb51bfb.

Fixes #510
2022-09-20 20:52:48 +01:00
Consolatis
87fe6878a3
Merge pull request #552 from jlindgren90/xmalloc
common: Add more friendly memory utilities
2022-09-19 05:43:55 +02:00
John Lindgren
8f585362c1 common: Expand comment for znew/znew_n() 2022-09-18 17:30:53 -04:00
John Lindgren
a54d378e6c common: Add znew/znew_n() macros 2022-09-18 15:25:19 -04:00
John Lindgren
898a583522 keyboard: Fix SIGSEGV that showed up in out-of-memory fuzzing
Stack trace:

    #0  xkb_keymap_ref (keymap=keymap@entry=0x0) at ../libxkbcommon/src/keymap.c:61
    #1  0x00007f53a344ab99 in wlr_keyboard_set_keymap (kb=kb@entry=0x5571af8cb9a0, keymap=keymap@entry=0x0)
        at ../types/wlr_keyboard.c:174
    #2  0x00005571ade057e0 in keyboard_init (seat=0x7ffca0389680) at ../src/keyboard.c:229
    #3  seat_init (server=0x7ffca0389570) at ../src/seat.c:307
    #4  server_init (server=0x7ffca0389570) at ../src/server.c:308
2022-09-18 06:05:16 +02:00
John Lindgren
da57483961 action: Fix warning about freeing a (const char *) 2022-09-17 10:57:30 -04:00
John Lindgren
cb40cdc36c common: Add additional memory utilities (xzalloc() etc.) 2022-09-17 10:57:30 -04:00
John Lindgren
b89f7bfc0d action: Allow explicit None action without warning 2022-09-16 22:06:29 +01:00
Consolatis
e30fce6c34 cursor: Use enum for server set cursor names
This mainly prevents having to use strcmp() on every mouse move.
2022-09-16 21:30:40 +01:00
Consolatis
f491942858 cursor: Move cursor specific function definitions into cursor.h 2022-09-16 21:30:40 +01:00
John Lindgren
a3fbb52bb0 seat: Fix use-after-free in touch_finish() 2022-09-16 21:41:38 +02:00
John Lindgren
086a887058 keyboard: Fix use-after-free in keyboard_finish() 2022-09-16 21:41:38 +02:00
John Lindgren
bbc6c6bb94 action: Select resize edges for Resize triggered by keybind 2022-09-16 01:42:04 +02:00
John Lindgren
f112fb636e cursor: Split out cursor_button_press() and cursor_button_release() 2022-09-16 01:36:07 +02:00
Johan Malm
84e64b9ce3 config: s/OSD/OnScreenDisplay/ in <theme><font place="OSD">
...to comply with Openbox 3.6 spec [1]

"OSD" is still honoured to maintain backward compatibility.

[1]: http://openbox.org/wiki/Help:Configuration#Theme
2022-09-16 01:15:11 +02:00
John Lindgren
07a83c19f0 config: Add support for font slant and weight 2022-09-15 21:48:05 +01:00
John Lindgren
1fafb89cba cursor: Store view + resize edges for move/resize in press event
v2: Restore previous behavior for keybinds
2022-09-15 06:13:27 +02:00
John Lindgren
429c388333 cursor: Add struct cursor_context and clean up code
v2:
 - Add surface to cursor_context, rename c -> ctx
 - Factor out determine_resize_edges()
2022-09-15 03:12:38 +02:00
Consolatis
89890b6be9
Merge pull request #533 from jlindgren90/fix-gtk-menus
cursor: Fix GTK3 menus when keeping the button pressed
2022-09-14 06:03:17 +02:00
John Lindgren
e18f7a32ba cursor: Allow leave/enter events within the same XDG toplevel
Attempting to open a GTK3 menu and activate a menu item in it,
using a single mouse motion (press-move-release), was broken due
to GTK apparently expecting to receive leave/enter events when the
cursor enters the menu (XDG popup).

To fix the issue, allow leave/enter events when the cursor is
moved between an XDG toplevel and popups of the same.

v2:
 - Use (struct view *) as proxy for toplevel in comparisons
 - Update seat->pressed.surface when entering/leaving popups
v3:
 - Go back to using get_toplevel() rather than (struct view *)
2022-09-13 15:57:20 -04:00
John Lindgren
a8fbe1aac2 xdg-popup: Check for NULL from wlr_xdg_surface_from_wlr_surface()
Also eliminate struct view_child and replace it with a simple
(struct view *)parent_view field.
2022-09-13 15:57:20 -04:00
John Lindgren
b8c3fdaef9 seat: Listen for destroy signal of pressed.surface 2022-09-13 15:57:20 -04:00