Commit Graph

883 Commits

Author SHA1 Message Date
Leonardo Hernández Hernández
32e66f4582
resize clients on commit
Fixes: https://github.com/djpohly/dwl/issues/515
This reverts commit 4567979b16.
2023-11-21 20:15:00 -06:00
link2xt
b4da97446a createkeyboard: do not segfault if xkb_keymap_new_from_names returns NULL
Passing NULL to wlr_keyboard_set_keymap results in a segfault.
Example:

  Thread 1 "dwl" received signal SIGSEGV, Segmentation fault.
  0x00007ffff7e49b64 in xkb_keymap_ref () from /usr/lib/libxkbcommon.so.0
  (gdb) bt
  #0  0x00007ffff7e49b64 in xkb_keymap_ref () at /usr/lib/libxkbcommon.so.0
  #1  0x00007ffff7f06389 in wlr_keyboard_set_keymap () at /usr/lib/libwlroots.so.11
  #2  0x000055555555bc54 in createkeyboard ()
  #3  0x000055555555c283 in inputdevice ()
  #4  0x00007ffff7e8101e in wl_signal_emit_mutable () at /usr/lib/libwayland-server.so.0
  #5  0x00007ffff7e8101e in wl_signal_emit_mutable () at /usr/lib/libwayland-server.so.0
  #6  0x00007ffff7edb52c in  () at /usr/lib/libwlroots.so.11
  #7  0x00007ffff7ee44b6 in  () at /usr/lib/libwlroots.so.11
  #8  0x000055555555fe66 in main ()
2023-11-19 01:14:35 -06:00
Leonardo Hernández Hernández
2751a6195d
do not try to enable adaptive sync 2023-11-18 11:20:56 -06:00
Leonardo Hernández Hernández
fcf324be6c
fix the position of the cursor image after turning all the monitors on 2023-11-17 19:03:23 -06:00
Leonardo Hernández Hernández
b8e933b9a9
remove unused #include 2023-11-17 11:03:33 -06:00
Leonardo Hernández Hernández
1044a21555
do not check if session is non-NULL
wlr_session_change_vt() is a no-op if session == NULL
2023-11-17 11:03:33 -06:00
Leonardo Hernández Hernández
6bcd5d8d87
do not explicitly destroy some wlroots interfaces
they are destroyed when the wayland display is destroyed
2023-11-17 11:03:32 -06:00
Leonardo Hernández Hernández
e95f14541a
fix docs
copied from tinywl
2023-11-17 11:03:32 -06:00
Leonardo Hernández Hernández
bca1b779aa
fix destroynotify() docs
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4421
2023-11-17 11:03:32 -06:00
Leonardo Hernández Hernández
4f4c540bb9
prevent a use-after-free at exit 2023-11-17 11:03:30 -06:00
Leonardo Hernández Hernández
8e3f5364d3
do not compute layout box twice 2023-11-17 11:03:30 -06:00
Leonardo Hernández Hernández
2212363225
make sure fullscreen clients have the right size 2023-11-17 11:03:30 -06:00
Leonardo Hernández Hernández
6f8a3f9374
fix screen artifacts when setting gamma
the artifacts were caused because we tried to set the gamma right after
receiving the event, this resulted in two pending page-flips, which
not always play well together.

This also seems to fix a screen freeze when turning on a monitor that has
gamma.

Additionally the current method won't work once [0] is merged

[0]: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4423
2023-11-17 11:01:30 -06:00
Leonardo Hernández Hernández
e1f3983bf8
use wlr_scene_subsurface_tree_set_clip
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4131
Closes: https://github.com/djpohly/dwl/issues/411
2023-11-14 19:44:43 -06:00
Leonardo Hernández Hernández
31bf1cbaf6
Revert "respect size hints"
This reverts commit 72e0a560d9.
2023-11-14 19:44:28 -06:00
Leonardo Hernández Hernández
a4a83e95e6
use newer cursor naming spec
References: https://www.freedesktop.org/wiki/Specifications/cursor-spec/
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4416
2023-11-01 12:28:19 -06:00
Leonardo Hernández Hernández
e45ded7eea
ignore maximize events for clients using xdg-shell v5 and newer 2023-11-01 12:16:02 -06:00
Leonardo Hernández Hernández
892a4d3ec7
Merge remote-tracking branch 'upstream/main' into wlroots-next 2023-10-13 17:10:25 -06:00
Ben Collerson
8c79f8dc15
check client is mapped before setting border color
For some reason brave configured for as a wayland client triggers this code on startup and segfaults.

