Commit graph

982 commits

Author SHA1 Message Date
Forrest Bushstone c2e7350f2e
Make sure toplevel_from_wlr_surface is called with a valid surface pointer 2024-06-14 01:43:32 -06:00
Leonardo Hernández Hernández f4b6b429ec
Merge remote-tracking branch 'upstream/main' into wlroots-next 2024-06-04 14:03:37 -06:00
Leonardo Hernández Hernández 21205f2f40
make sure clients share the same layer on floating layout 2024-06-04 13:58:16 -06:00
Leonardo Hernández Hernández 8f6fca35d0
create a keyboard group for each virtual keyboard 2024-06-02 23:33:57 -06:00
A Frederick Christensen bca077b927
Allow negative coordinates in MonitorRules
Monitor/output position (-1, -1) remains as a single indicator value for autoconfigure layout.
Additionally, one minor comment typo is corrected.
2024-06-02 18:54:11 -05:00
Forrest Bushstone 0047ff740a
Replicate dwm behavior for sloppyfocus 2024-05-30 16:24:42 -06:00
Leonardo Hernández Hernández 3b1f0a8a88
add support for alpha-modifier-v1 (wlroots!4616)
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4616
2024-04-30 12:36:10 -06:00
Leonardo Hernández Hernández bb73481662
use wlr_renderer_get_texture_formats (wlroots!4644)
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4644
2024-04-21 15:53:59 -06:00
choc 577d8da6d1
put wlr_layer_shell top layer below fullscreen
fixes wlr_layer_shell top clients showing over fullscreen clients
2024-04-04 11:09:05 -06:00
Leonardo Hernández Hernández 72e2ce8b00
Merge remote-tracking branch 'upstream/main' into wlroots-next 2024-04-04 10:50:21 -06:00
korei999 f7154d539d
properly resize on configurex11 2024-03-31 21:39:21 -06:00
Guido Cella 2b171fd501 fix virtual pointers
When motionabsolute() is called from warpd, event->time_msec is 0, so
motionnotify() doesn't call wlr_cursor_move(). Fix this by explicitly
warping the cursor in this case, like it was done before implementing
pointer constraints.

I don't know if this is a bug in warpd or time_msec is always 0 with
virtual pointers, since the only other software that uses the virtual
pointer protocol I know of is wl-kbptr, and I can't get that to work
with dwl at all.
2024-03-11 19:01:13 +01:00
Forrest Bushstone ea33ce9ae6
Support pointer constraints and relative pointer protocols
Fixes: https://codeberg.org/dwl/dwl/issues/489
FIxes: https://codeberg.org/dwl/dwl/issues/317
2024-03-11 11:34:26 -06:00
Leonardo Hernández Hernández a0117eea76
use enums from the wayland protocol (wlroots!4575)
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4575
2024-02-29 14:05:09 -06:00
Leonardo Hernández Hernández 7b3eb70501
misc fixes to xdg-toplevel-decoration 2024-02-06 20:37:36 -06:00
Leonardo Hernández Hernández c215e8a3e1
send initial configure to xdg-toplevels (wlroots!4396)
We still need to fix xdg-popups

References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4396
2024-02-06 20:30:40 -06:00
Leonardo Hernández Hernández 8e0b5baf8e
Merge remote-tracking branch 'upstream/main' into wlroots-next 2024-02-07 02:27:07 +00:00
Guido Cella 8006e79200
allow toggling the layout before selecting a different one 2024-02-07 02:23:33 +00:00
Leonardo Hernández Hernández 5ae245beed
fix minimum size
continuation of 4043fc3093
2024-02-07 02:21:26 +00:00
Guido Cella 298949bbc4
place child clients above fullscreen clients
When a child window of a fullscreen client is mapped, the fullscreen is
disabled, and if the previously fullscreen client is floating the child
window is rendered below it and cannot be seen, causing confusion,
though it is still focused and interactable.

Fix this by putting children of fullscreen clients in LyrFS instead of
LyrFloat, and by returning before the unset_fullscreen code is called
when they are mapped.

focusstack() now lets you switch focus from a fullscreen client to its
child windows, otherwise if you switch focus from the child window to
the fullscreen client you could not focus the child window again and the
fullscreen client would stay unresponsive.

Child clients are not reparented to LyrFloat after leaving fullscreen,
so you could spawn a child window, focus back the fullscreen client,
unfullscreen it, and the child window would still be drawn above other
floating clients. Avoid dealing with this edge case to keep the line
count low.

