251 Commits

Author SHA1 Message Date
Devin J. Pohly 7c3c5ffcc2 Merge branch 'main' into push 2023-07-03 22:06:26 -05:00
Devin J. Pohly 81c8ebf677 Merge branch 'push' of github:Abanoub8/dwl into push 2023-07-03 22:05:05 -05:00
Devin J. Pohly a89872f02e Merge branch 'push' of github:djpohly/dwl into push 2023-07-03 22:04:38 -05: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
Abanoub a41d817979 Use focustop(selmon) instead of selclient() in the push patch 2023-06-21 18:11:09 +03: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
A Frederick Christensen 5215712cab Stray whitespace fixes 2023-06-07 17:47:36 -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 a5e45924ed remove note about contact me for patch issues
I am no longer able to spend much time developing dwl let alone maintaining
other's patches :)
2023-05-28 00:20:20 -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 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
Palanix 21930621ee Remove rootcolor 2023-03-13 09:40:40 -06:00
A Frederick Christensen 6722a89532 Missing apostrophe 2023-03-07 22:17:05 -06:00
gan-of-culture e4921fad28 add missing comma in "MonitorRule"
add a missing comma for the example
2023-02-25 15:59:23 -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
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 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 8653b27692 bump version to 0.4 2022-12-30 14:46:52 -06:00
Leonardo Hernández Hernández 932c1d45f2 remove --long from git-describe command 2022-12-30 14:46:34 -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
Leonardo Hernández Hernández 71c7e4e1e5 also update locked_bg node position in updatemons() 2022-12-30 14:25:19 -06:00
Leonardo Hernández Hernández 72d29f1654 add blank lines to make updatemons() more readable 2022-12-30 14:21:46 -06:00
Leonardo Hernández Hernández e523c2b82b update comment about client_set_size() as no-op 2022-12-30 14:19:47 -06:00
Leonardo Hernández Hernández 6d0e3a5198 check if a client is resizing before checking if it's visible
It's not like it's noticeable, but theoretically this is faster
2022-12-30 14:15:21 -06:00
Leonardo Hernández Hernández 5347ed663d only mark pending resizes as completed checking the configure serial 2022-12-30 14:14:06 -06:00
Leonardo Hernández Hernández 05f4e23c43 bump version to 0.4-rc3 2022-12-24 17:54:19 -06:00
Leonardo Hernández Hernández be854cab35 do not try to resize if size wouldn't change 2022-12-24 16:44:09 -06:00
Leonardo Hernández Hernández 6ca011430a do not skip frames if a client is stopped and have a pending resize 2022-12-24 16:44:09 -06:00
Leonardo Hernández Hernández 7eaa01ac1f Revert "Revert "fix flickering when resizing/spawning windows""
This reverts commit 4a32293548.
2022-12-24 16:44:09 -06:00
Leonardo Hernández Hernández 92e7752203 disable client's scene node after create it (only XDGShell)
will be enabled when setting up its monitor and arrange it

Bug: https://github.com/djpohly/dwl/issues/306
2022-12-24 16:44:09 -06:00
Leonardo Hernández Hernández 6682878009 call arrange() or resize() depending on c->isfloating in commitnotify 2022-12-24 16:43:31 -06:00
Leonardo Hernández Hernández afacc9b0b5 force SSD when creating an xdg_toplevel_decoration object
Closes: https://github.com/djpohly/dwl/issues/366
Not sure why GLFW apps do not get mapped when we do not tell them the
decoration method
2022-12-20 21:53:45 -06:00
Leonardo Hernández Hernández dd9d8d543c remove selclient()
selclient() does not work well when dealing newly mapped
clients (specifically those mapped on invisible tags).

This fixes various bugs related to things not working because selclient() would
return NULL.

References: 94c8bd6048
2022-12-20 21:27:14 -06:00
Leonardo Hernández Hernández 686958a4cc fix unset fullscreen for all visible clients when mapping a new one
this also changes our policy about when we unset fullscreen:

dwl will unset fullscreen for clients who share tags (and monitor) with a newly
mapped client, it does not matter if the clients are visible or not
2022-12-20 21:21:40 -06:00
Leonardo Hernández Hernández 1a3d89e5b2 call checkidleinhibitor() in arrange() and not in focusclient() 2022-12-16 18:54:33 -06:00
Leonardo Hernández Hernández 7b1fe7e5f2 fix checking idle inhibit state
checking `bypass_surface_visibility` first, could cause that even if the idle
inhibitor is being destroyed it will disable idle tracking

and if we couldn't get its scene tree, then assume that the surface is visible
2022-12-16 17:37:18 -06:00
Leonardo Hernández Hernández 803a9ba98d Revert "Revert "Check that inhibitor scene tree is not null""
This reverts commit 035bb99d67.

Not checking `tree != NULL` result in a segfault if the surface doesn't have a
role (for example because it is a newly created surface)

Closes: https://github.com/djpohly/dwl/issues/359
2022-12-16 17:20:59 -06:00
Ben Jargowsky a39a46c908 Check width and height are not negative in client_set_bounds() 2022-12-15 23:42:53 -06:00
Leonardo Hernández Hernández 94c8bd6048 get sel from focustop() in focusstack()
Fixes: https://github.com/djpohly/dwl/issues/354
2022-12-09 20:55:58 -06:00
Leonardo Hernández Hernández c60f651951 Revert "force line-buffered stdout if stdout is not a tty"
This reverts commit deb48ff48b.

Fixes: https://github.com/djpohly/dwl/issues/253
2022-12-09 08:46:22 -06:00
Leonardo Hernández Hernández 79b051f242 implement ext-session-lock-v1 2022-12-06 14:11:41 -06:00
Leonardo Hernández Hernández d42a977b5b Revert "remove unneeded changes in commitnotify()"
This reverts commit 30c24a53ad.

Bug: https://github.com/djpohly/dwl/issues/349
2022-12-06 13:59:14 -06:00
Leonardo Hernández Hernández 4a32293548 Revert "fix flickering when resizing/spawning windows"
This reverts commit 017bb7d752.

Bug: https://github.com/djpohly/dwl/issues/349
2022-12-06 13:58:56 -06:00
Leonardo Hernández Hernández 9136b6247d return early if couldn't find the popup's parent 2022-12-06 13:34:35 -06:00
Leonardo Hernández Hernández 19b5d47a9e fix popups appearing outside the monitor
and a potentially crash
2022-12-06 13:31:48 -06:00
Leonardo Hernández Hernández c9a0a8bf6d bump version to 0.4-rc2 2022-12-05 23:21:21 -06:00
Leonardo Hernández Hernández 22336612ae improve type safety of toplevel_from_wlr_surface() 2022-12-05 23:18:02 -06:00
Leonardo Hernández Hernández 38bd00351a merge toplevel_from_{wlr_layer_surface,popup} into client_from_wlr_surface
now it is a big function called toplevel_from_wlr_surface
2022-12-05 23:18:01 -06:00
Leonardo Hernández Hernández c56bc42eb5 sort client_get_parent() 2022-12-05 23:18:01 -06:00
Leonardo Hernández Hernández 13b929d7d7 remove unneeded call to wlr_scene_rect_set_color()
wlr_scene_rect_create() requires a color as parameter
2022-12-05 23:06:53 -06:00
Devin J. Pohly a4e4fd3d25 add missing header 2022-12-05 22:58:26 -06:00
Devin J. Pohly 0259e9a8ab port dwm "push" patch to dwl 2022-12-05 22:58:26 -06:00
Leonardo Hernández Hernández b6d6127733 add option for set button map 2022-12-05 22:22:49 -06:00
Dima Krasner 16a49e9955 fix null deref in sigchld() if Xwayland is disabled 2022-12-03 13:30:30 -06:00
Palanix 30c24a53ad remove unneeded changes in commitnotify() 2022-12-03 13:14:10 -06:00
Palanix 017bb7d752 fix flickering when resizing/spawning windows
Fixes: https://github.com/djpohly/dwl/issues/306
2022-12-03 13:14:10 -06:00
Leonardo Hernández Hernández fac3b6f2cf use root surfaces to check idle inhibitors
References: https://github.com/djpohly/dwl/pull/343
2022-12-02 23:25:46 -06:00
Leonardo Hernández Hernández 035bb99d67 Revert "Check that inhibitor scene tree is not null"
This reverts commit 9c155eefdc.

This commit was applied just a workaround, the proper fix is the next commit
2022-12-02 23:25:04 -06:00
Ben Jargowsky 9c155eefdc Check that inhibitor scene tree is not null 2022-12-02 15:10:25 -06:00
Jan Beich df34fdd483 chase default terminal in manpage after 7710cf050d 2022-12-02 10:52:34 -06:00
Leonardo Hernández Hernández 4c6050331e bump version to 0.4-rc1 2022-12-02 10:12:16 -06:00
Leonardo Hernández Hernández eaf8a21603 unset fullscreen when mapping a client in the same monitor
Fixes: https://github.com/djpohly/dwl/issues/327
2022-12-02 10:09:50 -06:00
Leonardo Hernández Hernández f929eaef1e ask for version instead of commit in bug reports 2022-12-02 10:08:18 -06:00
Leonardo Hernández Hernández ce1d040586 Merge branch 'main' of github.com:djpohly/dwl 2022-12-02 10:06:40 -06:00
Leonardo Hernández Hernández b4fb1f77c7 fix xwayland clients being floating by default
Fix 3213088aa2
References: https://github.com/djpohly/dwl/pull/334#issuecomment-1333147730
2022-12-01 20:51:00 -06:00
Leonardo Hernández Hernández 6df6781b43 simplify check for surface's node state
all `struct wlr_surface` should have a `wlr_scene_tree *` as data
2022-11-30 18:54:54 -06:00
Leonardo Hernández Hernández 10c56d6348 add option to allow invisible surfaces to disable idle tracking 2022-11-30 18:51:35 -06:00
Leonardo Hernández Hernández c91d21b68f do not move/resize if grabbed client is fullscreen 2022-11-30 17:54:47 -06:00
Leonardo Hernández Hernández 3213088aa2 do not try to set the parent's same tags and monitor for xwayland clients
References: https://github.com/djpohly/dwl/pull/334#issuecomment-1330166324
2022-11-30 17:42:58 -06:00
krypek 87d87cc404 Fix comparison between signed and unsigned int
When c->bw is 0, the right side of the MAX functions gets turned into an unsigned integer and that results in -1 being the outcome.
This causes big issues in xwayland clients.
2022-11-25 12:09:35 -06:00
Leonardo Hernández Hernández 087373698a Revert "Add a configuration option for fullscreen locking"
now all fullcreen clients are rendered above tiled and floating clients