Checking if the client is mapped fixes this, like with the previous fix for urgent border colour.

References: 887fde65a3
Fixes: 72a7d78a1a
2023-10-10 10:16:11 -06:00
Leonardo Hernández Hernández
8781f4dbf5
Merge remote-tracking branch 'upstream/main' into wlroots-next 2023-10-09 22:37:36 -06:00
Leonardo Hernández Hernández
df131cdb78
use <xcb/xcb.h> instead of <X11/Xlib.h> 2023-10-09 22:33:37 -06:00
Leonardo Hernández Hernández
887fde65a3
only set border color for urgent *and* mapped X11 clients
this fixes a segfault when the client emits .set_hints but it's not mapped

Fixes: 72a7d78a1a
2023-10-09 22:32:15 -06:00
Leonardo Hernández Hernández
b299e01e44
Merge remote-tracking branch 'upstream/main' into wlroots-next 2023-10-09 11:45:51 -06:00
Leonardo Hernández Hernández
6d9a915fb6
Revert "just add define"
I'm going to make some changes in the config file anyway

This reverts commit e5367753bb.
2023-10-09 11:12:24 -06:00
Leonardo Hernández Hernández
935b852dc5
add [-d] flag to enable debug logging 2023-10-09 11:11:33 -06:00
Leonardo Hernández Hernández
a18c528300
simplify setting the border color of clients 2023-10-09 11:05:41 -06:00
Leonardo Hernández Hernández
72a7d78a1a
make the borders red borders for urgent clients
iirc this is the same behavior of dwm
2023-10-09 11:04:03 -06:00
Forrest Bushstone
f695674361
Check if c is fullscreen before reparenting it to LyrFloating
Closes: https://github.com/djpohly/dwl/issues/487
2023-09-29 18:01:31 -06:00
Forrest Bushstone
aec21eca1f
make sure that fullscreen clients are on the correct screen when isfloating is true
Bug: https://github.com/djpohly/dwl/issues/487
2023-09-29 18:00:32 -06:00
Leonardo Hernández Hernández
1333f8cc6e
Merge remote-tracking branch 'upstream/main' into wlroots-next 2023-09-24 11:44:29 -06:00
Leonardo Hernández Hernández
960c32a7d8
call setfloating in setmon
since in the previous commit we may not applying floating in clients
this is to make sure we do
2023-09-06 22:23:37 -06:00
Leonardo Hernández Hernández
aea8dd6ae1
return early if the client doesn't have monitor in setfloating
there is still a bug, but for now this prevents a segfault

Bug: https://github.com/djpohly/dwl/issues/472
2023-09-06 22:22:21 -06:00
Ben Collerson
e5367753bb just add define 2023-08-22 22:20:39 -06:00
Ben Collerson
9be85c1117 tagcount should have been a #define 2023-08-22 22:20:39 -06:00
Leonardo Hernández Hernández
4b8c1bf31e
return nothing in xytonode()
we do not use the node
2023-08-22 14:48:29 -06:00
Devin J. Pohly
d7569870b6
Style: use early-return to clarify code
Use an early return to avoid indenting the main logic instead of
wrapping the tail of a function in an if statement.

No functional change, except for a handful of places where printstatus()
was being called spuriously (tag, toggletag, toggleview).

ΔSLOC: 0
2023-08-22 01:44:31 -06:00
Devin J. Pohly
4eb54b55f3
No need to send surface.leave/enter events
The scene graph implementation sends these for us, and it does so more
accurately than our overly-simplified approach.  Layer shell surfaces
don't appear to receive these events at all, according to my
WAYLAND_DEBUG experiments with bemenu and dtao.