These cases can be tested by pressing Ctrl+o in applications with an
open file dialog.
2024-02-05 16:00:28 -06:00
Guido Cella 17c5cbbf7b
make XWayland clients inherit tags and monitors
Revert 3213088 because the linked bug can no longer be reproduced with
wlroots 0.17, and update client_get_parent() so it doesn't segfault with
XWayland surfaces. This also allows reusing the p variable in the next
commit.
2024-02-05 15:59:46 -06:00
Guido Cella 45e3694fc8
remove useless wlr_scene_node_reparent() calls
These don't do anything because wlr_scene_node_reparent() is immediately
called again by setfloating() through setmon(). They are also a source
of confusion because if you change the wlr_scene_node_reparent() call in
applyrules() it takes a while to understand why it doesn't work.
2024-02-05 15:59:46 -06:00
Leonardo Hernández Hernández 5c936efc42
Revert "No need to call updatemons ourselves"
Fixes: https://codeberg.org/dwl/dwl/issues/577

This reverts commit 26d7c9689f.
2024-01-30 22:54:54 -06:00
A Frederick Christensen 9830a991ff
Correct specifier-data_type mismatches 2024-01-26 23:12:35 -06:00
Guido Cella 863634a61c
configure xwayland surfaces without monitors
For wine clients often configurex11() is called before mapnotify() and
therefore c->mon is NULL. configurex11 just returns early in that case,
letting these clients stay in the wrong size. For example only the top
left part of winecfg and wine uninstaller is drawn, or confirmation
dialogs like when closing wine notepad are too big. Fix this by
configuring their surfaces like before 88d386b.
2024-01-25 19:47:34 -06:00
Leonardo Hernández Hernández 5fec98b17a
pass wl_event_loop to wlr_backend_autocreate (wlroots!4443)
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4443
2024-01-25 12:12:22 -06:00
Guido Cella ac6074f4fd
implement the virtual pointer protocol
This is used by programs like warpd.
2024-01-25 17:13:01 +00:00
Leonardo Hernández Hernández 433385f7f1
do not arrange monitor if it's disabled (wlroots!4520)
This causes us to send negative values to xdg-configures (e.g a bug in our end)

References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4520
(cherry picked from commit 4043fc3093)
2024-01-24 13:36:46 -06:00
Leonardo Hernández Hernández 4043fc3093
do not arrange monitor if it's disabled (wlroots!4520)
This causes us to send negative values to xdg-configures (e.g a bug in our end)

References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4520
2024-01-24 12:12:09 -06:00
Leonardo Hernández Hernández b3f33e9147
add support for axis_relative_direction event (wlroots!4003)
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4003
2024-01-24 12:10:54 -06:00
Leonardo Hernández Hernández f136aa088a
Revert "drop wl_drm (wlroots!4397)"
There still a lot software that uses this protocol

This reverts commit facbe57fcb.
2024-01-24 12:09:55 -06:00
Leonardo Hernández Hernández 1c3aaa70ba
Merge remote-tracking branch 'upstream/main' into wlroots-next 2024-01-24 12:09:42 -06:00
Devin J. Pohly 26d7c9689f
No need to call updatemons ourselves
The output manager in wlroots emits an output_layout.change event when
anything changes, so updatemons will be called anyway.

ΔSLOC: -1
2024-01-20 21:51:20 -06:00
Leonardo Hernández Hernández 6c8be38ec4
drop unused variable 2024-01-15 02:19:02 +00:00
Leonardo Hernández Hernández a1f3e25c35
turn on -Wfloat-conversion 2024-01-15 02:09:18 +00:00
Leonardo Hernández Hernández 0151bd48dd
turn on -Wsign-compare 2024-01-15 02:09:18 +00:00
choc fd263041a0 check if monitor is null before setting gamma
fixes segfault on monitor disconnect when using wlsunset
2024-01-11 17:17:57 +08:00
Leonardo Hernández Hernández facbe57fcb
drop wl_drm (wlroots!4397)
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4397
2024-01-10 18:13:31 -06:00
Ben Jargowsky 25e34e4d0c Destroy fullscreen node after moving clients off mon 2024-01-06 17:34:08 -08:00
Leonardo Hernández Hernández 668022bc90
don't send configure events to uninitialized xdg-toplevels 2024-01-05 11:12:34 -06:00
Leonardo Hernández Hernández c222468887
don't send configure events to uninitialized xdg-popups 2024-01-05 11:08:50 -06:00
Leonardo Hernández Hernández f3c4f72314
fix posible NULL-dereference in wl_surface.commit handler 2024-01-01 00:51:01 -06:00
Leonardo Hernández Hernández 05c263de45
only create wlr_presentation (wlroots!4482)
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4482
2023-12-27 11:45:36 -06:00
Leonardo Hernández Hernández bf35e77811
Merge remote-tracking branch 'upstream/main' into wlroots-next 2023-12-27 11:22:11 -06:00
Leonardo Hernández Hernández 6cbf8e9b80
unset DISPLAY before setting up xwayland 2023-12-27 11:19:03 -06:00
Leonardo Hernández Hernández d13015381b
only execute the first keybinding 2023-12-27 11:18:24 -06:00
Leonardo Hernández Hernández e277d84c51
more style fixes
missed from the previous iteration
2023-12-27 11:17:52 -06:00
Leonardo Hernández Hernández bf5a6be73c
Merge remote-tracking branch 'upstream/main' into wlroots-next 2023-12-26 16:21:28 -06:00
Leonardo Hernández Hernández 1f0afcfc28
create a wlr_keyboard_group for virtual keyboards
Fixes: https://codeberg.org/dwl/dwl/issues/554
2023-12-25 21:19:59 -06:00
Leonardo Hernández Hernández 23fd312409
fix typo
Fixes: 7afdc191fe
Thanks to: David Donahue <david.donahue2996@gmail.com>
2023-12-18 14:08:09 -06:00
Leonardo Hernández Hernández e39d931430
tie xdg_toplevel_decorations to Client
a xdg_toplevel can only have one xdg_toplevel_decoration so there is no need to
have a new struct for decorations
2023-12-18 12:59:47 -06:00
Leonardo Hernández Hernández 396840cdf2
Revert "nuke CSDs, hopefully for good!"
The compositor must respond to the client requesting a change to the decoration
mode, it does not matter if the compositor chooses a different mode.