This partially reverts commit 326eee1444.
2022-11-21 20:50:39 -06:00
Leonardo Hernández Hernández caec566286 create a dedicated layer for fullscreen clients
Bug: https://github.com/djpohly/dwl/issues/327
2022-11-21 20:50:26 -06:00
Leonardo Hernández Hernández 05eca0e2d9 rename xwayland_surface to xsurface
this save us 2 lines
2022-11-21 14:28:05 -06:00
Leonardo Hernández Hernández 7eebe67787 set x and y of the layersurface's geometry box 2022-11-21 14:28:05 -06:00
Leonardo Hernández Hernández 63d6de5866 fix set of layersurface->popups and surface->data 2022-11-21 14:28:04 -06:00
Leonardo Hernández Hernández 60a98b87f3 inhibit idle if surface's node is enabled 2022-11-21 14:28:04 -06:00
Leonardo Hernández Hernández 93a911d6e9 simplify if expression in checkidleinhibitor() 2022-11-21 14:28:04 -06:00
Leonardo Hernández Hernández 88d386bfdc configurex11: resize floating clients and arrange tiled clients' monitor 2022-11-21 14:27:57 -06:00
Leonardo Hernández Hernández 972e3f3050 Merge branch 'wlroots-next' into main 2022-11-21 14:16:55 -06:00
Leonardo Hernández Hernández 569f554016 don't unfocus focused client when starting a drag
this fix chromium keyboard focus loss after a drag
Fix: 3cc22de712
2022-11-19 01:34:15 -06:00
Leonardo Hernández Hernández fcb3fa4e90 Merge remote-tracking branch 'upstream/main' into wlroots-next 2022-11-10 23:25:48 -06:00
Leonardo Hernández Hernández b59c7f6a2e config.def.h: fix comment
Fixes: https://github.com/djpohly/dwl/issues/333
2022-11-10 23:14:03 -06:00
shua f1639ba9d5 check null in toplevel_from_popup
managed to SEGFAULT the server by trying to create a popup
without setting a parent first.

Not sure if this is dwl or wlroots issue, so also opened a ticket upstream: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3811
2022-11-09 00:01:50 -06:00
Leonardo Hernández Hernández 8bd3442575 layersurface: create a dedicated scene tree for popups
this tree should be always above the top layer

Fixes: https://github.com/djpohly/dwl/issues/328
2022-11-01 12:52:25 -06:00
Leonardo Hernández Hernández 3cc22de712 client: don't change border color during drags
Fixes: https://github.com/djpohly/dwl/issues/318
2022-10-31 23:46:02 -06:00
Leonardo Hernández Hernández 448a96de13 remove now unneeded workaround in outputmgrapplyortest() 2022-10-30 01:03:44 -05:00
Leonardo Hernández Hernández 99f062273e only destroy monitor's layer surfaces at destroy 2022-10-29 19:02:44 -05:00
Leonardo Hernández Hernández 8298f20a71 allow change adaptive sync in outputmgrapplyortest() 2022-10-29 18:30:09 -05:00
Leonardo Hernández Hernández 6a0ec2a8c3 Merge remote-tracking branch 'upstream/main' into wlroots-next 2022-10-29 18:11:28 -05:00
Leonardo Hernández Hernández 846ce52b92 fix crash in dirtomon() when selmon is disabled 2022-10-29 16:48:50 -05:00
Leonardo Hernández Hernández a9e2ebaf41 closemon() now updates selmon if needed 2022-10-29 16:48:50 -05:00
Leonardo Hernández Hernández 9b5f0f0fc5 use just one loop in outputmgrapplyortest()
we do the magic in updatemons()
2022-10-29 16:48:50 -05:00
Leonardo Hernández Hernández cb01ce9bcf move focus and clients off disabled monitors 2022-10-29 16:48:50 -05:00
Leonardo Hernández Hernández 9588b46b5c only raise the client's node in monocle()
Fixes: https://github.com/djpohly/dwl/issues/326
2022-10-29 16:47:17 -05:00
Leonardo Hernández Hernández 2f7834b130 sort util.c functions 2022-10-29 14:57:22 -05:00
Leonardo Hernández Hernández f494891a9a limit the line length to 79 in the readme 2022-10-29 14:47:24 -05:00
Leonardo Hernández Hernández fd2c47cb70 mention the polkit dependency when using elogind or systemd-logind
Bug: https://github.com/djpohly/dwl/issues/138
2022-10-29 14:09:38 -05:00
Leonardo Hernández Hernández 1eeb3689d3 add support for the ext-idle-notify-v1 protocol
for now we use macros to support both KDE idle and ext-idle, wlroots will
likely drop support for KDE idle in 0.17
2022-10-23 14:41:28 -05:00
Leonardo Hernández Hernández e9826de295 Revert "stop trying resize clients during commitnotify()"
This reverts commit 2d9d758c8d.

wasn't meant to be pushed to main
2022-10-15 18:25:58 -05:00
Leonardo Hernández Hernández 110cde8f67 update comment about exclusive focus in focusclient() 2022-10-15 18:09:42 -05:00
Leonardo Hernández Hernández 2d9d758c8d stop trying resize clients during commitnotify()
instead resize them in configurex11()
2022-10-15 18:00:55 -05:00
Leonardo Hernández Hernández 332ceb7136 allow unmanaged clients (like dzen or dmenu) to have keyboard focus 2022-10-15 18:00:24 -05:00
Leonardo Hernández Hernández 9e912cf790 delete the idle protocol xml file 2022-10-13 22:05:09 -05:00
Leonardo Hernández Hernández 4eabf6f7eb disable and destroy monitor's layer surfaces when it's being destroyed
Fixes: https://github.com/djpohly/dwl/issues/314
2022-10-11 13:11:14 -05:00
Leonardo Hernández Hernández 765656902f use /* */ for comments in applybounds() 2022-10-08 20:51:40 -05:00
Leonardo Hernández Hernández 1438dfc150 fix bad indentation in createpointer() 2022-10-08 20:51:05 -05:00
Leonardo Hernández Hernández 3902fba769 rename dragicondestroy() -> destroydragicon()
to match the rest of the code
2022-10-08 20:50:17 -05:00
Leonardo Hernández Hernández 7f3c9fa0ae rename LyrNoFocus -> LyrDragIcon 2022-10-08 20:48:48 -05:00
Leonardo Hernández Hernández 952fde68a3 correctly handle cursor motion when button is held (for layer surfaces) 2022-10-08 13:02:43 -05:00
Dima Krasner 0d1ca4663c allow moveresize() while the left mouse button is pressed
Fixes: https://github.com/djpohly/dwl/issues/319
2022-10-08 12:31:29 -05:00
Leonardo Hernández Hernández f6820a6c29 fix drag and drop not working
this fixes another issue where the cursor doesn't change when selecting text
but there is still an issue about not changing border color of clients during
dnd operations

Bug: https://github.com/djpohly/dwl/issues/318
2022-10-07 10:45:45 -05:00
Leonardo Hernández Hernández 87c4c1f629 convert some warnings to errors 2022-10-05 21:28:14 -05:00
Leonardo Hernández Hernández 8559141b30 avoid usage of goto
Based on this suggestion: https://github.com/guyuming76/dwl/commit/bc72af6e2430cfb8db2f5fa1b9800c86f445b6d6#commitcomment-85592855
2022-10-03 23:28:58 -05:00
Leonardo Hernández Hernández 434ed119f3 wlroots check map state of layersurfaces this for us 2022-10-01 23:33:17 -05:00
Leonardo Hernández Hernández ae3d435717 Merge remote-tracking branch 'djpohly/main' into wlroots-next 2022-10-01 23:30:47 -05:00
Leonardo Hernández Hernández b8bc54b65d properly handle cursor motion when button is held
Based on: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3653
2022-10-01 23:10:54 -05:00
Leonardo Hernández Hernández b5776e5180 avoid setting duplicate cursor image
Reference: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3436
Based on: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3595
2022-09-28 17:11:04 -05:00
Leonardo Hernández Hernández c13d948ea9 destroy renderer and allocator in cleanup() 2022-09-28 14:15:25 -05:00
Leonardo Hernández Hernández fc8b2a8335 fix bad condition 2022-09-26 20:31:36 -05:00
Leonardo Hernández Hernández c00faae263 fix various segfaults when selmon is NULL 2022-09-26 19:07:45 -05:00
Leonardo Hernández Hernández e46238b95e change cursor surface in internal calls of motionnotify()
and call motionnotify() after unmapping a client
and when focusing a client

Fixes: https://github.com/djpohly/dwl/issues/308
2022-09-26 13:17:07 -05:00
Leonardo Hernández Hernández 2385d82612 remove unused variables 2022-09-20 23:40:35 -05:00
Leonardo Hernández Hernández 31106eff64 rework Makefile
- allow user to use a different pkg-config binary
- restore almost all (and add other ones) warning flags (-Werror is not set)
- $(XWAYLAND) is added to our CPPFLAGS
- remove useless comments
- don't generate idle-protocol.h (not used)
2022-09-20 23:34:48 -05:00
Leonardo Hernández Hernández 1fdc65ff93 make more permissive exclusive focus
now you can call focusstack() while a layer surface is focused and when it gets
unmapped the newly focused clients will be actually focused
2022-09-18 17:25:12 -05:00
Leonardo Hernández Hernández fbaeb85363 now really fix clients not being focused after unmapping a layer surface 2022-09-18 17:23:07 -05:00
Leonardo Hernández Hernández 570e6e2c27 fix clients not being focused after destroy a layer surface 2022-09-18 16:52:54 -05:00
Leonardo Hernández Hernández a1b33826cf Revert "remove useless check of m in arrangelayers()"
This partially reverts commit d14ee99661.

Checking if the output is enabled is necessary to avoid a segfault later
2022-09-18 16:36:38 -05:00
Leonardo Hernández Hernández d11358762d add missing library (xcb-icccm)
this library is also used by wlroots, so nothing new
2022-09-18 15:49:30 -05:00
Leonardo Hernández Hernández 7710cf050d change the default term to foot
it is closer to the suckless philosophy (foot implements things that the suckless
guys would say that should be done by tmux or something else, but I have no
desire to create a new terminal emulator, and the best fit is foot)

also alacritty uses +100Mb of memory, more that dwl itself (~90Mb)
and foot only ~20Mb
2022-09-18 15:37:16 -05:00
Leonardo Hernández Hernández d14ee99661 remove useless check of m in arrangelayers()
it is supossed to avoid a crash when we pass m=NULL as argument
however it would crash anyway and also because we should not pass m=NULL
2022-09-18 15:35:54 -05:00
Leonardo Hernández Hernández cd96f889b8 fix use of loop initial declaration
forbidden by the suckless style
2022-09-18 15:35:54 -05:00
Leonardo Hernández Hernández bc72af6e24 fix unmanaged clients not being unlinked from the commit listener 2022-09-18 15:35:54 -05:00
Leonardo Hernández Hernández bcc8ce7a40 fix segfault when unlocking swaylock on two monitor setup
wlr_*_surface_from_wlr_surface() can return NULL if the surface
is being destroyed