ΔSLOC: -4
2023-08-22 01:44:31 -06:00
Leonardo Hernández Hernández
4567979b16
don't resize clients on commit
It creates an infinite commit-resize loop when scale != 1
2023-08-18 21:37:22 -06:00
Leonardo Hernández Hernández
78cf88670f add support for xdg-shell v6 2023-07-31 18:19:41 -06:00
Leonardo Hernández Hernández
ce997c4a21
update to xdg-shell v5 2023-07-23 21:15:06 -06:00
Leonardo Hernández Hernández
0e5405610e
add support for cursor-shape-v1
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4106
2023-07-23 19:56:55 -06:00
Leonardo Hernández Hernández
0bb1a1cc5c
increase wl_compositor version
Now scene will handle sending the preferred buffer scale

References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4269
2023-07-15 10:11:47 -06:00
Leonardo Hernández Hernández
aecff8cb26
Merge branch 'main' into wlroots-next 2023-07-13 22:36:48 -06:00
Leonardo Hernández Hernández
ca4a97b933 do not use wl_event_loop for signal handling
ΔSLOC: -4

Fixes: https://github.com/djpohly/dwl/issues/456
Fixes: https://github.com/djpohly/dwl/issues/459
2023-07-13 22:32:48 -06:00
Devin J. Pohly
76ba2cdab0 Remove now-unneeded call to motionnotify
This appears to have been here for the side effect of updating the drag
icon's position.
2023-07-13 22:17:03 -06:00
Devin J. Pohly
4b15bbeb33 Remove unused icon variable 2023-07-13 22:17:03 -06:00
Devin J. Pohly
831fc36bc9 Make drag_icon a persistent scene node
If there is no current drag icon, this node will be empty, but we now
have `drag_icon != NULL` as an invariant.  This allows us to eliminate a
conditional, since there's no harm in moving an empty node's coordinates
around with the pointer.

ΔSLOC: -1
2023-07-13 22:17:03 -06:00
Devin J. Pohly
1841527871 properly destroy scene
ΔSLOC: +1
2023-07-13 17:44:21 -06:00
Leonardo Hernández Hernández
ff7c0e9508
chase wlroots!4220
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4220
2023-07-10 11:23:19 -06:00
Devin J. Pohly
33bcd2e4ca Line saver: LISTEN_STATIC macro
This parallels the LISTEN macro for statically allocated listeners, and
it allows us to remove almost all of the global wl_listener
declarations.

This also fixes a bug with the axisnotify listener, which was declared
with a compound literal.  At block scope, these have automatic storage
duration [1], so the listener was no longer valid after setup()
returned.  (The option to declare it static explicitly was standardized
in C23, if that ever gains suckless traction.)

ΔSLOC: -27

[1]: https://en.cppreference.com/w/c/language/compound_literal#Explanation
2023-07-08 16:56:09 -06:00
Devin J. Pohly
fbd84aca4a Unify signal handling under wl_event_loop
Merge our signal handlers into a single function and let Wayland deal
with all the struct sigaction stuff.

ΔSLOC: -3
2023-07-03 22:28:27 -06:00
Devin J. Pohly
a01e402c5d Line saver: follow "local = wlr->data = obj" pattern
There were still a couple of places where we could use this handy
multiple assignment to save a line.

ΔSLOC = -3
2023-07-03 21:21:43 -06:00
Leonardo Hernández Hernández
9dd3f230c0
Merge remote-tracking branch 'upstream/main' into wlroots-next 2023-06-29 13:11:55 -06:00
Devin J. Pohly
eda0613cc4 Separate drag icon from layers array and Lyr enum
If we treat the drag icon as distinct from other layers (it doesn't have
contents that are interactive, focusable, etc.), then we can iterate
over layers meaningfully with a simple for loop.