This reverts commit 9071ce6c84.
2023-12-18 12:56:20 -06:00
Leonardo Hernández Hernández a71b368483
Revert "remove typedef Decoration"
This reverts commit d1ff1e6f75.
2023-12-18 12:56:19 -06:00
Leonardo Hernández Hernández 7afdc191fe
style fixes 2023-12-17 21:42:50 +00:00
David Donahue 023efce6eb
use wlr_keyboard_group to manage all keyboards 2023-12-17 21:41:39 +00:00
Leonardo Hernández Hernández fa660fb61e
check toplevel resources
it's just a aesthetic change
2023-12-12 22:21:32 -06:00
Leonardo Hernández Hernández 126a333354
Merge remote-tracking branch 'upstream/main' into wlroots-next
Fixes: https://codeberg.org/dwl/dwl/issues/432
Fixes: https://codeberg.org/dwl/dwl/issues/547
2023-12-11 00:31:17 -06:00
Dima Krasner 9a84789ff1
restore and respect rootcolor 2023-12-11 00:30:17 -06:00
Leonardo Hernández Hernández 49bfe92703
merge X11Managed and X11Unmanaged into X11
now that client_is_unmanaged() checks the wlr struct we don't need to keep
track of it ourselves
2023-12-10 23:46:49 -06:00
Leonardo Hernández Hernández 9c5bdcfbe8
do not blindly try to send motion events when pointer button is pressed
we don't have to do this if the surface is the same
2023-12-10 23:27:59 -06:00
Leonardo Hernández Hernández 0de7d1aa71
Merge branch 'main' into wlroots-next 2023-12-07 22:43:13 -06:00
Leonardo Hernández Hernández 1884a07646
sort LISTEN calls in createnotify{,x11} 2023-12-07 22:40:59 -06:00
Leonardo Hernández Hernández 79c51a4584
use the same style for urgent() and sethints() 2023-12-07 22:37:35 -06:00
Leonardo Hernández Hernández f5d839844d
remove an unneeded cast in createpointer() 2023-12-07 22:37:00 -06:00
Leonardo Hernández Hernández e03896b4d6
avoid duplication of lines
the output state is copied when creating a output configuration head
2023-12-07 22:18:49 -06:00
Leonardo Hernández Hernández e7e84b1083
add explanation about why we try to re-apply the gamma LUT on output changes 2023-12-07 22:17:48 -06:00
Leonardo Hernández Hernández 9694477b2f
relax a bit the line length limit 2023-12-07 22:16:13 -06:00
Leonardo Hernández Hernández 6a15167754
add a blank line to improve readability 2023-12-07 22:15:42 -06:00
Leonardo Hernández Hernández e5e2d1c28f
use (struct wlr_box){0} to empty the Monitor areas 2023-12-07 22:04:24 -06:00
Leonardo Hernández Hernández bdbfb45d66
copy layout symbol when matching a MonitorRule 2023-12-07 21:51:24 -06:00
Leonardo Hernández Hernández 50ea84c5f6
remove extra blank line 2023-12-07 21:49:26 -06:00
Leonardo Hernández Hernández 472a31b5a4
LayerSurface::link -> LayerSurface.link 2023-12-07 21:48:56 -06:00
Leonardo Hernández Hernández a760757b82
set the correct border color when mapping a client 2023-12-07 21:44:53 -06:00
Leonardo Hernández Hernández 80c9ad12ba
reduce calls to client_get_geometry 2023-12-07 21:43:48 -06:00
Leonardo Hernández Hernández 393078d80c
store the layersurface pointer in l->popups->node.data as well 2023-12-07 14:19:09 -06:00
Leonardo Hernández Hernández 28ec843aee
make sure popups of a layer surface are in the correct layer
previously it worked because we checked in every commit the layer
in a353eee2ca and
b100b446b8
we changed the way it's handled and now if the layer surface does not change
the layer we don't it either. meaning that if it was created in the bottom
layer and did not change the layer the popups would show behind xdg clients
2023-12-07 14:19:02 -06:00
Leonardo Hernández Hernández 2b3504e439
sort #includes 2023-12-01 21:35:50 -06:00
Leonardo Hernández Hernández bab5c0185a
Merge remote-tracking branch 'upstream/main' into wlroots-next 2023-11-30 22:44:52 -06:00
Leonardo Hernández Hernández 5f7d396996
don't return early if the first output commit fails 2023-11-30 22:39:03 -06:00
Leonardo Hernández Hernández 901d2e2d9d
check failure of wlr_output_init_render 2023-11-30 22:38:52 -06:00
Leonardo Hernández Hernández 00e867d536
use detached output state in createmon()
see previous commit for motivation
2023-11-30 22:38:39 -06:00
Leonardo Hernández Hernández 2e29189b92
use a detached output state in outputmgrapplyortest()
wlr_output.pending might be removed in wlroots 0.18
2023-11-30 22:38:11 -06:00
Leonardo Hernández Hernández 70c5fcc23d
chase xdg-shell events update (wlroots!4345)
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4345
2023-11-27 00:06:03 -06:00
Leonardo Hernández Hernández 3fe3581a59
chase wlr_layer_shell_v1.new_surface changes (wlroots!4265)
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4265
2023-11-27 00:06:03 -06:00
Leonardo Hernández Hernández 057d50af8c
pass wl_display to wlr_output_layout_create (wlroots!4310)
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4310
2023-11-27 00:06:03 -06:00
Leonardo Hernández Hernández 2e4fdc1664
use l instead of layersurface
`layer_surface` instead of `wlr_layer_surface`
and `scene_layer` whenever a wlr_scene_tree is related to layer surfaces
2023-11-25 19:18:19 -06:00
Leonardo Hernández Hernández b100b446b8
return early if a layersurface didn't commit something 2023-11-25 19:17:32 -06:00
Leonardo Hernández Hernández 9cb1ece6cc
do not check if a layer surface has monitor on commit
We do not allow creating them w/o monitor and they are destroyed when
destroying their monitor
2023-11-25 19:17:32 -06:00
Leonardo Hernández Hernández 01a237bd5c
send wl_surface.enter before initial commit
It's not necessary but it'll help clients to render a perfect first frame
2023-11-25 19:17:32 -06:00
Leonardo Hernández Hernández a5e068b20a
destroy the layer-suface's scene tree for popups 2023-11-25 19:16:33 -06:00
Leonardo Hernández Hernández 39f4ee564b
use wlr_box_equal() instead of memcmp 2023-11-25 19:08:56 -06:00
Leonardo Hernández Hernández a353eee2ca
simplify settings popups scene tree parent 2023-11-25 19:06:17 -06:00
Leonardo Hernández Hernández 66ec028b00
simplify check for wlr_layer_surface.output 2023-11-25 19:05:27 -06:00
Leonardo Hernández Hernández 1f10e69b4c
use sizeof(*pointer) instead of sizeof(struct) 2023-11-25 19:04:57 -06:00
Leonardo Hernández Hernández 2783e82bf8
make sure to unlink Monitor.request_state listener 2023-11-25 18:53:18 -06:00
Leonardo Hernández Hernández 7ac76219df
Merge branch 'wlroots-next' 2023-11-25 00:04:19 -06:00
Leonardo Hernández Hernández 6838f909bd
try to apply gamma LUT in updatemons
this in the case the output was re-enabled
2023-11-21 20:41:36 -06:00
Leonardo Hernández Hernández d2dd2f4986
ignore wl_surface.commit for xwayland clients
This is no longer needed
2023-11-21 20:16:26 -06:00
Leonardo Hernández Hernández a0e79d8145
Do not send repeated xdg_toplevel.configure_bounds
Fixes: 32e66f4582
2023-11-21 20:15:46 -06:00
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