Fixes: https://github.com/djpohly/dwl/issues/305
2022-09-18 15:35:54 -05:00
Leonardo Hernández Hernández ba7dcb2dea don't try to move outputs when its x,y hasn't change
when using wlr_output_layout_move() wlroots internally
change the state of the output to manually configured and
when updating the layout these outputs aren't ignored by
wlroots, leaving us at our own
2022-09-10 23:54:57 -05:00
Leonardo Hernández Hernández c8a9f63451 prior run the startup command start the backend
this allow use clients like wlr-randr in the startup command
2022-09-10 23:54:56 -05:00
Leonardo Hernández Hernández fd67087a82 make sure the parent is mapped prior set monitor and tags 2022-09-10 23:45:14 -05:00
Leonardo Hernández Hernández 77ba8e5127 use wl_container_of() instead of data in some functions 2022-09-10 23:44:19 -05:00
Leonardo Hernández Hernández c509046663 add some comments 2022-09-10 23:42:58 -05:00
Leonardo Hernández Hernández 93de6e82a2 inline input_device in virtualkeyboard() 2022-09-10 22:25:46 -05:00
Leonardo Hernández Hernández f8f94c97f5 fix idle inhibitor check
previously we tried to get a client from the surface and then compare it with
the excluded surface, if we cannot get a client from the surface (e.g: a layer
surface) it just ignored all the next idle inhibitors no matter what

What I have should done is just checking if the excluded surface is equal to
the current idle inhibitor's surface and continue in case it is.
2022-09-10 22:11:06 -05:00
Leonardo Hernández Hernández 1bb9c4583a fix exclusive zone of unmapped layer surfaces
Fixes: https://github.com/djpohly/dwl/issues/302
2022-09-10 18:54:35 -05:00
Leonardo Hernández Hernández 9bcef3d040 resize the fullscreen background when resize the client 2022-09-08 16:35:55 -05:00
Leonardo Hernández Hernández ae42e4390b update link to input-protocols 2022-09-08 00:25:26 -05:00
Leonardo Hernández Hernández 303fc72b12 append -dev to $(_VERSION) (should have added it a long time ago) 2022-09-08 00:13:03 -05:00
Leonardo Hernández Hernández 871463c327 define _POSIX_C_SOURCE through CPPFLAGS
like dwm
2022-09-08 00:10:53 -05:00
Leonardo Hernández Hernández d1496a2a9b fix condition that always evaluate to false in commitlayersurfacenotify() 2022-09-07 23:54:57 -05:00
Leonardo Hernández Hernández 80084839a9 remove obsolete check of c->mon in fullscreennotify()
since 19a8a095eb it's checked in setfullscreen()
2022-09-07 23:24:50 -05:00
Leonardo Hernández Hernández 1aacfada29 set c->prev in setmon() and not in mapnotify() 2022-09-06 13:23:19 -05:00
Leonardo Hernández Hernández dc59f7733d enable adaptive sync if supported
but don't cause monitors to be ignored if it fails
2022-09-06 00:35:20 -05:00
Leonardo Hernández Hernández 14c010a0d6 only enable/disable clients from the specified monitor in arrange()
also fix a crash when m is null, this can only happen when selmon is NULL
2022-09-06 00:10:00 -05:00
Leonardo Hernández Hernández 14a1e3e2a2 set c->prev in mapnotify()
Closes: #300
2022-09-05 16:35:51 -05:00
Dmitry Zakharchenko a94d089c40 Minor changes to README 2022-09-05 16:15:54 -05:00
Dmitry Zakharchenko e91f71e8d6 Add direct irc link
Also, move IRC section to the top so that it's more accessible.
2022-09-02 20:14:18 -05:00
Leonardo Hernández Hernández 68576799b9 don't arrange layers on disabled monitors 2022-09-02 18:49:20 -05:00
Leonardo Hernández Hernández 19a8a095eb call setfullscreen() in setmon()
this will help when sending to another monitor a fullscreen client
and also will prevent a crash when a client request fullscreen when it has no monitor
2022-09-02 18:22:15 -05:00
Leonardo Hernández Hernández 1f59b76d77 prevent segfault when destroying monitors
also don't count unmapped surfaces for exclusive zone
and exclusive_focus is now of type `void *`
2022-09-02 18:17:53 -05:00
Leonardo Hernández Hernández 40b1c0b849 Revert "Revert "various improvements to layer surface""
This reverts commit c017916d35.
2022-09-02 16:54:53 -05:00
Leonardo Hernández Hernández c017916d35 Revert "various improvements to layer surface"
see https://github.com/djpohly/dwl/issues/289#issuecomment-1231287114

This reverts commit 2260519740.
2022-08-31 16:05:19 -05:00
Leonardo Hernández Hernández 2260519740 various improvements to layer surface
- remove various useless assignments of layersurface->mon
- styles changes
- do not set wlr_layer_surface->output to NULL at destroy
2022-08-29 21:32:59 -05:00
Leonardo Hernández Hernández 0e993b5fb1 conform the idle inhibitor protocol
previously we disable idle tracking simply due to the fact that it exist
2022-08-28 22:40:11 -05:00
Leonardo Hernández Hernández 83e37820d7 add support for the single pixel buffer protocol 2022-08-28 22:15:57 -05:00
Leonardo Hernández Hernández d738573e22 new function to notify keyboard enter 2022-08-27 16:34:29 -05:00
Leonardo Hernández Hernández b9295e8cee sort client.h functions 2022-08-27 16:33:46 -05:00
Leonardo Hernández Hernández e0cc5b046c Merge remote-tracking branch 'djpohly/main' into wlroots-next 2022-08-26 18:26:36 -05:00
Leonardo Hernández Hernández 406aebcbd2 prevent an infinite loop if try to use focusmon() with all monitors disabled 2022-08-25 00:20:21 -05:00
Leonardo Hernández Hernández dfcd142ce4 don't try to set monitor for clients in createmon()
this is done in updatemons()
2022-08-23 13:29:12 -05:00
Leonardo Hernández Hernández 07bf1832bf set monitor for clients that don't have one in updatemons()
only if selmon is enabled and the clients are mapped
2022-08-23 13:28:01 -05:00
Leonardo Hernández Hernández 174919ec53 set monitor for clients that don't have one on monitor creation 2022-08-18 16:55:13 -05:00
Leonardo Hernández Hernández a7f77160d1 don't respect size hints for fullscreen clients
Fixes: #292
2022-08-16 21:39:42 -05:00
Leonardo Hernández Hernández 7a343b98cf change type of c->bw: int -> unsigned int 2022-08-13 00:41:08 -05:00
Leonardo Hernández Hernández 8d2516e83c reorder isfullscreen in Client definition 2022-08-13 00:38:08 -05:00
Leonardo Hernández Hernández f173c56c32 initialize to zero the box used in commitnotify() 2022-08-13 00:12:46 -05:00
Leonardo Hernández Hernández 28af37cd1f handle client_from_wlr_surface() receiving a subsurface 2022-08-12 23:58:11 -05:00
Leonardo Hernández Hernández 48396a1bf8 fix crash when setting a custom mode 2022-08-12 23:21:25 -05:00
Leonardo Hernández Hernández b6e3fc1645 rework outputmgrapplyortest()
first disable requested monitors, then enable and/or change mode, x and y, etc.
This is mostly what sway does
2022-08-12 23:21:25 -05:00
Devin J. Pohly 3431ac165d 2200: let's use this wisely
Looks like [suckless-dev] was right about one thing.
2022-08-12 23:21:00 -05:00
Leonardo Hernández Hernández 6ce035303e fix dist target 2022-08-08 21:30:37 -05:00
Leonardo Hernández Hernández 620fd9dc56 use git describe to generate version 2022-08-08 21:19:16 -05:00
Leonardo Hernández Hernández 662e06e68e check client_from_wlr_surface() returning NULL in urgent()
fix #281
2022-07-30 14:44:17 -05:00
Dima Krasner 9d2eb8483b fix segfault if parent->mon is unset 2022-07-25 01:19:36 -05:00
Leonardo Hernández Hernández 7eee0a8229 use the layer surface to create popups 2022-07-24 16:43:13 -05:00
Leonardo Hernández Hernández 058c699ac2 only set bounds for clients that support it 2022-07-15 00:27:31 -05:00
Leonardo Hernández Hernández 461d02d3e0 chase wlroots input_device changes 2022-06-21 16:25:18 -05:00
Leonardo Hernández Hernández a32db11f16 set client bounds at resize 2022-06-09 12:45:42 -05:00
Leonardo Hernández Hernández 948fdcf709 use xdg-shell v4 2022-06-09 12:45:02 -05:00
Leonardo Hernández Hernández 4b890336e2 use xdg-shell v3 2022-06-07 00:55:41 -05:00
Leonardo Hernández Hernández c7007b4811 chase wlroots scene-tree changes 2022-06-07 00:31:58 -05:00
Leonardo Hernández Hernández 283c043b5c chase wlroots scene-surface refactor 2022-05-21 20:44:08 -05:00
Leonardo Hernández Hernández 88a8b784d0 Merge remote-tracking branch 'djpohly/main' into wlroots-next
chase wlroots X11 hints update
2022-05-17 15:31:31 -05:00
Leonardo Hernández Hernández 79a148224f specify version in wlr_xdg_shell_create() 2022-05-15 17:17:58 -05:00
Leonardo Hernández Hernández dca68f9aa1 Merge remote-tracking branch 'djpohly/main' into wlroots-next 2022-05-10 20:08:41 -05:00
Leonardo Hernández Hernández 31fa6600a1 replace wlr_xwayland_surface_size_hints with xcb_size_hints_t 2022-05-08 17:51:42 -05:00
Leonardo Hernández Hernández dc7709a00e schedule a configure on maximize request
see maximizenotify() for more info
2022-04-16 15:51:13 -05:00
Leonardo Hernández Hernández 4a2e761914 replace deleted EBARF() with die() 2022-04-12 23:52:05 -05:00
Leonardo Hernández Hernández 29a2b647b2 Merge remote-tracking branch 'djpohly/main' into HEAD 2022-04-08 21:12:32 -05:00
Devin J. Pohly dd0b8e4c37 Merge pull request #212 from djpohly/xwaitland
make sure to leave XWayland process waitable
2022-03-29 16:22:44 -05:00
Devin J. Pohly 0ddde0c85a move sigchld() into XWayland section 2022-03-29 16:09:29 -05:00
Devin J. Pohly e08bd12922 make sure to leave XWayland process waitable
On SIGCHLD, check to make sure the terminated process is not the
XWayland process before reaping it, allowing wlroots to waitpid() for it
successfully.