ΔSLOC: -8
2023-06-25 17:44:00 -05:00
Leonardo Hernández Hernández
733114f0ca
schedule a frame after commmiting gamma
not doing it, may freeze the output or do not actually change the gamma until
creating a client
2023-06-24 10:09:49 -06:00
Leonardo Hernández Hernández
fdb66ccfa3
use detached output states to set gamma 2023-06-23 13:42:44 -06:00
Leonardo Hernández Hernández
6095ff84d2
Revert "use wlr_scene_output_build_state() to set gamma"
This reverts commit 65f68e7643.
2023-06-23 13:30:43 -06:00
Devin J. Pohly
68a17f962e Don't bother with ignoring SIGCHLD
It added complexity, especially with the differences in behavior between
handled and ignored signals across an exec().
2023-06-16 00:24:17 -06:00
Devin J. Pohly
9c592da01f Reset ignored signal handler in spawn() as well 2023-06-16 00:24:17 -06:00
Devin J. Pohly
df11b7a786 fix startup_cmd SIGCHLD handler
Ignored handlers are not reset by exec() calls
2023-06-16 00:24:17 -06:00
Leonardo Hernández Hernández
1e1811f953
drop KDE idle support
use ext-idle-notify-v1 instead
2023-06-15 12:32:31 -06:00
Leonardo Hernández Hernández
dfb6b97159
drop support for wlr-input-inhibitor-unstable-v1
deprecated in favor of ext-session-lock-v1

References: 4aa366e3dd
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3848
2023-06-15 12:27:34 -06:00
Leonardo Hernández Hernández
65f68e7643
use wlr_scene_output_build_state() to set gamma 2023-06-15 12:22:43 -06:00
Leonardo Hernández Hernández
96ab92cdb1
use wlr_cursor_set_xcursor()
This avoids re-upload the cursor image in each motion event

Managing the scale is done by the function itself

References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4170
2023-06-15 12:12:22 -06:00
Leonardo Hernández Hernández
1eb8a82ac4
Revert "avoid setting duplicate cursor image"
This reverts commit b5776e5180.

See next commit for details
2023-06-15 12:02:30 -06:00
Leonardo Hernández Hernández
24a337e6ec
handle gamma-control-v1 set_gamma event
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4046
2023-06-08 23:35:46 -06:00
A Frederick Christensen
5215712cab Stray whitespace fixes 2023-06-07 17:47:36 -06:00
Leonardo Hernández Hernández
f3d017077a
use the new {a,di}ssociate events to handle xwayland commit listener 2023-06-02 22:08:17 -06:00
Leonardo Hernández Hernández
06bc65549f
chase wlroots map logic unification
Signed-off-by: Leonardo Hernández Hernández <leohdz172@proton.me>
2023-06-02 22:03:41 -06:00
Leonardo Hernández Hernández
a8ccbe63f3
Merge branch 'main' into wlroots-next 2023-06-02 22:01:39 -06:00
Leonardo Hernández Hernández
9b9b79b35e
activate lock surface in updatemons
Fixes an issue when swaylock does not receive input after turn off and then
turn on the outputs
2023-06-02 21:56:09 -06:00
Leonardo Hernández Hernández
3d98907b98
send frame done even if output commit fails
Bug: https://github.com/djpohly/dwl/issues/420
Fixes: https://github.com/djpohly/dwl/issues/353
2023-06-02 21:51:47 -06:00
Nikita Ivanov
f8884ffc2b Set XCURSOR_SIZE 2023-06-01 19:11:33 -06:00
Leonardo Hernández Hernández
72adab621f destroy old client popups when focusing another client
Closes: https://github.com/djpohly/dwl/issues/408
2023-05-27 23:29:05 -06:00
Micah Gorrell
0729f18dce Prevent using a wlr_layer_surface after destroying it, due to no available outputs 2023-05-25 21:21:56 -06:00
Leonardo Hernández Hernández
2d1a40caf2
pass version to wlr_compositor_create()
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3696
Signed-off-by: Leonardo Hernández Hernández <leohdz172@proton.me>
2023-04-14 12:25:05 -06:00
Leonardo Hernández Hernández
733754bb06
Merge remote-tracking branch 'upstream/main' into wlroots-next 2023-04-14 12:24:19 -06:00
Leonardo Hernández Hernández
797e0c74b2
correctly check if a scene node is enabled
checking only wlr_scene_node.enabled may result in a false positive because it
does not consider if its ancestors are enabled as well.
2023-04-13 13:12:27 -06:00
Leonardo Hernández Hernández
3c760bcd4a
remove unneeded check of m in arrange()
arrange must never be called with a NULL argument
2023-04-13 13:12:27 -06:00
Ben Collerson
da77e34ee5 Use uint32_t for ui Arg 2023-04-09 17:09:35 -06:00
Leonardo Hernández Hernández
20f61a59af
use fixed-size type for client tags
while the size of `int` in most compilers is 32-bits, the size of int and all
other integer types are implementation defined, so make sure we can use up to
32-bits
2023-04-08 11:29:18 -06:00
Ben Collerson
9d68554c59
remove tag labels from dwl
Tag labels are not used in dwl. Only the number of tags is important.
Tag labels should be defined for each tag in whatever status bar is
used.
2023-04-08 11:27:49 -06:00
Yves Zoundi
bbdf2a913b
display clients count in monocle symbol
- Replicate missing functionality from dwl to display the client count in monocle mode
  - Add ltsymbol field to Monitor struct
  - Display client count in monocle mode when greater than zero
- Tested with somebar and dwlb
2023-03-16 00:02:14 -06:00
A Frederick Christensen
6722a89532 Missing apostrophe 2023-03-07 22:17:05 -06:00
Leonardo Hernández Hernández
eaf6dd2cd2
do not call dmabuf_create twice
it is called automatically by `wlr_renderer_init_wl_display()` but since we
need a pointer to wlr_linux_dmabuf_v1 to integrate it with scene API we need
to recreate that function.

Bug: https://github.com/emersion/xdg-desktop-portal-wlr/issues/216
Fixes: https://github.com/djpohly/dwl/issues/398
2023-03-07 22:04:32 -06:00
Leonardo Hernández Hernández
d1b36925c9
add support for linux-dmabuf-unstable-v1
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3726
References: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/blob/main/unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml
2023-02-20 21:24:18 -06:00
godalming123
c69a2bec3f Fix spacing and replace it with tabs 2023-02-18 18:47:44 -06:00
godalming123
737688a6b1 fix spelling 2023-02-18 18:47:44 -06:00
Leonardo Hernández Hernández
fefcdbed4a
Merge remote-tracking branch 'upstream/main' into wlroots-next 2023-02-13 13:46:41 -06:00
pino-desktop
f8373ccf25
Fixed 'unused variable' compiler warning. 2023-02-13 13:43:28 -06:00
Ben Collerson
7f9a212476
Add appid field to printstatus() output
Adds an appid field to printstatus which can be used to monitor the
currently active application.
2023-02-13 13:30:27 -06:00
Leonardo Hernández Hernández
ab8334bd8a
implement repeatable keybindings 2023-02-13 13:18:43 -06:00
Leonardo Hernández Hernández
23ede80f74
allow configure x and y of outputs 2023-02-13 13:14:29 -06:00
Leonardo Hernández Hernández
04fdf1a295
add support for wp-fractional-scale-v1
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3511
2023-02-08 22:25:41 -06:00
Leonardo Hernández Hernández
fbe89a929f
chase wlroots!4000
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4000
2023-02-05 10:03:09 -06:00
Leonardo Hernández Hernández
f7d6a34cd9
use sigaction(2) for signal handling
References: http://git.suckless.org/dwm/commit/712d6639ff8e863560328131bbb92b248dc9cde7.html
2023-01-30 23:26:32 -06:00
Leonardo Hernández Hernández
cf9c5745e5
Merge remote-tracking branch 'upstream/main' into wlroots-next 2022-12-30 15:29:12 -06:00
Leonardo Hernández Hernández
dbe44e48c8
return early if selmon is not part of the output layout in dirtomon()
instead of checking twice
2022-12-30 14:31:56 -06:00
Leonardo Hernández Hernández
0b2c33248c
simplify check in urgent()
we only care if it returned a client or not
2022-12-30 14:29:19 -06:00
Leonardo Hernández Hernández
56114f700f
arrange monitor after updating fullscreen background and lock surfaces 2022-12-30 14:26:53 -06:00