Fixes #177.
2022-03-29 15:55:06 -05:00
Leonardo Hernández Hernández 7018ed9218 createpointer now takes wlr_pointer 2022-03-25 15:27:36 -06:00
Leonardo Hernández Hernández f75e426222 createkeyboard now takes wlr_keyboard 2022-03-25 15:27:36 -06:00
Leonardo Hernández Hernández faaee90cbd destroy scene_output in cleanupmon() 2022-03-23 18:22:41 -06:00
Leonardo Hernández Hernández 3e79a9a5d7 fix drag icon's surface returned by xytonode 2022-03-23 18:22:40 -06:00
Leonardo Hernández Hernández c2899bc00b set position of the drag icon in startdrag() 2022-03-23 18:22:40 -06:00
Leonardo Hernández Hernández f353a0e759 Revert "clients now works as expected in drag motion"
This reverts commit 9aec6049ec.

this problem is caused because xytonode() returns the surface of the
drag icon
2022-03-23 18:22:40 -06:00
Guido Cella 281c947e5f inline the presentation variable
This variable can be removed since with scene-graph
wlr_presentation_surface_sampled_on_output no longer needs to be called.
2022-03-23 18:22:40 -06:00
Leonardo Hernández Hernández 855e6c1898 add note about how to change MODKEY for windows key 2022-03-23 18:22:40 -06:00
Palanix a41d6cb00f Fix dwl freezing when resizing 2022-03-23 18:22:40 -06:00
Quentin Rameau b42abeac69 Add a configuration option for fullscreen locking
Some people are annoyed to have this new behaviour forced for some
application which use fake fullscreen.
2022-03-23 18:22:40 -06:00
Leonardo Hernández Hernández 5a1debb5f0 add sway LICENSE file
part of the code in dwl is taken from sway, so credit it.
dwm and sway are both licensed under the MIT license
2022-03-23 18:22:40 -06:00
Guido Cella 1a5b7e068b update IRC channel 2022-03-23 18:22:40 -06:00
Humm 0db6f3c5b5 add dwl(1)
Documentation is good.  Man pages are documentation.  A program without
a man page is worthless.
2022-03-23 18:22:40 -06:00
Leonardo Hernández Hernández d8ab893dab clients now works as expected in drag motion 2022-03-23 18:22:40 -06:00
Guido Cella f2be10fd43 implement drag and drop
For brevity, only a single drag icon at a time is supported.

Co-authored-by: Leonardo Hernández Hernández <leohdz172@protonmail.com>
2022-03-23 18:22:39 -06:00
Sevz 23af627d80 Update issue templates 2022-03-23 18:22:39 -06:00
Leonardo Hernández Hernández a7f7777907 only skip frames if there are visible clients that have a resize 2022-03-23 18:22:39 -06:00
Leonardo Hernández Hernández 40db9c88ea remove a useless resize in mapnotify()
applyrules() calls setmon() which calls resize()
2022-03-23 18:22:39 -06:00
Leonardo Hernández Hernández 4276410a3d improve floating detection
mostly copied from sway
2022-03-23 18:22:39 -06:00
Leonardo Hernández Hernández 0662bc5a69 wlr_seat_set_keyboard() now takes wlr_keyboard as parameter 2022-03-23 09:01:01 -06:00
Leonardo Hernández Hernández a66210ebbc Merge branch 'main' into wlroots-next 2022-03-20 16:02:18 -06:00
Leonardo Hernández Hernández c8290f8c55 Merge branch 'wlroots-next' into scenegraph-wlroots-next 2022-03-18 17:21:41 -06:00
Leonardo Hernández Hernández 98f33cd01d follow up wlroots input device events renaming 2022-03-18 17:20:31 -06:00
Leonardo Hernandez Hernandez a7c4f6100a use scene layer shell helper 2022-03-11 16:03:58 -06:00
Leonardo Hernández Hernández 3577802541 Merge branch 'wlroots-next' into scenegraph-wlroots-next 2022-03-11 16:02:00 -06:00
Leonardo Hernández Hernández 230d3432e9 wlr_virtual_keyboard_v1 now has its own wlr_keyboard
which has its own wlr_input_device

Signed-off-by: Leonardo Hernández Hernández <leohdz172@protonmail.com>
2022-03-10 10:37:18 -06:00
Leonardo Hernández Hernández 432c15fb09 Merge branch 'main' into wlroots-next 2022-03-10 10:34:43 -06:00
Sevz 2630664fef Merge pull request #193 from fauxmight/chasing-wlroots
Chasing wlroots
2022-03-10 10:11:17 -06:00
A Frederick Christensen 76b3756d11 Merge remote-tracking branch 'origin/wlroots-xdg-shell-refactor' into chasing-wlroots 2022-02-03 23:23:53 -06:00
A Frederick Christensen 97881c88c7 Merge remote-tracking branch 'origin/output-layout-get-box-update' into chasing-wlroots 2022-02-03 23:22:19 -06:00
A Frederick Christensen b8ce8d0fbb Account for changes expecting wlr_xdg_toplevel rather than wlr_xdg_surface 2022-02-03 21:54:44 -06:00
A Frederick Christensen ed44bc0c90 update wlr-output-layout-get-box 2022-02-02 23:18:58 -06:00
A Frederick Christensen 3300f6c911 Upgrade for wlroots surface refactoring
See [1] for details.

[1]: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3412
2022-01-18 11:33:56 -06:00
Devin J. Pohly 04079a0946 Merge branch 'wlroots-next' into push 2021-04-26 07:34:59 -05:00
Devin J. Pohly daf5ee475f Merge branch 'main' into push 2021-03-10 15:37:57 -06:00
Devin J. Pohly 156a13d9f9 add missing header 2021-03-04 13:52:58 -06:00
Devin J. Pohly dcb7a4d910 port dwm "push" patch to dwl 2021-03-04 00:45:50 -06:00
13 changed files with 1263 additions and 880 deletions
+1 -6
View File
@@ -8,15 +8,10 @@ assignees: ''
--- ---
## Info ## Info
dwl's commit: dwl version:
wlroots version: wlroots version:
## Description ## Description
<!-- <!--
Only report bugs that can be reproduced on the main line Only report bugs that can be reproduced on the main line
Report patch issues to their respective authors Report patch issues to their respective authors
If the patch author doesn't respond within a reasonable time, email me:
Leonardo Hernández Hernández <leohdz172@protonmail.com>
but note that I'm NOT making any promises
--> -->
+14 -23
View File
@@ -4,56 +4,47 @@
include config.mk include config.mk
# flags for compiling # flags for compiling
DWLCPPFLAGS = -I. -DWLR_USE_UNSTABLE -DVERSION=\"$(VERSION)\" DWLCPPFLAGS = -I. -DWLR_USE_UNSTABLE -D_POSIX_C_SOURCE=200809L -DVERSION=\"$(VERSION)\" $(XWAYLAND)
DWLDEVCFLAGS = -pedantic -Wall -Wextra -Wdeclaration-after-statement -Wno-unused-parameter -Wno-sign-compare -Wshadow -Wunused-macros\
# Wayland utils -Werror=strict-prototypes -Werror=implicit -Werror=return-type -Werror=incompatible-pointer-types
WAYLAND_PROTOCOLS = `pkg-config --variable=pkgdatadir wayland-protocols`
WAYLAND_SCANNER = `pkg-config --variable=wayland_scanner wayland-scanner`
# CFLAGS / LDFLAGS # CFLAGS / LDFLAGS
PKGS = wlroots wayland-server xkbcommon libinput $(XLIBS) PKGS = wlroots wayland-server xkbcommon libinput $(XLIBS)
DWLCFLAGS = `pkg-config --cflags $(PKGS)` $(DWLCPPFLAGS) $(CFLAGS) $(XWAYLAND) DWLCFLAGS = `$(PKG_CONFIG) --cflags $(PKGS)` $(DWLCPPFLAGS) $(DWLDEVCFLAGS) $(CFLAGS)
LDLIBS = `pkg-config --libs $(PKGS)` $(LIBS) LDLIBS = `$(PKG_CONFIG) --libs $(PKGS)` $(LIBS)
# build rules all: dwl
dwl: dwl.o util.o
$(CC) dwl.o util.o $(LDLIBS) $(LDFLAGS) $(DWLCFLAGS) -o $@
dwl.o: dwl.c push.c config.mk config.h client.h xdg-shell-protocol.h wlr-layer-shell-unstable-v1-protocol.h
util.o: util.c util.h
# wayland-scanner is a tool which generates C headers and rigging for Wayland # wayland-scanner is a tool which generates C headers and rigging for Wayland
# protocols, which are specified in XML. wlroots requires you to rig these up # protocols, which are specified in XML. wlroots requires you to rig these up
# to your build system yourself and provide them in the include path. # to your build system yourself and provide them in the include path.
all: dwl WAYLAND_SCANNER = `$(PKG_CONFIG) --variable=wayland_scanner wayland-scanner`
dwl: dwl.o util.o WAYLAND_PROTOCOLS = `$(PKG_CONFIG) --variable=pkgdatadir wayland-protocols`
$(CC) dwl.o util.o $(LDLIBS) $(LDFLAGS) $(DWLCFLAGS) -o $@
dwl.o: dwl.c config.mk config.h client.h xdg-shell-protocol.h wlr-layer-shell-unstable-v1-protocol.h idle-protocol.h
util.o: util.c util.h
# wayland scanner rules to generate .h / .c files
xdg-shell-protocol.h: xdg-shell-protocol.h:
$(WAYLAND_SCANNER) server-header \ $(WAYLAND_SCANNER) server-header \
$(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $@ $(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $@
wlr-layer-shell-unstable-v1-protocol.h: wlr-layer-shell-unstable-v1-protocol.h:
$(WAYLAND_SCANNER) server-header \ $(WAYLAND_SCANNER) server-header \
protocols/wlr-layer-shell-unstable-v1.xml $@ protocols/wlr-layer-shell-unstable-v1.xml $@
idle-protocol.h:
$(WAYLAND_SCANNER) server-header \
protocols/idle.xml $@
config.h: config.h:
cp config.def.h $@ cp config.def.h $@
clean: clean:
rm -f dwl *.o *-protocol.h rm -f dwl *.o *-protocol.h
# distribution archive
dist: clean dist: clean
mkdir -p dwl-$(VERSION) mkdir -p dwl-$(VERSION)
cp -R LICENSE* Makefile README.md generate-version.sh client.h\ cp -R LICENSE* Makefile README.md client.h config.def.h\
config.def.h config.mk protocols dwl.1 dwl.c util.c util.h\ config.mk protocols dwl.1 dwl.c util.c util.h\
dwl-$(VERSION) dwl-$(VERSION)
echo "echo $(VERSION)" > dwl-$(VERSION)/generate-version.sh
tar -caf dwl-$(VERSION).tar.gz dwl-$(VERSION) tar -caf dwl-$(VERSION).tar.gz dwl-$(VERSION)
rm -rf dwl-$(VERSION) rm -rf dwl-$(VERSION)
# install rules
install: dwl install: dwl
mkdir -p $(DESTDIR)$(PREFIX)/bin mkdir -p $(DESTDIR)$(PREFIX)/bin
cp -f dwl $(DESTDIR)$(PREFIX)/bin cp -f dwl $(DESTDIR)$(PREFIX)/bin
+90 -33
View File
@@ -1,20 +1,29 @@
# dwl - dwm for Wayland # dwl - dwm for Wayland
Join us on our [Discord server](https://discord.gg/jJxZnrGPWN)! Join us on our [Discord server] or at [#dwl] on irc.libera.chat.
dwl is a compact, hackable compositor for Wayland based on [wlroots](https://gitlab.freedesktop.org/wlroots/wlroots/). It is intended to fill the same space in the Wayland world that dwm does in X11, primarily in terms of philosophy, and secondarily in terms of functionality. Like dwm, dwl is: dwl is a compact, hackable compositor for [Wayland] based on [wlroots]. It is
intended to fill the same space in the Wayland world that dwm does in X11,
primarily in terms of philosophy, and secondarily in terms of functionality.
Like dwm, dwl is:
- Easy to understand, hack on, and extend with patches - Easy to understand, hack on, and extend with patches
- One C source file (or a very small number) configurable via `config.h` - One C source file (or a very small number) configurable via `config.h`
- Limited to 2000 SLOC to promote hackability - Limited to 2200 SLOC to promote hackability
- Tied to as few external dependencies as possible - Tied to as few external dependencies as possible
dwl is not meant to provide every feature under the sun. Instead, like dwm, it sticks to features which are necessary, simple, and straightforward to implement given the base on which it is built. Implemented default features are: dwl is not meant to provide every feature under the sun. Instead, like dwm, it
sticks to features which are necessary, simple, and straightforward to implement
given the base on which it is built. Implemented default features are:
- Any features provided by dwm/Xlib: simple window borders, tags, keybindings, client rules, mouse move/resize. Providing a built-in status bar is an exception to this goal, to avoid dependencies on font rendering and/or drawing libraries when an external bar could work well. - Any features provided by dwm/Xlib: simple window borders, tags, keybindings,
client rules, mouse move/resize. Providing a built-in status bar is an
exception to this goal, to avoid dependencies on font rendering and/or
drawing libraries when an external bar could work well.
- Configurable multi-monitor layout support, including position and rotation - Configurable multi-monitor layout support, including position and rotation
- Configurable HiDPI/multi-DPI support - Configurable HiDPI/multi-DPI support
- Idle-inhibit protocol which lets applications such as mpv disable idle monitoring - Idle-inhibit protocol which lets applications such as mpv disable idle
monitoring
- Provide information to external status bars via stdout/stdin - Provide information to external status bars via stdout/stdin
- Urgency hints via xdg-activate protocol - Urgency hints via xdg-activate protocol
- Support screen lockers via input-inhibitor protocol - Support screen lockers via input-inhibitor protocol
@@ -27,37 +36,68 @@ dwl is not meant to provide every feature under the sun. Instead, like dwm, it s
Features under consideration (possibly as patches) are: Features under consideration (possibly as patches) are:
- Protocols made trivial by wlroots - Protocols made trivial by wlroots
- Implement the text-input and input-method protocols to support IME once ibus implements input-method v2 (see https://github.com/ibus/ibus/pull/2256 and https://github.com/djpohly/dwl/pull/12) - Implement the text-input and input-method protocols to support IME once ibus
implements input-method v2 (see https://github.com/ibus/ibus/pull/2256 and
https://github.com/djpohly/dwl/pull/235)
Feature *non-goals* for the main codebase include: Feature *non-goals* for the main codebase include:
- Client-side decoration (any more than is necessary to tell the clients not to) - Client-side decoration (any more than is necessary to tell the clients not to)
- Client-initiated window management, such as move, resize, and close, which can be done through the compositor - Client-initiated window management, such as move, resize, and close, which can
be done through the compositor
- Animations and visual effects - Animations and visual effects
## Building dwl ## Building dwl
dwl has only two dependencies: `wlroots` and `wayland-protocols`. dwl has only two dependencies: `wlroots` and `wayland-protocols`.
Simply install these (and their `-devel` versions if your distro has separate development packages) and run `make`. If you wish to build against a Git version of wlroots, check out the [wlroots-next branch](https://github.com/djpohly/dwl/tree/wlroots-next). Simply install these (and their `-devel` versions if your distro has separate
development packages) and run `make`. If you wish to build against a Git
version of wlroots, check out the [wlroots-next branch].
To enable XWayland, you should also install xorg-xwayland and uncomment its flag in `config.mk`. To enable XWayland, you should also install xorg-xwayland and uncomment its flag
in `config.mk`.
## Configuration ## Configuration
All configuration is done by editing `config.h` and recompiling, in the same manner as dwm. There is no way to separately restart the window manager in Wayland without restarting the entire display server, so any changes will take effect the next time dwl is executed. All configuration is done by editing `config.h` and recompiling, in the same
manner as dwm. There is no way to separately restart the window manager in
Wayland without restarting the entire display server, so any changes will take
effect the next time dwl is executed.
As in the dwm community, we encourage users to share patches they have created. Check out the [patches page on our wiki](https://github.com/djpohly/dwl/wiki/Patches)! As in the dwm community, we encourage users to share patches they have created.
Check out the [patches page on our wiki]!
## Running dwl ## Running dwl
dwl can be run on any of the backends supported by wlroots. This means you can run it as a separate window inside either an X11 or Wayland session, as well as directly from a VT console. Depending on your distro's setup, you may need to add your user to the `video` and `input` groups before you can run dwl on a VT. dwl can be run on any of the backends supported by wlroots. This means you can
run it as a separate window inside either an X11 or Wayland session, as well
as directly from a VT console. Depending on your distro's setup, you may need
to add your user to the `video` and `input` groups before you can run dwl on
a VT. If you are using `elogind` or `systemd-logind` you need to install
polkit; otherwise you need to add yourself in the `seat` group and
enable/start the seatd daemon.
When dwl is run with no arguments, it will launch the server and begin handling any shortcuts configured in `config.h`. There is no status bar or other decoration initially; these are instead clients that can be run within the Wayland session. When dwl is run with no arguments, it will launch the server and begin handling
any shortcuts configured in `config.h`. There is no status bar or other
decoration initially; these are instead clients that can be run within
the Wayland session.
If you would like to run a script or command automatically at startup, you can specify the command using the `-s` option. This command will be executed as a shell command using `/bin/sh -c`. It serves a similar function to `.xinitrc`, but differs in that the display server will not shut down when this process terminates. Instead, dwl will send this process a SIGTERM at shutdown and wait for it to terminate (if it hasn't already). This makes it ideal for execing into a user service manager like [s6](https://skarnet.org/software/s6/), [anopa](https://jjacky.com/anopa/), [runit](http://smarden.org/runit/faq.html#userservices), or [`systemd --user`](https://wiki.archlinux.org/title/Systemd/User). If you would like to run a script or command automatically at startup, you can
specify the command using the `-s` option. This command will be executed as a
shell command using `/bin/sh -c`. It serves a similar function to `.xinitrc`,
but differs in that the display server will not shut down when this process
terminates. Instead, dwl will send this process a SIGTERM at shutdown and wait
for it to terminate (if it hasn't already). This makes it ideal for execing into
a user service manager like [s6], [anopa], [runit], or [`systemd --user`].
Note: The `-s` command is run as a *child process* of dwl, which means that it does not have the ability to affect the environment of dwl or of any processes that it spawns. If you need to set environment variables that affect the entire dwl session, these must be set prior to running dwl. For example, Wayland requires a valid `XDG_RUNTIME_DIR`, which is usually set up by a session manager such as `elogind` or `systemd-logind`. If your system doesn't do this automatically, you will need to configure it prior to launching `dwl`, e.g.: Note: The `-s` command is run as a *child process* of dwl, which means that it
does not have the ability to affect the environment of dwl or of any processes
that it spawns. If you need to set environment variables that affect the entire
dwl session, these must be set prior to running dwl. For example, Wayland
requires a valid `XDG_RUNTIME_DIR`, which is usually set up by a session manager
such as `elogind` or `systemd-logind`. If your system doesn't do this
automatically, you will need to configure it prior to launching `dwl`, e.g.:
export XDG_RUNTIME_DIR=/tmp/xdg-runtime-$(id -u) export XDG_RUNTIME_DIR=/tmp/xdg-runtime-$(id -u)
mkdir -p $XDG_RUNTIME_DIR mkdir -p $XDG_RUNTIME_DIR
@@ -65,36 +105,53 @@ Note: The `-s` command is run as a *child process* of dwl, which means that it d
### Status information ### Status information
Information about selected layouts, current window title, and selected/occupied/urgent tags is written to the stdin of the `-s` command (see the `printstatus()` function for details). This information can be used to populate an external status bar with a script that parses the information. Failing to read this information will cause dwl to block, so if you do want to run a startup command that does not consume the status information, you can close standard input with the `<&-` shell redirection, for example: Information about selected layouts, current window title, and
selected/occupied/urgent tags is written to the stdin of the `-s` command (see
the `printstatus()` function for details). This information can be used to
populate an external status bar with a script that parses the information.
Failing to read this information will cause dwl to block, so if you do want to
run a startup command that does not consume the status information, you can
close standard input with the `<&-` shell redirection, for example:
dwl -s 'foot --server <&-' dwl -s 'foot --server <&-'
If your startup command is a shell script, you can achieve the same inside the script with the line If your startup command is a shell script, you can achieve the same inside the
script with the line
exec <&- exec <&-
Existing dwl-specific status bars and dwl-specific scripts for other status bars include: To get a list of status bars that work with dwl consult our [wiki].
- [somebar](https://sr.ht/~raphi/somebar/) status bar designed for dwl
- [dtaobarv2.sh](https://cdn.discordapp.com/attachments/792078050024095745/862428883423723560/dtaobarv2.sh) for use with [dtao](https://github.com/djpohly/dtao) (See "Pinned Messages" on the "customizations" channel of the [dwl Discord server](https://discord.gg/jJxZnrGPWN) for details.)
- [dwlbar.sh](https://cdn.discordapp.com/attachments/792078050024095745/810926218529472592/dwlbar.sh) for use with [waybar](https://github.com/Alexays/Waybar) (See "Pinned Messages" on the "customizations" channel of the [dwl Discord server](https://discord.gg/jJxZnrGPWN) for details.)
- [waybar-dwl](https://codeberg.org/fauxmight/waybar-dwl.git) for use with [waybar](https://github.com/Alexays/Waybar)
- [dwl-tags.sh](https://codeberg.org/novakane/yambar/src/branch/master/examples/scripts/dwl-tags.sh) for use with [yambar](https://codeberg.org/dnkl/yambar)
- [waybar-dwl.sh](https://gitee.com/guyuming76/personal/tree/dwl/gentoo/waybar-dwl) for use with [waybar](https://github.com/Alexays/Waybar) (ACCESS TO THIS SCRIPT REQUIRES gitee.com LOGIN!)
## Replacements for X applications ## Replacements for X applications
You can find a [list of Wayland applications on the sway wiki](https://github.com/swaywm/sway/wiki/i3-Migration-Guide). You can find a [list of useful resources on our wiki].
## IRC channel
dwl's IRC channel is #dwl on irc.libera.chat.
## Acknowledgements ## Acknowledgements
dwl began by extending the TinyWL example provided (CC0) by the sway/wlroots developers. This was made possible in many cases by looking at how sway accomplished something, then trying to do the same in as suckless a way as possible. dwl began by extending the TinyWL example provided (CC0) by the sway/wlroots
developers. This was made possible in many cases by looking at how sway
accomplished something, then trying to do the same in as suckless a way as
possible.
Many thanks to suckless.org and the dwm developers and community for the inspiration, and to the various contributors to the project, including: Many thanks to suckless.org and the dwm developers and community for the
inspiration, and to the various contributors to the project, including:
- Alexander Courtis for the XWayland implementation - Alexander Courtis for the XWayland implementation
- Guido Cella for the layer-shell protocol implementation, patch maintenance, and for helping to keep the project running - Guido Cella for the layer-shell protocol implementation, patch maintenance,
and for helping to keep the project running
- Stivvo for output management and fullscreen support, and patch maintenance - Stivvo for output management and fullscreen support, and patch maintenance
[Discord server]: https://discord.gg/jJxZnrGPWN
[#dwl]: https://web.libera.chat/?channels=#dwl
[Wayland]: https://wayland.freedesktop.org/
[wlroots]: https://gitlab.freedesktop.org/wlroots/wlroots/
[wlroots-next branch]: https://github.com/djpohly/dwl/tree/wlroots-next
[patches page on our wiki]: https://github.com/djpohly/dwl/wiki/Patches
[s6]: https://skarnet.org/software/s6/
[anopa]: https://jjacky.com/anopa/
[runit]: http://smarden.org/runit/faq.html#userservices
[`systemd --user`]: https://wiki.archlinux.org/title/Systemd/User
[wiki]: https://github.com/djpohly/dwl/wiki#compatible-status-bars
[list of useful resources on our wiki]:
https://github.com/djpohly/dwl/wiki#migrating-from-x
+230 -128
View File
@@ -16,6 +16,31 @@ client_is_x11(Client *c)
#endif #endif
} }
static inline void
client_get_size_hints(Client *c, struct wlr_box *max, struct wlr_box *min)
{
struct wlr_xdg_toplevel *toplevel;
struct wlr_xdg_toplevel_state *state;
#ifdef XWAYLAND
if (client_is_x11(c)) {
xcb_size_hints_t *size_hints = c->surface.xwayland->size_hints;
if (size_hints) {
max->width = size_hints->max_width;
max->height = size_hints->max_height;
min->width = size_hints->min_width;
min->height = size_hints->min_height;
}
return;
}
#endif
toplevel = c->surface.xdg->toplevel;
state = &toplevel->current;
max->width = state->max_width;
max->height = state->max_height;
min->width = state->min_width;
min->height = state->min_height;
}
static inline struct wlr_surface * static inline struct wlr_surface *
client_surface(Client *c) client_surface(Client *c)
{ {
@@ -26,23 +51,67 @@ client_surface(Client *c)
return c->surface.xdg->surface; return c->surface.xdg->surface;
} }
static inline Client * static inline int
client_from_wlr_surface(struct wlr_surface *s) toplevel_from_wlr_surface(struct wlr_surface *s, Client **pc, LayerSurface **pl)
{ {
struct wlr_xdg_surface *surface; struct wlr_xdg_surface *xdg_surface;
struct wlr_surface *root_surface;
struct wlr_layer_surface_v1 *layer_surface;
Client *c = NULL;
LayerSurface *l = NULL;
int type = -1;
#ifdef XWAYLAND #ifdef XWAYLAND
struct wlr_xwayland_surface *xsurface; struct wlr_xwayland_surface *xsurface;
if (s && wlr_surface_is_xwayland_surface(s)
&& (xsurface = wlr_xwayland_surface_from_wlr_surface(s)))
return xsurface->data;
#endif #endif
if (s && wlr_surface_is_xdg_surface(s)
&& (surface = wlr_xdg_surface_from_wlr_surface(s))
&& surface->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL)
return surface->data;
return NULL; if (!s)
return type;
root_surface = wlr_surface_get_root_surface(s);
#ifdef XWAYLAND
if (wlr_surface_is_xwayland_surface(root_surface)
&& (xsurface = wlr_xwayland_surface_from_wlr_surface(root_surface))) {
c = xsurface->data;
type = c->type;
goto end;
}
#endif
if (wlr_surface_is_layer_surface(root_surface)
&& (layer_surface = wlr_layer_surface_v1_from_wlr_surface(root_surface))) {
l = layer_surface->data;
type = LayerShell;
goto end;
}
if (wlr_surface_is_xdg_surface(root_surface)
&& (xdg_surface = wlr_xdg_surface_from_wlr_surface(root_surface))) {
while (1) {
switch (xdg_surface->role) {
case WLR_XDG_SURFACE_ROLE_POPUP:
if (!xdg_surface->popup->parent)
return -1;
else if (!wlr_surface_is_xdg_surface(xdg_surface->popup->parent))
return toplevel_from_wlr_surface(xdg_surface->popup->parent, pc, pl);
xdg_surface = wlr_xdg_surface_from_wlr_surface(xdg_surface->popup->parent);
break;
case WLR_XDG_SURFACE_ROLE_TOPLEVEL:
c = xdg_surface->data;
type = c->type;
goto end;
case WLR_XDG_SURFACE_ROLE_NONE:
return -1;
}
}
}
end:
if (pl)
*pl = l;
if (pc)
*pc = c;
return type;
} }
/* The others */ /* The others */
@@ -61,7 +130,20 @@ client_activate_surface(struct wlr_surface *s, int activated)
if (wlr_surface_is_xdg_surface(s) if (wlr_surface_is_xdg_surface(s)
&& (surface = wlr_xdg_surface_from_wlr_surface(s)) && (surface = wlr_xdg_surface_from_wlr_surface(s))
&& surface->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL) && surface->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL)
wlr_xdg_toplevel_set_activated(surface, activated); wlr_xdg_toplevel_set_activated(surface->toplevel, activated);
}
static inline uint32_t
client_set_bounds(Client *c, int32_t width, int32_t height)
{
#ifdef XWAYLAND
if (client_is_x11(c))
return 0;
#endif
if (c->surface.xdg->client->shell->version >=
XDG_TOPLEVEL_CONFIGURE_BOUNDS_SINCE_VERSION && width >= 0 && height >= 0)
return wlr_xdg_toplevel_set_bounds(c->surface.xdg->toplevel, width, height);
return 0;
} }
static inline void static inline void
@@ -100,30 +182,18 @@ client_get_geometry(Client *c, struct wlr_box *geom)
wlr_xdg_surface_get_geometry(c->surface.xdg, geom); wlr_xdg_surface_get_geometry(c->surface.xdg, geom);
} }
static inline void static inline Client *
client_get_size_hints(Client *c, struct wlr_box *max, struct wlr_box *min) client_get_parent(Client *c)
{ {
struct wlr_xdg_toplevel *toplevel; Client *p = NULL;
struct wlr_xdg_toplevel_state *state;
#ifdef XWAYLAND #ifdef XWAYLAND
if (client_is_x11(c)) { if (client_is_x11(c) && c->surface.xwayland->parent)
struct wlr_xwayland_surface_size_hints *size_hints; toplevel_from_wlr_surface(c->surface.xwayland->parent->surface, &p, NULL);
size_hints = c->surface.xwayland->size_hints;
if (size_hints) {
max->width = size_hints->max_width;
max->height = size_hints->max_height;
min->width = size_hints->min_width;
min->height = size_hints->min_height;
}
return;
}
#endif #endif
toplevel = c->surface.xdg->toplevel; if (c->surface.xdg->toplevel->parent)
state = &toplevel->current; toplevel_from_wlr_surface(c->surface.xdg->toplevel->parent->base->surface, &p, NULL);
max->width = state->max_width;
max->height = state->max_height; return p;
min->width = state->min_width;
min->height = state->min_height;
} }
static inline const char * static inline const char *
@@ -136,20 +206,6 @@ client_get_title(Client *c)
return c->surface.xdg->toplevel->title; return c->surface.xdg->toplevel->title;
} }
static inline Client *
client_get_parent(Client *c)
{
Client *p;
#ifdef XWAYLAND
if (client_is_x11(c) && c->surface.xwayland->parent)
return client_from_wlr_surface(c->surface.xwayland->parent->surface);
#endif
if (c->surface.xdg->toplevel->parent)
return client_from_wlr_surface(c->surface.xdg->toplevel->parent->surface);
return NULL;
}
static inline int static inline int
client_is_float_type(Client *c) client_is_float_type(Client *c)
{ {
@@ -168,26 +224,61 @@ client_is_float_type(Client *c)
|| surface->window_type[i] == netatom[NetWMWindowTypeToolbar] || surface->window_type[i] == netatom[NetWMWindowTypeToolbar]
|| surface->window_type[i] == netatom[NetWMWindowTypeUtility]) || surface->window_type[i] == netatom[NetWMWindowTypeUtility])
return 1; return 1;
return ((min.width > 0 || min.height > 0 || max.width > 0 || max.height > 0)
&& (min.width == max.width || min.height == max.height))
|| c->surface.xwayland->parent;
} }
#endif #endif
return ((min.width > 0 || min.height > 0 || max.width > 0 || max.height > 0) return ((min.width > 0 || min.height > 0 || max.width > 0 || max.height > 0)
&& (min.width == max.width || min.height == max.height)) && (min.width == max.width || min.height == max.height));
|| c->surface.xdg->toplevel->parent;
} }
static inline int static inline int
client_wants_fullscreen(Client *c) client_is_mapped(Client *c)
{ {
#ifdef XWAYLAND #ifdef XWAYLAND
if (client_is_x11(c)) if (client_is_x11(c))
return c->surface.xwayland->fullscreen; return c->surface.xwayland->mapped;
#endif #endif
return c->surface.xdg->toplevel->requested.fullscreen; return c->surface.xdg->mapped;
}
static inline int
client_is_rendered_on_mon(Client *c, Monitor *m)
{
/* This is needed for when you don't want to check formal assignment,
* but rather actual displaying of the pixels.
* Usually VISIBLEON suffices and is also faster. */
struct wlr_surface_output *s;
if (!c->scene->node.enabled)
return 0;
wl_list_for_each(s, &client_surface(c)->current_outputs, link)
if (s->output == m->wlr_output)
return 1;
return 0;
}
static inline int
client_is_stopped(Client *c)
{
int pid;
siginfo_t in = {0};
#ifdef XWAYLAND
if (client_is_x11(c))
return 0;
#endif
wl_client_get_credentials(c->surface.xdg->client->client, &pid, NULL, NULL);
if (waitid(P_PID, pid, &in, WNOHANG|WCONTINUED|WSTOPPED|WNOWAIT) < 0) {
/* This process is not our child process, while is very unluckely that
* it is stopped, in order to do not skip frames assume that it is. */
if (errno == ECHILD)
return 1;
} else if (in.si_pid) {
if (in.si_code == CLD_STOPPED || in.si_code == CLD_TRAPPED)
return 1;
if (in.si_code == CLD_CONTINUED)
return 0;
}
return 0;
} }
static inline int static inline int
@@ -200,61 +291,13 @@ client_is_unmanaged(Client *c)
} }
static inline void static inline void
client_send_close(Client *c) client_notify_enter(struct wlr_surface *s, struct wlr_keyboard *kb)
{ {
#ifdef XWAYLAND if (kb)
if (client_is_x11(c)) { wlr_seat_keyboard_notify_enter(seat, s, kb->keycodes,
wlr_xwayland_surface_close(c->surface.xwayland); kb->num_keycodes, &kb->modifiers);
return; else
} wlr_seat_keyboard_notify_enter(seat, s, NULL, 0, NULL);
#endif
wlr_xdg_toplevel_send_close(c->surface.xdg);
}
static inline void
client_set_fullscreen(Client *c, int fullscreen)
{
#ifdef XWAYLAND
if (client_is_x11(c)) {
wlr_xwayland_surface_set_fullscreen(c->surface.xwayland, fullscreen);
return;
}
#endif
wlr_xdg_toplevel_set_fullscreen(c->surface.xdg, fullscreen);
}
static inline uint32_t
client_set_size(Client *c, uint32_t width, uint32_t height)
{
#ifdef XWAYLAND
if (client_is_x11(c)) {
wlr_xwayland_surface_configure(c->surface.xwayland,
c->geom.x, c->geom.y, width, height);
return 0;
}
#endif
return wlr_xdg_toplevel_set_size(c->surface.xdg, width, height);
}
static inline void
client_set_tiled(Client *c, uint32_t edges)
{
#ifdef XWAYLAND
if (client_is_x11(c))
return;
#endif
wlr_xdg_toplevel_set_tiled(c->surface.xdg, edges);
}
static inline struct wlr_surface *
client_surface_at(Client *c, double cx, double cy, double *sx, double *sy)
{
#ifdef XWAYLAND
if (client_is_x11(c))
return wlr_surface_surface_at(c->surface.xwayland->surface,
cx, cy, sx, sy);
#endif
return wlr_xdg_surface_surface_at(c->surface.xdg, cx, cy, sx, sy);
} }
static inline void static inline void
@@ -268,25 +311,84 @@ client_restack_surface(Client *c)
return; return;
} }
static inline void * static inline void
toplevel_from_popup(struct wlr_xdg_popup *popup) client_send_close(Client *c)
{ {
struct wlr_xdg_surface *surface = popup->base; #ifdef XWAYLAND
if (client_is_x11(c)) {
wlr_xwayland_surface_close(c->surface.xwayland);
return;
}
#endif
wlr_xdg_toplevel_send_close(c->surface.xdg->toplevel);
}
while (1) { static inline void
switch (surface->role) { client_set_fullscreen(Client *c, int fullscreen)
case WLR_XDG_SURFACE_ROLE_POPUP: {
if (wlr_surface_is_layer_surface(surface->popup->parent)) #ifdef XWAYLAND
return wlr_layer_surface_v1_from_wlr_surface(surface->popup->parent)->data; if (client_is_x11(c)) {
else if (!wlr_surface_is_xdg_surface(surface->popup->parent)) wlr_xwayland_surface_set_fullscreen(c->surface.xwayland, fullscreen);
return NULL; return;
}
#endif
wlr_xdg_toplevel_set_fullscreen(c->surface.xdg->toplevel, fullscreen);
}
surface = wlr_xdg_surface_from_wlr_surface(surface->popup->parent); static inline uint32_t
break; client_set_size(Client *c, uint32_t width, uint32_t height)
case WLR_XDG_SURFACE_ROLE_TOPLEVEL: {
return surface->data; #ifdef XWAYLAND
case WLR_XDG_SURFACE_ROLE_NONE: if (client_is_x11(c)) {
return NULL; wlr_xwayland_surface_configure(c->surface.xwayland,
c->geom.x, c->geom.y, width, height);
return 0;
} }
#endif
if (width == c->surface.xdg->toplevel->current.width
&& height ==c->surface.xdg->toplevel->current.height)
return 0;
return wlr_xdg_toplevel_set_size(c->surface.xdg->toplevel, width, height);
} }
static inline void
client_set_tiled(Client *c, uint32_t edges)
{
#ifdef XWAYLAND
if (client_is_x11(c))
return;
#endif
wlr_xdg_toplevel_set_tiled(c->surface.xdg->toplevel, edges);
}
static inline struct wlr_surface *
client_surface_at(Client *c, double cx, double cy, double *sx, double *sy)
{
#ifdef XWAYLAND
if (client_is_x11(c))
return wlr_surface_surface_at(c->surface.xwayland->surface,
cx, cy, sx, sy);
#endif
return wlr_xdg_surface_surface_at(c->surface.xdg, cx, cy, sx, sy);
}
static inline int
client_wants_focus(Client *c)
{
#ifdef XWAYLAND
return client_is_unmanaged(c)
&& wlr_xwayland_or_surface_wants_focus(c->surface.xwayland)
&& wlr_xwayland_icccm_input_model(c->surface.xwayland) != WLR_ICCCM_INPUT_MODEL_NONE;
#endif
return 0;
}
static inline int
client_wants_fullscreen(Client *c)
{
#ifdef XWAYLAND
if (client_is_x11(c))
return c->surface.xwayland->fullscreen;
#endif
return c->surface.xdg->toplevel->requested.fullscreen;
} }
+31 -26
View File
@@ -1,15 +1,14 @@
/* appearance */ /* appearance */
static const int sloppyfocus = 1; /* focus follows mouse */ static const int sloppyfocus = 1; /* focus follows mouse */
static const int bypass_surface_visibility = 0; /* 1 means idle inhibitors will disable idle tracking even if it's surface isn't visible */
static const unsigned int borderpx = 1; /* border pixel of windows */ static const unsigned int borderpx = 1; /* border pixel of windows */
static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
static const float rootcolor[] = {0.3, 0.3, 0.3, 1.0};
static const float bordercolor[] = {0.5, 0.5, 0.5, 1.0}; static const float bordercolor[] = {0.5, 0.5, 0.5, 1.0};
static const float focuscolor[] = {1.0, 0.0, 0.0, 1.0}; static const float focuscolor[] = {1.0, 0.0, 0.0, 1.0};
/* To conform the xdg-protocol, set the alpha to zero to restore the old behavior */ /* To conform the xdg-protocol, set the alpha to zero to restore the old behavior */
static const float fullscreen_bg[] = {0.1, 0.1, 0.1, 1.0}; static const float fullscreen_bg[] = {0.1, 0.1, 0.1, 1.0};
/* tagging */ /* tagging - tagcount must be no greater than 31 */
static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; static const int tagcount = 9;
static const Rule rules[] = { static const Rule rules[] = {
/* app_id title tags mask isfloating monitor */ /* app_id title tags mask isfloating monitor */
@@ -29,12 +28,12 @@ static const Layout layouts[] = {
/* monitors */ /* monitors */
static const MonitorRule monrules[] = { static const MonitorRule monrules[] = {
/* name mfact nmaster scale layout rotate/reflect */ /* name mfact nmaster scale layout rotate/reflect x y */
/* example of a HiDPI laptop monitor: /* example of a HiDPI laptop monitor:
{ "eDP-1", 0.5, 1, 2, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL }, { "eDP-1", 0.5, 1, 2, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, -1, -1 },
*/ */
/* defaults */ /* defaults */
{ NULL, 0.55, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL }, { NULL, 0.55, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, -1, -1 },
}; };
/* keyboard */ /* keyboard */
@@ -85,20 +84,26 @@ LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE
*/ */
static const enum libinput_config_accel_profile accel_profile = LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE; static const enum libinput_config_accel_profile accel_profile = LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE;
static const double accel_speed = 0.0; static const double accel_speed = 0.0;
/* You can choose between:
LIBINPUT_CONFIG_TAP_MAP_LRM -- 1/2/3 finger tap maps to left/right/middle
LIBINPUT_CONFIG_TAP_MAP_LMR -- 1/2/3 finger tap maps to left/middle/right
*/
static const enum libinput_config_tap_button_map button_map = LIBINPUT_CONFIG_TAP_MAP_LRM;
/* If you want to use the windows key change this to WLR_MODIFIER_LOGO */ /* If you want to use the windows key for MODKEY, use WLR_MODIFIER_LOGO */
#define MODKEY WLR_MODIFIER_ALT #define MODKEY WLR_MODIFIER_ALT
#define TAGKEYS(KEY,TAG) \
#define TAGKEYS(KEY,SKEY,TAG) \
{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \ { MODKEY, KEY, view, {.ui = 1 << TAG} }, \
{ MODKEY|WLR_MODIFIER_CTRL, KEY, toggleview, {.ui = 1 << TAG} }, \ { MODKEY|WLR_MODIFIER_CTRL, KEY, toggleview, {.ui = 1 << TAG} }, \
{ MODKEY|WLR_MODIFIER_SHIFT, KEY, tag, {.ui = 1 << TAG} }, \ { MODKEY|WLR_MODIFIER_SHIFT, SKEY, tag, {.ui = 1 << TAG} }, \
{ MODKEY|WLR_MODIFIER_CTRL|WLR_MODIFIER_SHIFT,KEY,toggletag, {.ui = 1 << TAG} } { MODKEY|WLR_MODIFIER_CTRL|WLR_MODIFIER_SHIFT,SKEY,toggletag, {.ui = 1 << TAG} }
/* helper for spawning shell commands in the pre dwm-5.0 fashion */ /* helper for spawning shell commands in the pre dwm-5.0 fashion */
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
/* commands */ /* commands */
static const char *termcmd[] = { "alacritty", NULL }; static const char *termcmd[] = { "foot", NULL };
static const char *menucmd[] = { "bemenu-run", NULL }; static const char *menucmd[] = { "bemenu-run", NULL };
static const Key keys[] = { static const Key keys[] = {
@@ -114,7 +119,7 @@ static const Key keys[] = {
{ MODKEY, XKB_KEY_l, setmfact, {.f = +0.05} }, { MODKEY, XKB_KEY_l, setmfact, {.f = +0.05} },
{ MODKEY, XKB_KEY_Return, zoom, {0} }, { MODKEY, XKB_KEY_Return, zoom, {0} },
{ MODKEY, XKB_KEY_Tab, view, {0} }, { MODKEY, XKB_KEY_Tab, view, {0} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_c, killclient, {0} }, { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_C, killclient, {0} },
{ MODKEY, XKB_KEY_t, setlayout, {.v = &layouts[0]} }, { MODKEY, XKB_KEY_t, setlayout, {.v = &layouts[0]} },
{ MODKEY, XKB_KEY_f, setlayout, {.v = &layouts[1]} }, { MODKEY, XKB_KEY_f, setlayout, {.v = &layouts[1]} },
{ MODKEY, XKB_KEY_m, setlayout, {.v = &layouts[2]} }, { MODKEY, XKB_KEY_m, setlayout, {.v = &layouts[2]} },
@@ -122,21 +127,21 @@ static const Key keys[] = {
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space, togglefloating, {0} }, { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space, togglefloating, {0} },
{ MODKEY, XKB_KEY_e, togglefullscreen, {0} }, { MODKEY, XKB_KEY_e, togglefullscreen, {0} },
{ MODKEY, XKB_KEY_0, view, {.ui = ~0} }, { MODKEY, XKB_KEY_0, view, {.ui = ~0} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_0, tag, {.ui = ~0} }, { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_parenright, tag, {.ui = ~0} },
{ MODKEY, XKB_KEY_comma, focusmon, {.i = WLR_DIRECTION_LEFT} }, { MODKEY, XKB_KEY_comma, focusmon, {.i = WLR_DIRECTION_LEFT} },
{ MODKEY, XKB_KEY_period, focusmon, {.i = WLR_DIRECTION_RIGHT} }, { MODKEY, XKB_KEY_period, focusmon, {.i = WLR_DIRECTION_RIGHT} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_comma, tagmon, {.i = WLR_DIRECTION_LEFT} }, { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_less, tagmon, {.i = WLR_DIRECTION_LEFT} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_period, tagmon, {.i = WLR_DIRECTION_RIGHT} }, { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_greater, tagmon, {.i = WLR_DIRECTION_RIGHT} },
TAGKEYS( XKB_KEY_1, 0), TAGKEYS( XKB_KEY_1, XKB_KEY_exclam, 0),
TAGKEYS( XKB_KEY_2, 1), TAGKEYS( XKB_KEY_2, XKB_KEY_at, 1),
TAGKEYS( XKB_KEY_3, 2), TAGKEYS( XKB_KEY_3, XKB_KEY_numbersign, 2),
TAGKEYS( XKB_KEY_4, 3), TAGKEYS( XKB_KEY_4, XKB_KEY_dollar, 3),
TAGKEYS( XKB_KEY_5, 4), TAGKEYS( XKB_KEY_5, XKB_KEY_percent, 4),
TAGKEYS( XKB_KEY_6, 5), TAGKEYS( XKB_KEY_6, XKB_KEY_asciicircum, 5),
TAGKEYS( XKB_KEY_7, 6), TAGKEYS( XKB_KEY_7, XKB_KEY_ampersand, 6),
TAGKEYS( XKB_KEY_8, 7), TAGKEYS( XKB_KEY_8, XKB_KEY_asterisk, 7),
TAGKEYS( XKB_KEY_9, 8), TAGKEYS( XKB_KEY_9, XKB_KEY_parenleft, 8),
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_q, quit, {0} }, { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Q, quit, {0} },
/* Ctrl-Alt-Backspace and Ctrl-Alt-Fx used to be handled by X server */ /* Ctrl-Alt-Backspace and Ctrl-Alt-Fx used to be handled by X server */
{ WLR_MODIFIER_CTRL|WLR_MODIFIER_ALT,XKB_KEY_Terminate_Server, quit, {0} }, { WLR_MODIFIER_CTRL|WLR_MODIFIER_ALT,XKB_KEY_Terminate_Server, quit, {0} },
+5 -6
View File
@@ -1,15 +1,14 @@
_VERSION = 0.3.1 _VERSION = 0.4
VERSION = `./generate-version.sh $(_VERSION)` VERSION = `git describe --tags --dirty 2>/dev/null || echo $(_VERSION)`
PKG_CONFIG = pkg-config
# paths # paths
PREFIX = /usr/local PREFIX = /usr/local
MANDIR = $(PREFIX)/share/man MANDIR = $(PREFIX)/share/man
# Compile flags that can be used
#CFLAGS = -pedantic -Wall -Wextra -Werror -Wno-unused-parameter -Wno-sign-compare -Wno-unused-function -Wno-unused-variable -Wno-unused-result -Wdeclaration-after-statement
XWAYLAND = XWAYLAND =
XLIBS = XLIBS =
# Uncomment to build XWayland support # Uncomment to build XWayland support
#XWAYLAND = -DXWAYLAND #XWAYLAND = -DXWAYLAND
#XLIBS = xcb #XLIBS = xcb xcb-icccm
+2 -2
View File
@@ -51,7 +51,7 @@ Spawn
.Nm bemenu-run . .Nm bemenu-run .
.It Mod-Shift-Return .It Mod-Shift-Return
Spawn Spawn
.Nm alacritty . .Nm foot .
.It Mod-[jk] .It Mod-[jk]
Move focus down/up the stack. Move focus down/up the stack.
.It Mod-[id] .It Mod-[id]
@@ -135,7 +135,7 @@ Start
with s6 in the background: with s6 in the background:
.Dl dwl -s 's6-svscan <&-' .Dl dwl -s 's6-svscan <&-'
.Sh SEE ALSO .Sh SEE ALSO
.Xr alacritty 1 , .Xr foot 1 ,
.Xr bemenu 1 , .Xr bemenu 1 ,
.Xr dwm 1 , .Xr dwm 1 ,
.Xr xkeyboard-config 7 .Xr xkeyboard-config 7
+760 -531
View File
File diff suppressed because it is too large Load Diff
-13
View File
@@ -1,13 +0,0 @@
#!/bin/sh
if git tag --contains HEAD | grep -q $1; then
echo $1
else
branch="$(git rev-parse --abbrev-ref HEAD)"
commit="$(git rev-parse --short HEAD)"
if [ "${branch}" != "main" ]; then
echo $1-$branch-$commit
else
echo $1-$commit
fi
fi
-49
View File
@@ -1,49 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<protocol name="idle">
<copyright><![CDATA[
Copyright (C) 2015 Martin Gräßlin
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 2.1 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
]]></copyright>
<interface name="org_kde_kwin_idle" version="1">
<description summary="User idle time manager">
This interface allows to monitor user idle time on a given seat. The interface
allows to register timers which trigger after no user activity was registered
on the seat for a given interval. It notifies when user activity resumes.
This is useful for applications wanting to perform actions when the user is not
interacting with the system, e.g. chat applications setting the user as away, power
management features to dim screen, etc..
</description>
<request name="get_idle_timeout">
<arg name="id" type="new_id" interface="org_kde_kwin_idle_timeout"/>
<arg name="seat" type="object" interface="wl_seat"/>
<arg name="timeout" type="uint" summary="The idle timeout in msec"/>
</request>
</interface>
<interface name="org_kde_kwin_idle_timeout" version="1">
<request name="release" type="destructor">
<description summary="release the timeout object"/>
</request>
<request name="simulate_user_activity">
<description summary="Simulates user activity for this timeout, behaves just like real user activity on the seat"/>
</request>
<event name="idle">
<description summary="Triggered when there has not been any user activity in the requested idle time interval"/>
</event>
<event name="resumed">
<description summary="Triggered on the first user activity after an idle event"/>
</event>
</interface>
</protocol>
+63
View File
@@ -0,0 +1,63 @@
static Client *
nexttiled(Client *sel) {
Client *c;
wl_list_for_each(c, &sel->link, link) {
if (&c->link == &clients)
break; /* don't wrap */
if (!c->isfloating && VISIBLEON(c, selmon))
return c;
}
return NULL;
}
static Client *
prevtiled(Client *sel) {
Client *c;
wl_list_for_each_reverse(c, &sel->link, link) {
if (&c->link == &clients)
break; /* don't wrap */
if (!c->isfloating && VISIBLEON(c, selmon))
return c;
}
return NULL;
}
static void
pushup(const Arg *arg) {
Client *sel = focustop(selmon);
Client *c;
if(!sel || sel->isfloating)
return;
if((c = prevtiled(sel))) {
/* attach before c */
wl_list_remove(&sel->link);
wl_list_insert(c->link.prev, &sel->link);
} else {
/* move to the end */
wl_list_remove(&sel->link);
wl_list_insert(clients.prev, &sel->link);
}
focusclient(sel, 1);
arrange(selmon);
}
static void
pushdown(const Arg *arg) {
Client *sel = focustop(selmon);
Client *c;
if(!sel || sel->isfloating)
return;
if((c = nexttiled(sel))) {
/* attach after c */
wl_list_remove(&sel->link);
wl_list_insert(&c->link, &sel->link);
} else {
/* move to the front */
wl_list_remove(&sel->link);
wl_list_insert(&clients, &sel->link);
}
focusclient(sel, 1);
arrange(selmon);
}
+4
View File
@@ -0,0 +1,4 @@
static Client *nexttiled(Client *sel);
static Client *prevtiled(Client *sel);
static void pushdown(const Arg *arg);
static void pushup(const Arg *arg);
+10 -10
View File
@@ -6,16 +6,6 @@
#include "util.h" #include "util.h"
void *
ecalloc(size_t nmemb, size_t size)
{
void *p;
if (!(p = calloc(nmemb, size)))
die("calloc:");
return p;
}
void void
die(const char *fmt, ...) { die(const char *fmt, ...) {
va_list ap; va_list ap;
@@ -33,3 +23,13 @@ die(const char *fmt, ...) {
exit(1); exit(1);
} }
void *
ecalloc(size_t nmemb, size_t size)
{
void *p;
if (!(p = calloc(nmemb, size)))
die("calloc:");
return p;
}