445 Commits

Author SHA1 Message Date
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
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 b04c73be3d make sure we do not create a double fullscreen_bg
and also make sure we do not destroy it if it does not exist
Fixes: #274
2022-07-23 13:28:15 -05:00
Leonardo Hernández Hernández 8cdb997126 conform the xdg-protocol with fullscreen translucent clients
see `setfullscreen()` for more info
2022-07-23 02:17:00 -05:00
Leonardo Hernández Hernández 90a12c90a0 always set the same monitor and tags for child clients of a client
fixes #272
2022-07-19 20:13:56 -05:00
Leonardo Hernández Hernández e082292606 do not focus clients if a layer surface is focused 2022-07-19 12:24:24 -05:00
Dima Krasner deb48ff48b force line-buffered stdout if stdout is not a tty 2022-07-19 12:18:16 -05:00
Leonardo Hernández Hernández c70db2d06a Revert "only call wlr_seat_keyboard_notify_enter() if a keyboard is found"
This reverts commit 8e03bce621.
fixes #270
2022-07-19 11:52:42 -05:00
Leonardo Hernández Hernández e98719f552 remove a useless check
if `s->role_data == NULL`, wlr_*_surface_from_wlr_surface() will return NULL
and we are checking it
2022-07-15 00:48:28 -05:00
Leonardo Hernández Hernández 058c699ac2 only set bounds for clients that support it 2022-07-15 00:27:31 -05:00
David-Valters af12e777f2 Update README.md 2022-07-13 20:19:43 -05:00
Leonardo Hernández Hernández 8e03bce621 only call wlr_seat_keyboard_notify_enter() if a keyboard is found 2022-07-07 00:21:51 -05:00
Leonardo Hernández Hernández 87fc3a58ab check pointer focus in arrange() 2022-07-06 23:48:53 -05:00
Leonardo Hernández Hernández 0eff78d6c2 include DWLCFLAGS into linking step 2022-07-06 23:41:42 -05:00
Leonardo Hernández Hernández c6d97f1db7 arrange client's monitor if size has change since last commit 2022-07-06 22:20:21 -05:00
Leonardo Hernández Hernández 829dec6598 resize now takes struct wlr_box as parameter 2022-07-06 22:18:46 -05:00
Leonardo Hernández Hernández ff70337c16 check current and pending geometry to set c->resize to zero
Fixes #260
2022-07-06 22:16:00 -05:00
Ben Jargowsky 7cc6c640e2 Checks for overflows for client max width and height 2022-06-29 00:35:06 +02:00
Leonardo Hernández Hernández 72e0a560d9 respect size hints 2022-06-24 19:19:20 -05:00
Leonardo Hernández Hernández 2aa391361c inline unmaplayersurface() into unmaplayersurfacenotify()
unmap signal is guaranted to be emitted before destroy signal
so is useless checking if it is mapped at destroy
2022-06-24 15:36:13 -05:00
Leonardo Hernández Hernández 549335ae54 avoid layer surface popups appearing below x{dg,wayland} clients 2022-06-24 14:46:08 -05:00
Leonardo Hernández Hernández 097b4a30f5 unconstrain layer shell popups from monitor size
unconstrain other popups from monitor usable area
2022-06-24 14:30:52 -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 c1578bc14d use LayerSurface.mon when possible 2022-06-21 16:03:20 -05:00
Leonardo Hernández Hernández 9b84940e37 unconstrain layer shell popups
also unconstrain popups from monitor's usable area
2022-06-21 00:23:21 -05:00
Leonardo Hernández Hernández 79ad72413d don't set c->isfullscreen to zero
calloc initializes all fields to zero
2022-06-20 18:05:16 -05:00
Sevz 74fce9d918 Merge pull request #257 from fauxmight/bar_options
Add known dwl status bar options to README
2022-06-18 13:00:08 -05:00
A Frederick Christensen 553ba5b7c8 Add known dwl tag status bar options to README.md 2022-06-18 03:04:00 -05:00
Leonardo Hernández Hernández 4ae6d0f387 move ugglyness to client.h 2022-06-16 15:54:13 -05:00
Leonardo Hernández Hernández 2ef5abfb72 remove unneeded check in focusclient() 2022-06-16 15:36:27 -05:00
Sevz 8076b47cc6 Merge pull request #251 from gwnichol/fixinstall
Fix make install while files are in use
2022-06-14 15:43:09 -05:00
Sevz 3a77f02919 Merge pull request #247 from Humm42/xkboptions
initialize xkb_rules.options to a null pointer
2022-06-14 15:42:47 -05:00
Leonardo Hernández Hernández d26ddfc7fd kill child process in cleanup() 2022-06-14 15:31:39 -05:00
Grant Nichol 671a9b450b Fix make install while files are in use
When the dwl executable is in use, cp fails without the -f flag.

POSIX defines this flag with:
> If a file descriptor for a destination file cannot be obtained,
> as described in step 3.a.ii., attempt to unlink the destination
> file and proceed.
2022-06-12 15:58:38 -05:00
Leonardo Hernández Hernández 583f471cfe add some blank lines 2022-06-10 12:32:22 -05:00
Marco Siedentopf 8bce3b1583 add click method configuration option
Add the libinput configuration option to choose between Software Button Areas and Clickfinger
2022-06-10 12:27:40 -05:00
Leonardo Hernández Hernández c008bf2a7d add $(LIBS) to $(LDLIBS) 2022-06-10 12:21:23 -05:00
Dima Krasner c990dbd441 fix link failure with --as-needed 2022-06-10 19:26:45 +03: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 d969289baf use LDFLAGS to build dwl target 2022-06-06 23:36:45 -05:00
Leonardo Hernández Hernández 50b6630f3d do not generate *-protocol.{c,o}
according with
https://gitlab.freedesktop.org/wlroots/wlroots/-/commit/62fbf3f4ba1b2993e29dfb46f077e5806f7aac1c
they are unused and wlroots-based compositors don't need to do this
2022-06-06 22:54:40 -05:00
Leonardo Hernández Hernández 14641560b0 include xcb only when building with xwayland support 2022-06-06 22:53:36 -05:00
KawaiiAmber 7b42232ad1 convert makefile to be more portable 2022-06-06 22:53:36 -05:00
Leonardo Hernández Hernández a5a0674f6a improve client_from_wlr_surface() 2022-06-06 22:51:58 -05:00
Leonardo Hernández Hernández 4dfa45659a fix compiler error with gcc complaining about parentheses
dwl.c: In function ‘unmaplayersurface’:
dwl.c:2253:9: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
 2253 |         layersurface->layer_surface->mapped = layersurface->mapped = 0;
      |         ^~~~~~~~~~~~
cc1: all warnings being treated as errors
make: *** [<builtin>: dwl.o] Error 1

clang not affected
2022-06-05 16:57:20 -05:00
Leonardo Hernández Hernández b91017e713 disable scene node at unmaplayersurface() 2022-06-05 15:27:40 -05:00
Lennart Jablonka 70da04a714 initialize xkb_rules.options to a null pointer
Initializing it to an empty string had broken configuring xkbcommon
through the environment (XKB_DEFAULT_OPTIONS).

Fixes: ae31391115 ("initialize rules and xkb_rules")
2022-06-03 01:23:35 +02:00
Leonardo Hernández Hernández 2623a96ebf call client_set-size() if client has a resize 2022-05-27 00:19:17 -05:00
Leonardo Hernández Hernández 52e0d00942 check client_surface() returning NULL
now client_surface()->data is a pointer to the wlr_scene_tree of clients
which allows us to not call wlr_scene_node_lower_to_bottom() for every clients
2022-05-25 17:12:44 -05:00
Leonardo Hernández Hernández 7018b9b65c correct libinput function name for drag_lock 2022-05-25 15:01:38 -05:00
Leonardo Hernández Hernández 48ec914f43 destroy layersurface's scene node in destroylayersurfacenotify() 2022-05-25 14:49:32 -05:00
Leonardo Hernández Hernández 40449fa64f add a new function to get a client from a wlr_surface 2022-05-23 10:55:28 -05:00
Ben Jargowsky ecbc2c61db Add configuration options for touchpads 2022-05-23 00:01:47 +02: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 8870ba0bb8 implement urgency hints for xwayland clients 2022-05-17 14:38:18 -05:00
Leonardo Hernández Hernández 5de68ba713 sync manpage and help info
Signed-off-by: Leonardo Hernández Hernández <leohdz172@protonmail.com>
2022-05-17 13:26:57 -05:00
Leonardo Hernández Hernández 79a148224f specify version in wlr_xdg_shell_create() 2022-05-15 17:17:58 -05:00
Ben Jargowsky 2f8736b986 Check if XWayland client size_hints are NULL 2022-05-15 23:09:21 +02:00
Leonardo Hernández Hernández 3c11ad9aa6 fix segfault when dragging chromium tabs 2022-05-14 00:29:35 -05:00
Ben Jargowsky 06d9230a96 Run focusclient when switching to monocle layout 2022-05-13 10:20:28 +02: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 22bd75226b remove trailing whitespaces 2022-05-10 11:42:40 -05:00
Leonardo Hernández Hernández 063736f898 add -v flag to the manpage
Thanks @Humm42
2022-05-10 11:39:33 -05:00
Leonardo Hernández Hernández d5a741c9b4 add dist target 2022-05-09 16:25:03 -05:00
Leonardo Hernández Hernández 5d8084daa7 add flag to print version and exit 2022-05-09 16:24:36 -05:00
Sevz 07d56c6d7b Merge pull request #230 from BenJarg/null-wlr_seat_get_keyboard
Handle 'wlr_seat_get_keyboard' possibly returning null.
2022-05-09 13:18:19 -05:00
Ben Jargowsky e0d310fd84 Handle 'wlr_seat_get_keyboard' possibly returning null. 2022-05-09 14:00:21 +02: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 3a4b7d104f restack xwayland surface on focusclient() 2022-04-29 17:45:02 -05:00
Ben Jargowsky d071a899f3 Run printstatus() when a monitor is removed 2022-04-25 13:50:53 -07: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 a48ce99e6a use pointer math in xytonode() 2022-04-15 17:40:02 -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 b86fcf6504 add missing return in client_is_floating_type()
This causes all Xwayland clients to be treated as floating
2022-04-10 21:38:48 -05:00
Leonardo Hernández Hernández 29a2b647b2 Merge remote-tracking branch 'djpohly/main' into HEAD 2022-04-08 21:12:32 -05:00
Leonardo Hernández Hernández c00697e643 abc 2022-04-05 23:04:04 -05:00
Leonardo Hernández Hernández af741e586b typedefs: abc 2022-04-05 22:15:46 -05:00
Leonardo Hernández Hernández 02ac9378c4 includes: abc 2022-04-05 22:07:59 -05:00
Devin J. Pohly 437aea8662 It's past my bedtime. 2022-04-03 00:14:08 -05:00
Devin J. Pohly 6901743b0c Remove removed fields from struct instances 2022-04-03 00:13:11 -05:00
Devin J. Pohly 720f56161e Remove vestigial monitor configuration info
The x/y fields in monitor rules are unused and were meant to be deleted.
Also removes the outdated comment in config.h.
2022-04-03 00:01:52 -05:00
Leonardo Hernández Hernández 4d3adea683 die on pipe failure 2022-03-31 15:32:30 -06:00
Raphael Robatsch 79b7e755b0 Layer shell: Prevent infinte configure/commit loop
Check the wlr_layer_surface_v1_state.committed bitmask to see if we need
to rearrange. This is also what sway does.

Without this check, every commit request (even if only the attached buffer
changed) will lead to another configure event, which will lead to another
commit, etc.

This loop results in swaybg consuming 100% CPU.

Co-authored-by: Owen Rafferty <owen@owenrafferty.com>
2022-03-31 15:27:13 -06:00
Leonardo Hernández Hernández b424602ebc add DESTDIR 2022-03-31 09:43:56 -06:00
Leonardo Hernández Hernández ae31391115 initialize rules and xkb_rules
to fix compile errors with `-pedantic`
2022-03-31 09:34:22 -06:00
Leonardo Hernández Hernández 2d6f932ecf don't let -pedantic be overridable by environment 2022-03-31 09:21:27 -06: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 aab397c30b new functions ecalloc() and die()
die() replaces EBARF and BARF
and allow us to add `-pedantic` to CFLAGS
2022-03-28 15:02:09 -06: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 cb4265ac8c check m in commitlayersurfacenotify() 2022-03-24 14:19:08 -06:00
Leonardo Hernández Hernández a95338ca43 implement input-inhibitor protocol 2022-03-24 11:41:24 -06:00
Leonardo Hernández Hernández ae614ee512 implement idle-inhibitor protocol
This allows clients to disable idle monitoring
2022-03-24 11:35:19 -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 feb972acd0 fix drag icon's surface returned by xytonode 2022-03-23 15:34:17 -06:00
Leonardo Hernández Hernández bf8cc526de set position of the drag icon in startdrag() 2022-03-23 15:30:35 -06:00
Leonardo Hernández Hernández 7a2e0eef74 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 15:29:32 -06:00
Guido Cella 3bace9ce6b 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 22:01:04 +01:00
Leonardo Hernández Hernández 4ef8999624 add note about how to change MODKEY for windows key 2022-03-23 14:03:43 -06:00
Palanix 7d724dc7f3 Fix dwl freezing when resizing 2022-03-23 12:09:24 -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
Quentin Rameau 326eee1444 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-22 23:51:56 -06:00
Leonardo Hernández Hernández d8f430accf 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-22 23:44:53 -06:00
Sevz 6aed9dc1ac Merge pull request #137 from guidocella/libera
update IRC channel
2022-03-22 17:49:06 -06:00
Sevz 358562e2df Merge pull request #180 from Humm42/manpage
add dwl(1)
2022-03-22 16:26:38 -06:00
Leonardo Hernández Hernández 9aec6049ec clients now works as expected in drag motion 2022-03-22 15:02:02 -06:00
Guido Cella 330792b1fc 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-22 01:10:08 -06:00
Sevz 86fe15f76c Update issue templates 2022-03-21 22:34:30 -06:00
Leonardo Hernández Hernández ee1a72211d only skip frames if there are visible clients that have a resize 2022-03-21 21:41:38 -06:00
Leonardo Hernández Hernández 2bc01debdc remove a useless resize in mapnotify()
applyrules() calls setmon() which calls resize()
2022-03-21 14:21:33 -06:00
Leonardo Hernández Hernández c50f187c1f improve floating detection
mostly copied from sway
2022-03-21 14:21:31 -06:00
Leonardo Hernández Hernández 0dea553428 destroy scene_output in cleanupmon() 2022-03-20 19:09:28 -06:00
Leonardo Hernández Hernández a66210ebbc Merge branch 'main' into wlroots-next 2022-03-20 16:02:18 -06:00
Sevz 44932053ba Merge pull request #204 from djpohly/scenegraph3
merge scenegraph3
2022-03-20 12:48:15 -06:00
Leonardo Hernández Hernández dd463b25c7 remove independents list 2022-03-20 12:32:44 -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 Hernández Hernández 19c14b058c remove unneeded variables 2022-03-18 11:04:34 -06:00
Leonardo Hernández Hernández e645ea8301 attach presentation to scene 2022-03-18 10:40:40 -06:00
Leonardo Hernández Hernández e4bf83e26d update README.md 2022-03-18 01:43:30 -06:00
Leonardo Hernández Hernández d50bb97f56 Merge branch 'main' into scenegraph 2022-03-18 01:31:28 -06:00
Leonardo Hernández Hernández 475c134144 do not allow set client size less than its min size 2022-03-18 01:27:33 -06:00
Leonardo Hernández Hernández 467123dc99 make sure to destroy wlr_scene_node of unmanaged clients 2022-03-18 01:03:33 -06:00
Leonardo Hernández Hernández 254f799fde do not create borders for unmanaged clients 2022-03-18 01:02:50 -06:00
Leonardo Hernández Hernández 0815626d4c pointerfocus: only use provided surface
if a client is given focus it
2022-03-18 00:59:52 -06:00
Leonardo Hernández Hernández 1b22ef1616 use xdg_shell helper
for xwayland continue using wlr_scene_subsurface_create()
2022-03-18 00:52:21 -06:00
Leonardo Hernández Hernández f1c92b05fb get old client by surface's node 2022-03-18 00:49:47 -06:00
Leonardo Hernández Hernández 1dfd867d9c fix crash of Firefox when opening a popup larger than its size 2022-03-17 21:28:07 -06:00
Leonardo Hernández Hernández 294fb324d8 constraint popups to its parent client
Closes: #146
Closes: #155
2022-03-16 23:08:17 -06:00
Leonardo Hernández Hernández 79f85bde99 Merge branch 'main' into scenegraph 2022-03-16 21:54:16 -06:00
Leonardo Hernández Hernández 2768af5a9b make sure configure and activate listeners are removed from list 2022-03-16 21:42:45 -06:00
Leonardo Hernandez Hernandez 863eedd05e set correct position for unmanaged clients
- don't allow to move/resize with them
- don't focus unmanaged clients on buttonpress()
2022-03-16 09:27:09 -06:00
Leonardo Hernandez Hernandez b92c0ff57f add support for layer_shell popups 2022-03-16 09:27:09 -06:00
Leonardo Hernandez Hernandez 1087bc5db9 use wlr_scene_xdg_surface_create() for xdg_popups 2022-03-16 08:48:41 -06:00
Leonardo Hernández Hernández 88f241d1cf Merge branch 'fix-segfault-in-fullscreennotify' 2022-03-13 21:32:55 -06:00
Leonardo Hernández Hernández 43228bd493 don't use fullscreen event in fullscreennotify() 2022-03-13 21:31:57 -06:00
Leonardo Hernández Hernández ebff6e38a0 always call arrange() on setfullscreen()
also don't count full screen clients on tile()
2022-03-13 17:11:52 -06:00
Leonardo Hernández Hernández 2cd0b3173d print status about floating and fullscreen 2022-03-13 15:46:32 -06:00
Humm 0c4740b277 add dwl(1)
Documentation is good.  Man pages are documentation.  A program without
a man page is worthless.
2022-03-13 00:46:24 +01:00
Leonardo Hernández Hernández 08020d61b7 more style fixes 2022-03-11 23:02:37 -06:00
Leonardo Hernández Hernández 4d26d30220 suckless style: don't use '//' for comments 2022-03-11 18:52:22 -06:00
Leonardo Hernandez Hernandez 0e5d7124de use loop to call arrangelayer
zwlr_layer_shell_v1_layer are ordered by bottom-most first so we can
just use a loop from 3 to 0
2022-03-11 18:46:13 -06:00
Sevz c49a42ee58 Merge pull request #196 from noocsharp/main
die on allocation failure
2022-03-11 18:40:45 -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 Hernandez Hernandez 4465dcb6da fix left border 'y' position
also add comment about border ordering
2022-03-11 15:11:02 -06:00
Leonardo Hernandez Hernandez b97d9e1ce1 use wlr_scene_node_raise_to_top() 2022-03-11 15:07:57 -06:00
Leonardo Hernandez Hernandez 2b2f72d7c2 use wlr_scene_output_send_frame_done() 2022-03-11 15:05:49 -06:00
Leonardo Hernández Hernández 05a473335e use wlr_box for previous geom 2022-03-10 14:48:14 -06:00
Leonardo Hernández Hernández 5d9c9a9a68 don't warn about unused result
Closes: #186
2022-03-10 14:34:36 -06:00
Leonardo Hernández Hernández f673305e86 replace tabs by spaces in alignment 2022-03-10 14:08:57 -06:00
Leonardo Hernandez Hernandez 8cace19218 fix crash when the last monitor is disconnected 2022-03-10 14:08:57 -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
Leonardo Hernandez Hernandez 3e6d584de1 update URL to wlroots project (GitHub->GitLab) 2022-03-10 10:23:00 -06:00
Sevz ebed67596d Merge pull request #187 from fauxmight/new-clients-printstatus
Newly launched or closed clients ALWAYS generate status update
2022-03-10 10:21:04 -06:00
Sevz f83f1049db Merge pull request #149 from xi/fix-grabc-unmap
reset cursor mode when grabc is unmapped
2022-03-10 10:16:49 -06:00
Sevz 2630664fef Merge pull request #193 from fauxmight/chasing-wlroots
Chasing wlroots
2022-03-10 10:11:17 -06:00
Leonardo Hernandez Hernandez d1ff1e6f75 remove typedef Decoration 2022-03-08 18:17:21 -06:00
Nihal Jere b0098d9d09 die on allocation failure 2022-02-22 23:07:49 -06:00
Devin J. Pohly 2d2c21664c Merge pull request #181 from Armael/fix-client_set_tiled
fix client_set_tiled which is currently ignoring its "edges" argument
2022-02-15 16:20:22 -06:00
Devin J. Pohly 52a33a2f1e Merge branch 'scenegraph3' of github:djpohly/dwl into scenegraph3 2022-02-15 14:16:20 -06:00
Devin J. Pohly 9090106334 Merge pull request #164 from Sevz17/change-border-color
Change border color according to focus state
2022-02-15 14:16:11 -06:00
Devin J. Pohly a15cb1e20e Merge pull request #160 from Humm42/closepipes
-s: close unused fds
2022-02-15 14:04:25 -06:00
Devin J. Pohly b860932cda Merge branch 'scenegraph3' of github:djpohly/dwl into scenegraph3 2022-02-15 14:03:29 -06:00
Devin J. Pohly 22a6f6661a Merge pull request #151 from Sevz17/scenegraph3
send frame_done also to all layer surfaces
2022-02-15 14:03:04 -06:00
Devin J. Pohly bda7b31174 Merge pull request #189 from fauxmight/shift-6-is-asciicircum
Shift+6 generates XKB_KEY_asciicircum
2022-02-15 13:57:07 -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 ac896a7df4 Shift+6 generates XKB_KEY_asciicircum 2022-02-01 18:58:32 -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
Armaël Guéneau f587b2fd2c fix client_set_tiled, which was ignoring its "edges" argument 2022-01-08 17:41:45 +01:00
A Frederick Christensen 317175da08 Newly launched or closed clients ALWAYS generate status update
Prior to this change, if a client whose tag(s) are not currently
selected is launched or killed, no update to status was printed and
status bars being fed by printstatus() did not update newly active
or newly inactive (but unselected) tags.
2021-12-31 14:51:50 -06:00
Devin J. Pohly f4ae4c1a0b Merge branch 'main' into scenegraph3 2021-12-22 12:43:07 -06:00
Devin J. Pohly f85d8e79d0 Merge branch 'wlroots-next'
wlroots 0.15.0 was released
2021-12-22 12:14:36 -06:00
Devin J. Pohly 09413da6e3 Merge branch 'main' of github:djpohly/dwl 2021-12-22 12:11:29 -06:00
Devin J. Pohly 27514b9593 Merge branch 'wlroots-next' into scenegraph3 2021-12-16 11:51:15 -06:00
Devin J. Pohly 27f66c8715 explicitly create renderer and allocator
autocreate was removed
2021-12-16 11:50:11 -06:00
Leonardo Hernandez Hernandez 52dbc97ed6 wlr_xdg_surface.configure_serial has been moved into wlr_xdg_surface_state
as seen in swaywm/wlroots@0e34208
2021-12-16 11:49:57 -06:00
Devin J. Pohly 852fe819c4 Merge branch 'wlroots-next' of github:djpohly/dwl into wlroots-next 2021-12-16 11:48:43 -06:00
Devin J. Pohly 2315462f96 Merge commit 'refs/pull/162/head' of github:djpohly/dwl into scenegraph3 2021-12-16 10:59:13 -06:00
Devin J. Pohly c71a3ac594 Merge branch 'wlroots-next' of github:djpohly/dwl into scenegraph3 2021-12-16 10:52:49 -06:00
Raphael Robatsch 03e167dbb7 fullscreennotify: don't crash if called before map
SDL2 calls xdg_toplevel.unset_fullscreen() before the surface is
mapped. This causes a segfault in dwl because setfullscreen() expects
the surface to be mapped already.
Therefore, delay the setfullscreen call until the surface is mapped.
2021-11-13 22:19:55 -06:00
Leonardo Hernandez Hernandez 894f2a3152 change border color according to focus state 2021-10-31 15:32:49 -06:00
Leonardo Hernandez Hernandez 05ac420342 Merge branch 'wlroots-next' into HEAD 2021-10-26 21:24:35 -05:00
Humm ebfefa84ba -s: close unused fds
dup2 doesn’t close fds, it only duplicates them.  The old ones weren’t
closed, causing problems (like dwl blocking due to the child process
never reading from the reading end, even if stdin has been closed).
2021-10-13 23:11:40 +02:00
Devin J. Pohly 2d9740c2fc document status information and <&- in README
As mentioned in #158.
2021-10-06 13:00:54 -05:00
Leonardo Hernandez Hernandez 2c9423d1b7 wlr_xdg_surface.configure_serial has been moved into wlr_xdg_surface_state
as seen in swaywm/wlroots@0e34208
2021-10-03 22:08:00 -05:00
Leonardo Hernandez Hernandez df332de9d2 send frame_done also to all layer surfaces
this fixes an issue when bemenu don't update his surface when typing
2021-10-02 22:24:04 -05:00
Devin J. Pohly 96ce40cfe9 Merge pull request #152 from ARDiDo/no_redundant_xcursor
remove redundancies in xcursors
2021-09-26 23:08:17 -05:00
ARDiDo 99fbebcae3 Remove redundant xcursor manager 2021-09-26 20:19:36 -04:00
Devin J. Pohly d3efb0b29b Merge pull request #150 from Sevz17/wlroots-next
client_pending has been renamed as pending in wlr_layer_surface_v1
2021-09-24 23:24:41 -05:00
Leonardo Hernandez Hernandez 1e1482adcb client_pending has been renamed as pending in wlr_layer_surface_v1
as seen in swaywm/wlroots@59fa363
2021-09-24 16:12:12 -05:00
Devin J. Pohly 7de6920bd7 send frame_done to all visible surfaces 2021-09-21 14:42:36 -05:00
Devin J. Pohly c8bf457c0f fixup: follow name change on surface_tree_create 2021-09-21 10:42:43 -05:00
Devin J. Pohly 0146a9954b use scene_output for damage-tracked rendering 2021-09-08 23:24:11 -05:00
Devin J. Pohly be6f573b4e use scene to keep track of LayerSurfaces' layers 2021-09-08 23:24:11 -05:00
Devin J. Pohly 1b38801eef use scene-graph API for Client/LayerSurface 2021-09-08 23:24:11 -05:00
Devin J. Pohly 929d3d9569 use type enum to distinguish Client from LayerSurface 2021-09-08 23:24:11 -05:00
Devin J. Pohly 40e45a336a Merge branch 'main' into wlroots-next 2021-09-08 23:21:51 -05:00
Devin J. Pohly 0c1e621b82 simplify fullscreen expression 2021-09-08 23:21:28 -05:00
Devin J. Pohly 417e958a15 Merge branch 'main' into wlroots-next 2021-09-05 11:45:27 -05:00
Devin J. Pohly 2e9c4d8ea9 simplify client_for_each_surface
All the XDG surface iterator does is iterate the main wlr_surface, then
iterate the popups.  If we inline that function, we can merge part of it
with the X11 case.
2021-09-05 11:41:23 -05:00
Tobias Bengfort 79dcc0d327 reset cursor mode when grabc is unmapped 2021-09-04 13:47:49 +02:00
Devin J. Pohly 55bbbc3dcb Merge branch 'main' into wlroots-next 2021-08-23 21:08:27 -05:00
Devin J. Pohly d4e08c0762 update deprecated xkb function name 2021-08-23 18:59:31 -05:00
Devin J. Pohly 772c0fe1bd Merge pull request #145 from PalanixYT/wlroots-next
wlr_layer_surface_v1_close has been replaced by wlr_layer_surface_v1_…
2021-08-23 11:58:02 -04:00
Palanix 3273f749ea wlr_layer_surface_v1_close has been replaced by wlr_layer_surface_v1_destroy 2021-08-21 01:53:38 +02:00
Devin J. Pohly 1183a319a0 Merge pull request #136 from guidocella/presentation-time
implement the presentation time protocol
2021-08-14 07:53:26 -04:00
Devin J. Pohly 3f70bbb5c4 Merge pull request #130 from drdonahue/printstatus-fix
Fix excessive printstatus() calls when dmenu is up
2021-08-14 07:50:40 -04:00
Guido Cella 8aa50dfdf1 update IRC channel 2021-08-03 06:29:26 +02:00
Guido Cella d175a58d73 implement the presentation time protocol
This lets applications, such as mpv with --video-sync=display-resample,
know accurately when frames are displayed and ensure smooth video
playback.
2021-08-02 16:33:38 +02:00
David Donahue 52e6bf4735 Moved printstatus() call in focusclient() to prevent printstatus being called on every frame when things like dmenu are up 2021-07-01 15:20:30 -05:00
Devin J. Pohly 3b05eadeaf update notes about starting dwl
Includes mention of video/input groups
2021-06-30 14:46:20 -05:00
Devin J. Pohly f9f3f3432b Merge branch 'xdg-activation' into wlroots-next 2021-06-30 14:09:02 -05:00
Devin J. Pohly d4ce92a7b5 Merge branch 'xdg-activation' into wlroots-next 2021-06-03 01:44:36 -05:00
Devin J. Pohly 34521ea43b Merge branch 'main' into wlroots-next 2021-06-03 01:43:49 -05:00
Devin J. Pohly c6f96d5391 mention -devel packages
It seems like there are people trying dwl who aren't as familiar with
how their distros do development, so let's give them a pointer in the
right direction.
2021-06-03 01:41:10 -05:00
Devin J. Pohly bd2f7fbb40 exit cleanly on INT/TERM 2021-05-26 23:30:49 -05:00
Devin J. Pohly 823cefd292 handle ephemeral pageflip failures
If a transient failure occurs in wlr_output_commit, re-render until it
doesn't happen.  This could possibly be removed if we decide to
implement damage tracking in the future.
2021-05-25 02:52:33 -05:00
Devin J. Pohly 60c40c0989 print status on output create
Along with starting the -s command earlier, this will allow the initial
monitor setup to generate printstatus info.
2021-05-24 22:31:36 -05:00
Devin J. Pohly 5dfd7cf180 Merge branch 'main' into wlroots-next 2021-05-24 21:56:05 -05:00
Devin J. Pohly 06ca860092 factor xwayland hackiness out into client.h 2021-05-23 18:28:13 -05:00
Devin J. Pohly 56d93898ea Merge pull request #122 from Sevz17/set-tiled-on-map
before set tiled verify if client is xdg-shell, then set tile
2021-05-23 18:24:24 -05:00
Sevz17 9ab5e01d5b before set tiled verify if client is xdg-shell, then set tile 2021-05-23 11:44:56 -05:00
Devin J. Pohly ce9f264919 Merge pull request #120 from djpohly/set-tiled-on-map
Wait until map to set window's tiled state
2021-05-23 00:28:49 -05:00
Devin J. Pohly d8cf65c74f implement urgency hint 2021-05-22 21:21:53 -05:00
Devin J. Pohly 93a58abf29 Wait until map to set window's tiled state
Workaround for a bug in Chromium where it fails to attach a buffer to
the surface.  Fixes #119.
2021-05-22 14:24:18 -05:00
Devin J. Pohly 1b139a860d update README 2021-05-18 11:33:12 -05:00
Devin J. Pohly 41bb7a7679 Merge branch 'pipe-status' 2021-05-10 11:49:16 -05:00
Devin J. Pohly 2f39fb84ac Merge pull request #112 from JaGoLi/main
Add uninstall target in makefile like dwm
2021-04-19 11:12:46 -05:00
Jason Goulet-Lipman d57db4cac9 added uninstall target 2021-04-19 09:05:35 -04:00
Devin J. Pohly 3f86336bad Merge branch 'main' into pipe-status 2021-04-15 13:06:06 -05:00
Devin J. Pohly 3727f4a7b3 update status info if focused client changes title
Fixes #108.
2021-04-15 13:05:05 -05:00
Devin J. Pohly 4170a90fbc group phony targets together in Makefile 2021-04-15 13:04:31 -05:00
Devin J. Pohly 6a0dec69ec re-compile if config.mk changes 2021-04-15 13:03:21 -05:00
Devin J. Pohly b372d4b55e pipe status info into -s command
Unlike with X window managers, the display socket in Wayland isn't set
up prior to starting the compositor.  Because of this, you can't pipe
the compositor's output directly into a program which needs access to
$WAYLAND_DISPLAY, which is a typical setup for this purpose.  Existing
scripts have been forced to create a pipe/FIFO or a temporary file as an
intermediary.

Instead, send the status info directly to stdin of the -s command, which
*does* have access to $WAYLAND_DISPLAY.

Fixes #103.
2021-04-14 11:23:23 -05:00
Devin J. Pohly 77e75cf554 Merge branch 'main' into wlroots-next 2021-04-09 12:53:15 -05:00
Devin J. Pohly 9071ce6c84 nuke CSDs, hopefully for good! 2021-04-09 12:37:49 -05:00
Devin J. Pohly 84b26ef1ba Revert "fix README for main branch"
This reverts commit 3a72cd924c.

There is probably an easier way to keep this difference, but hey, this
works for me.
2021-04-08 07:12:50 -05:00
Devin J. Pohly 3a72cd924c fix README for main branch 2021-04-08 07:11:13 -05:00
Devin J. Pohly 2a9404ac2a Merge branch 'main' into wlroots-next 2021-03-30 13:57:34 -05:00
Devin J. Pohly 3c83e0cfb8 don't move/resize if already moving/resizing
Fixes #102.  The "ideal" behavior might be to ignore buttons other than
the one being used for the action, but this is super-simple and still
seems reasonable.
2021-03-30 13:56:04 -05:00
Devin J. Pohly e73ea679f4 Merge branch 'main' into wlroots-next 2021-03-30 13:48:06 -05:00
Devin J. Pohly db647f2df6 fix labels on issue templates 2021-03-29 17:04:37 -05:00
Devin J. Pohly cd3d0a102f Merge branch 'main' into wlroots-next 2021-03-25 10:09:58 -05:00
Stivvo 38ba6d2277 Fullscreen: simplifications and fixes
Merges #69.
2021-03-25 10:05:12 -05:00
Devin J. Pohly c2b53c2d8d Merge pull request #91 from drdonahue/wip-tag-status-interface
Interface to display tag information on status bar
2021-03-25 09:58:17 -05:00
David Donahue ecc60878b3 changed fprintf(stdout) instances to printf(), changed function name from statusbar to printstatus 2021-03-13 11:20:33 -06:00
Devin J. Pohly 43b6e804cf Revert "remove sigchld function"
This reverts commit 1fa72b0772.
Fixes #97.
2021-03-13 10:42:42 -06:00
Devin J. Pohly fba820d5f6 Merge branch 'main' into wlroots-next 2021-03-10 09:53:09 -06:00
Devin J. Pohly 1fa72b0772 remove sigchld function
Explicitly setting the handler for SIGCHLD to SIG_IGN tells the OS to
reap zombie processes automatically, which is what we wanted anyway.
2021-03-10 09:50:09 -06:00
David Donahue 7cee5060bc added redirect from stdout to stderr for spawned processes to prevent conflicts with the statusbar outputs 2021-03-06 12:20:56 -06:00
Devin J. Pohly 2144546192 Merge branch 'main' into wlroots-next 2021-03-03 11:30:39 -06:00
Devin J. Pohly 15f5d31f98 correct key constant name
Fixes #94.
2021-03-03 11:29:53 -06:00
David Donahue 5b51bb82e2 Fixed tab formatting in 6 locations where statusbar() is called 2021-03-01 14:38:00 -06:00
David Donahue f5e7caac00 Changed output to stdout instead of a file 2021-03-01 13:49:29 -06:00
David Donahue 593b7eec3c updated output format for better expansibility and easier parsing 2021-03-01 13:19:25 -06:00
Devin J. Pohly b063dd89c3 Merge branch 'main' into wlroots-next 2021-03-01 11:26:16 -06:00
Devin J. Pohly fd498e1910 clarify a bit about status bars 2021-03-01 11:25:28 -06:00
Devin J. Pohly 02eed717ca add explanatory command about Ctrl-Alt-Bksp/Fx 2021-03-01 11:22:08 -06:00
Devin J. Pohly 2d71c9b9ff Add default menu command
dwm config parity
2021-03-01 11:21:15 -06:00
Devin J. Pohly 87b16e6095 Defaults should match dwm/Xorg default behavior 2021-03-01 11:17:10 -06:00
Devin J. Pohly c1eb2b49cd Revert "Revert "remove EGL parameter from backend_autocreate""
This reverts commit 8ed88822ca.
2021-02-16 13:13:49 -06:00
Devin J. Pohly e8192b4fc9 Revert "Revert "fix undeclared WLR_KEY_PRESSED""
This reverts commit a11f2bbc7a.
2021-02-16 13:13:48 -06:00
Devin J. Pohly 4798450944 Revert "Revert "document that we currently follow wlroots-git""
This reverts commit ed8e80d961.
2021-02-16 13:13:47 -06:00
David Donahue a1e24075d8 Removed unused variable from statusbar 2021-02-08 18:12:24 -06:00
David Donahue 27598bd04a added statusbar update when tags are updated 2021-02-07 01:03:04 -06:00
David Donahue 3868217466 Added interface to output information about tags, the currently selected monitor, and the focused client to a file for use by a status bar 2021-02-07 00:31:01 -06:00
14 changed files with 1887 additions and 1158 deletions
+13 -1
View File
@@ -2,9 +2,21 @@
name: Bug report
about: Something in dwl isn't working correctly
title: ''
labels: 'Type: bug'
labels: 'A: bug'
assignees: ''
---
## Info
dwl version:
wlroots version:
## Description
<!--
Only report bugs that can be reproduced on the main line
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
-->
+1 -1
View File
@@ -2,7 +2,7 @@
name: Enhancement idea
about: Suggest a feature or improvement
title: ''
labels: 'Type: enhancement'
labels: 'A: enhancement'
assignees: ''
---
+1 -1
View File
@@ -2,7 +2,7 @@ dwl - dwm for Wayland
Copyright © 2020 dwl team
See also the files LICENSE.tinywl and LICENSE.dwm.
See also the files LICENSE.tinywl, LICENSE.dwm and LICENSE.sway.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
+19
View File
@@ -0,0 +1,19 @@
Copyright (c) 2016-2017 Drew DeVault
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+39 -40
View File
@@ -1,61 +1,60 @@
.POSIX:
.SUFFIXES:
include config.mk
CFLAGS += -I. -DWLR_USE_UNSTABLE -std=c99
# flags for compiling
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\
-Werror=strict-prototypes -Werror=implicit -Werror=return-type -Werror=incompatible-pointer-types
WAYLAND_PROTOCOLS=$(shell pkg-config --variable=pkgdatadir wayland-protocols)
WAYLAND_SCANNER=$(shell pkg-config --variable=wayland_scanner wayland-scanner)
PKGS = wlroots wayland-server xcb xkbcommon libinput
CFLAGS += $(foreach p,$(PKGS),$(shell pkg-config --cflags $(p)))
LDLIBS += $(foreach p,$(PKGS),$(shell pkg-config --libs $(p)))
# CFLAGS / LDFLAGS
PKGS = wlroots wayland-server xkbcommon libinput $(XLIBS)
DWLCFLAGS = `$(PKG_CONFIG) --cflags $(PKGS)` $(DWLCPPFLAGS) $(DWLDEVCFLAGS) $(CFLAGS)
LDLIBS = `$(PKG_CONFIG) --libs $(PKGS)` $(LIBS)
all: dwl
dwl: dwl.o util.o
$(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
util.o: util.c util.h
# 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
# to your build system yourself and provide them in the include path.
WAYLAND_SCANNER = `$(PKG_CONFIG) --variable=wayland_scanner wayland-scanner`
WAYLAND_PROTOCOLS = `$(PKG_CONFIG) --variable=pkgdatadir wayland-protocols`
xdg-shell-protocol.h:
$(WAYLAND_SCANNER) server-header \
$(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $@
xdg-shell-protocol.c:
$(WAYLAND_SCANNER) private-code \
$(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $@
xdg-shell-protocol.o: xdg-shell-protocol.h
wlr-layer-shell-unstable-v1-protocol.h:
$(WAYLAND_SCANNER) server-header \
protocols/wlr-layer-shell-unstable-v1.xml $@
wlr-layer-shell-unstable-v1-protocol.c:
$(WAYLAND_SCANNER) private-code \
protocols/wlr-layer-shell-unstable-v1.xml $@
wlr-layer-shell-unstable-v1-protocol.o: wlr-layer-shell-unstable-v1-protocol.h
idle-protocol.h:
$(WAYLAND_SCANNER) server-header \
protocols/idle.xml $@
idle-protocol.c:
$(WAYLAND_SCANNER) private-code \
protocols/idle.xml $@
idle-protocol.o: idle-protocol.h
config.h: | config.def.h
config.h:
cp config.def.h $@
dwl.o: config.h client.h xdg-shell-protocol.h wlr-layer-shell-unstable-v1-protocol.h idle-protocol.h
dwl: xdg-shell-protocol.o wlr-layer-shell-unstable-v1-protocol.o idle-protocol.o
clean:
rm -f dwl *.o *-protocol.h *-protocol.c
rm -f dwl *.o *-protocol.h
dist: clean
mkdir -p dwl-$(VERSION)
cp -R LICENSE* Makefile README.md client.h config.def.h\
config.mk protocols dwl.1 dwl.c util.c util.h\
dwl-$(VERSION)
tar -caf dwl-$(VERSION).tar.gz dwl-$(VERSION)
rm -rf dwl-$(VERSION)
install: dwl
install -D dwl $(PREFIX)/bin/dwl
mkdir -p $(DESTDIR)$(PREFIX)/bin
cp -f dwl $(DESTDIR)$(PREFIX)/bin
chmod 755 $(DESTDIR)$(PREFIX)/bin/dwl
mkdir -p $(DESTDIR)$(MANDIR)/man1
cp -f dwl.1 $(DESTDIR)$(MANDIR)/man1
chmod 644 $(DESTDIR)$(MANDIR)/man1/dwl.1
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/dwl $(DESTDIR)$(MANDIR)/man1/dwl.1
.DEFAULT_GOAL=dwl
.PHONY: clean
.SUFFIXES: .c .o
.c.o:
$(CC) $(CPPFLAGS) $(DWLCFLAGS) -c $<
+111 -31
View File
@@ -1,77 +1,157 @@
# 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://github.com/swaywm/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
- 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
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. The built-in status bar is an exception to avoid taking a dependency on FreeType or Pango and increasing the SLOC
- 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 HiDPI/multi-DPI support
- Idle-inhibit protocol which lets applications such as mpv disable idle
monitoring
- Provide information to external status bars via stdout/stdin
- Urgency hints via xdg-activate protocol
- Support screen lockers via input-inhibitor protocol
- Various Wayland protocols
- XWayland support as provided by wlroots
- XWayland support as provided by wlroots (can be enabled in `config.mk`)
- Zero flickering - Wayland users naturally expect that "every frame is perfect"
- Layer shell popups (used by Waybar)
- Damage tracking provided by scenegraph API
Features under consideration (possibly as patches) are:
- Protocols made trivial by wlroots
- Communication from the compositor to status bars. A straightforward possibility would be to use stdout or a provided file descriptor.
- Implement the input-inhibitor protocol to support screen lockers
- Implement the idle-inhibit protocol which lets applications such as mpv disable idle monitoring
- Layer shell popups (used by Waybar)
- Basic yes/no damage tracking to avoid needless redraws
- More in-depth damage region tracking ([which may improve power usage](https://mozillagfx.wordpress.com/2019/10/22/dramatically-reduced-power-usage-in-firefox-70-on-macos-with-core-animation/))
- 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 urgent/attention/focus-request once it's part of the xdg-shell protocol (https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/9)
- 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* include:
Feature *non-goals* for the main codebase include:
- 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
## Building dwl
dwl has only two dependencies: wlroots 0.12 and wayland-protocols. Simply install these 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).
dwl has only two dependencies: `wlroots` and `wayland-protocols`.
To enable XWayland, you should also install xorg-xwayland and uncomment its flag in `config.mk`.
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`.
## 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
dwl can be run as-is, with no arguments. In an existing Wayland or X11 session, this will open a window to act as a virtual display. When run from a TTY, the Wayland server will take over the entire virtual terminal. Clients started by dwl will have `WAYLAND_DISPLAY` set in their environment, and other clients can be started from outside the session by setting this variable accordingly.
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.
You can also specify a startup program using the `-s` option. The argument to this option will be run at startup as a shell command (using `sh -c`) and can serve a similar function to `.xinitrc`: starting a service manager or other startup applications. Unlike `.xinitrc`, the display server will not shut down when this process terminates. Instead, as dwl is shutting down, it will send this process a SIGTERM and wait for it to terminate (if it hasn't already). This makes it ideal not only for initialization but also for execing into a user-level service manager like s6 or `systemd --user`.
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.
Note: 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.:
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.:
export XDG_RUNTIME_DIR=/tmp/xdg-runtime-$(id -u)
mkdir -p $XDG_RUNTIME_DIR
dwl
### 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:
dwl -s 'foot --server <&-'
If your startup command is a shell script, you can achieve the same inside the
script with the line
exec <&-
To get a list of status bars that work with dwl consult our [wiki].
## 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).
## IRC channel
dwl's IRC channel is #dwl on irc.freenode.net.
You can find a [list of useful resources on our wiki].
## 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
- 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
[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
+256 -25
View File
@@ -5,7 +5,7 @@
* that they will simply compile out if the chosen #defines leave them unused.
*/
/* Leave this function first; it's used in the others */
/* Leave these functions first; they're used in the others */
static inline int
client_is_x11(Client *c)
{
@@ -16,33 +16,145 @@ client_is_x11(Client *c)
#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 *
client_surface(Client *c)
{
#ifdef XWAYLAND
if (client_is_x11(c))
return c->surface.xwayland->surface;
#endif
return c->surface.xdg->surface;
}
static inline int
toplevel_from_wlr_surface(struct wlr_surface *s, Client **pc, LayerSurface **pl)
{
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
struct wlr_xwayland_surface *xsurface;
#endif
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 */
static inline void
client_activate_surface(struct wlr_surface *s, int activated)
{
struct wlr_xdg_surface *surface;
#ifdef XWAYLAND
if (wlr_surface_is_xwayland_surface(s)) {
wlr_xwayland_surface_activate(
wlr_xwayland_surface_from_wlr_surface(s), activated);
struct wlr_xwayland_surface *xsurface;
if (wlr_surface_is_xwayland_surface(s)
&& (xsurface = wlr_xwayland_surface_from_wlr_surface(s))) {
wlr_xwayland_surface_activate(xsurface, activated);
return;
}
#endif
if (wlr_surface_is_xdg_surface(s))
wlr_xdg_toplevel_set_activated(
wlr_xdg_surface_from_wlr_surface(s), activated);
if (wlr_surface_is_xdg_surface(s)
&& (surface = wlr_xdg_surface_from_wlr_surface(s))
&& surface->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL)
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
client_for_each_surface(Client *c, wlr_surface_iterator_func_t fn, void *data)
{
wlr_surface_for_each_surface(client_surface(c), fn, data);
#ifdef XWAYLAND
if (client_is_x11(c)) {
wlr_surface_for_each_surface(c->surface.xwayland->surface,
fn, data);
if (client_is_x11(c))
return;
}
#endif
wlr_xdg_surface_for_each_surface(c->surface.xdg, fn, data);
wlr_xdg_surface_for_each_popup_surface(c->surface.xdg, fn, data);
}
static inline const char *
@@ -70,6 +182,20 @@ client_get_geometry(Client *c, struct wlr_box *geom)
wlr_xdg_surface_get_geometry(c->surface.xdg, geom);
}
static inline Client *
client_get_parent(Client *c)
{
Client *p = NULL;
#ifdef XWAYLAND
if (client_is_x11(c) && c->surface.xwayland->parent)
toplevel_from_wlr_surface(c->surface.xwayland->parent->surface, &p, NULL);
#endif
if (c->surface.xdg->toplevel->parent)
toplevel_from_wlr_surface(c->surface.xdg->toplevel->parent->base->surface, &p, NULL);
return p;
}
static inline const char *
client_get_title(Client *c)
{
@@ -82,16 +208,76 @@ client_get_title(Client *c)
static inline int
client_is_float_type(Client *c)
{
struct wlr_box min = {0}, max = {0};
client_get_size_hints(c, &max, &min);
#ifdef XWAYLAND
if (client_is_x11(c)) {
struct wlr_xwayland_surface *surface = c->surface.xwayland;
if (surface->modal)
return 1;
for (size_t i = 0; i < surface->window_type_len; i++)
if (surface->window_type[i] == netatom[NetWMWindowTypeDialog]
|| surface->window_type[i] == netatom[NetWMWindowTypeSplash]
|| surface->window_type[i] == netatom[NetWMWindowTypeToolbar]
|| surface->window_type[i] == netatom[NetWMWindowTypeUtility])
return 1;
}
#endif
return ((min.width > 0 || min.height > 0 || max.width > 0 || max.height > 0)
&& (min.width == max.width || min.height == max.height));
}
static inline int
client_is_mapped(Client *c)
{
#ifdef XWAYLAND
if (client_is_x11(c))
for (size_t i = 0; i < c->surface.xwayland->window_type_len; i++)
if (c->surface.xwayland->window_type[i] == netatom[NetWMWindowTypeDialog] ||
c->surface.xwayland->window_type[i] == netatom[NetWMWindowTypeSplash] ||
c->surface.xwayland->window_type[i] == netatom[NetWMWindowTypeToolbar] ||
c->surface.xwayland->window_type[i] == netatom[NetWMWindowTypeUtility])
return 1;
return c->surface.xwayland->mapped;
#endif
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;
}
@@ -104,6 +290,27 @@ client_is_unmanaged(Client *c)
return 0;
}
static inline void
client_notify_enter(struct wlr_surface *s, struct wlr_keyboard *kb)
{
if (kb)
wlr_seat_keyboard_notify_enter(seat, s, kb->keycodes,
kb->num_keycodes, &kb->modifiers);
else
wlr_seat_keyboard_notify_enter(seat, s, NULL, 0, NULL);
}
static inline void
client_restack_surface(Client *c)
{
#ifdef XWAYLAND
if (client_is_x11(c))
wlr_xwayland_surface_restack(c->surface.xwayland, NULL,
XCB_STACK_MODE_ABOVE);
#endif
return;
}
static inline void
client_send_close(Client *c)
{
@@ -113,7 +320,7 @@ client_send_close(Client *c)
return;
}
#endif
wlr_xdg_toplevel_send_close(c->surface.xdg);
wlr_xdg_toplevel_send_close(c->surface.xdg->toplevel);
}
static inline void
@@ -125,7 +332,7 @@ client_set_fullscreen(Client *c, int fullscreen)
return;
}
#endif
wlr_xdg_toplevel_set_fullscreen(c->surface.xdg, fullscreen);
wlr_xdg_toplevel_set_fullscreen(c->surface.xdg->toplevel, fullscreen);
}
static inline uint32_t
@@ -138,17 +345,20 @@ client_set_size(Client *c, uint32_t width, uint32_t height)
return 0;
}
#endif
return wlr_xdg_toplevel_set_size(c->surface.xdg, width, height);
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 struct wlr_surface *
client_surface(Client *c)
static inline void
client_set_tiled(Client *c, uint32_t edges)
{
#ifdef XWAYLAND
if (client_is_x11(c))
return c->surface.xwayland->surface;
return;
#endif
return c->surface.xdg->surface;
wlr_xdg_toplevel_set_tiled(c->surface.xdg->toplevel, edges);
}
static inline struct wlr_surface *
@@ -161,3 +371,24 @@ client_surface_at(Client *c, double cx, double cy, double *sx, double *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;
}
+62 -16
View File
@@ -1,9 +1,12 @@
/* appearance */
static const int sloppyfocus = 1; /* focus follows mouse */
static const unsigned int borderpx = 1; /* border pixel of windows */
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 focuscolor[] = {1.0, 0.0, 0.0, 1.0};
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 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 focuscolor[] = {1.0, 0.0, 0.0, 1.0};
/* 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};
/* tagging */
static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
@@ -12,8 +15,8 @@ static const Rule rules[] = {
/* app_id title tags mask isfloating monitor */
/* examples:
{ "Gimp", NULL, 0, 1, -1 },
{ "firefox", NULL, 1 << 8, 0, -1 },
*/
{ "firefox", NULL, 1 << 8, 0, -1 },
};
/* layout(s) */
@@ -24,16 +27,14 @@ static const Layout layouts[] = {
{ "[M]", monocle },
};
/* monitors
* The order in which monitors are defined determines their position.
* Non-configured monitors are always added to the left. */
/* monitors */
static const MonitorRule monrules[] = {
/* name mfact nmaster scale layout rotate/reflect x y */
/* name mfact nmaster scale layout rotate/reflect */
/* example of a HiDPI laptop monitor:
{ "eDP-1", 0.5, 1, 2, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, 0, 0 },
{ "eDP-1", 0.5, 1, 2, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL },
*/
/* defaults */
{ NULL, 0.55, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, 0, 0 },
{ NULL, 0.55, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL },
};
/* keyboard */
@@ -42,6 +43,7 @@ static const struct xkb_rule_names xkb_rules = {
/* example:
.options = "ctrl:nocaps",
*/
.options = NULL,
};
static const int repeat_rate = 25;
@@ -49,9 +51,49 @@ static const int repeat_delay = 600;
/* Trackpad */
static const int tap_to_click = 1;
static const int natural_scrolling = 1;
static const int tap_and_drag = 1;
static const int drag_lock = 1;
static const int natural_scrolling = 0;
static const int disable_while_typing = 1;
static const int left_handed = 0;
static const int middle_button_emulation = 0;
/* You can choose between:
LIBINPUT_CONFIG_SCROLL_NO_SCROLL
LIBINPUT_CONFIG_SCROLL_2FG
LIBINPUT_CONFIG_SCROLL_EDGE
LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN
*/
static const enum libinput_config_scroll_method scroll_method = LIBINPUT_CONFIG_SCROLL_2FG;
/* You can choose between:
LIBINPUT_CONFIG_CLICK_METHOD_NONE
LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS
LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER
*/
static const enum libinput_config_click_method click_method = LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS;
/* You can choose between:
LIBINPUT_CONFIG_SEND_EVENTS_ENABLED
LIBINPUT_CONFIG_SEND_EVENTS_DISABLED
LIBINPUT_CONFIG_SEND_EVENTS_DISABLED_ON_EXTERNAL_MOUSE
*/
static const uint32_t send_events_mode = LIBINPUT_CONFIG_SEND_EVENTS_ENABLED;
/* You can choose between:
LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT
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;
/* 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 for MODKEY, use WLR_MODIFIER_LOGO */
#define MODKEY WLR_MODIFIER_ALT
#define TAGKEYS(KEY,SKEY,TAG) \
{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \
{ MODKEY|WLR_MODIFIER_CTRL, KEY, toggleview, {.ui = 1 << TAG} }, \
@@ -62,11 +104,13 @@ static const int natural_scrolling = 1;
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
/* commands */
static const char *termcmd[] = { "alacritty", NULL };
static const char *termcmd[] = { "foot", NULL };
static const char *menucmd[] = { "bemenu-run", NULL };
static const Key keys[] = {
/* Note that Shift changes certain key codes: c -> C, 2 -> at, etc. */
/* modifier key function argument */
{ MODKEY, XKB_KEY_p, spawn, {.v = menucmd} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Return, spawn, {.v = termcmd} },
{ MODKEY, XKB_KEY_j, focusstack, {.i = +1} },
{ MODKEY, XKB_KEY_k, focusstack, {.i = -1} },
@@ -82,7 +126,7 @@ static const Key keys[] = {
{ MODKEY, XKB_KEY_m, setlayout, {.v = &layouts[2]} },
{ MODKEY, XKB_KEY_space, setlayout, {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|WLR_MODIFIER_SHIFT, XKB_KEY_parenright, tag, {.ui = ~0} },
{ MODKEY, XKB_KEY_comma, focusmon, {.i = WLR_DIRECTION_LEFT} },
@@ -94,11 +138,13 @@ static const Key keys[] = {
TAGKEYS( XKB_KEY_3, XKB_KEY_numbersign, 2),
TAGKEYS( XKB_KEY_4, XKB_KEY_dollar, 3),
TAGKEYS( XKB_KEY_5, XKB_KEY_percent, 4),
TAGKEYS( XKB_KEY_6, XKB_KEY_caret, 5),
TAGKEYS( XKB_KEY_6, XKB_KEY_asciicircum, 5),
TAGKEYS( XKB_KEY_7, XKB_KEY_ampersand, 6),
TAGKEYS( XKB_KEY_8, XKB_KEY_asterisk, 7),
TAGKEYS( XKB_KEY_9, XKB_KEY_parenleft, 8),
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Q, quit, {0} },
/* 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} },
#define CHVT(n) { WLR_MODIFIER_CTRL|WLR_MODIFIER_ALT,XKB_KEY_XF86Switch_VT_##n, chvt, {.ui = (n)} }
CHVT(1), CHVT(2), CHVT(3), CHVT(4), CHVT(5), CHVT(6),
+10 -4
View File
@@ -1,8 +1,14 @@
_VERSION = 0.4-rc3
VERSION = `git describe --long --tags --dirty 2>/dev/null || echo $(_VERSION)`
PKG_CONFIG = pkg-config
# paths
PREFIX = /usr/local
MANDIR = $(PREFIX)/share/man
# Default compile flags (overridable by environment)
CFLAGS ?= -g -Wall -Wextra -Werror -Wno-unused-parameter -Wno-sign-compare -Wno-unused-function -Wno-unused-variable -Wdeclaration-after-statement
XWAYLAND =
XLIBS =
# Uncomment to build XWayland support
#CFLAGS += -DXWAYLAND
#XWAYLAND = -DXWAYLAND
#XLIBS = xcb xcb-icccm
+151
View File
@@ -0,0 +1,151 @@
.Dd January 8, 2021
.Dt DWL 1
.Os
.Sh NAME
.Nm dwl
.Nd dwm for Wayland
.Sh SYNOPSIS
.Nm
.Op Fl v
.Op Fl s Ar startup command
.Sh DESCRIPTION
.Nm
is a Wayland compositor based on wlroots.
It is intended to fill the same space in the Wayland world that
.Nm dwm
does for X11.
.Pp
When given the
.Fl v
option,
.Nm
writes its name and version to standard error and exits unsuccessfully.
.Pp
When given the
.Fl s
option,
.Nm
starts a shell process running
.Ar command
when starting.
When stopping, it sends
.Dv SIGTERM
to the child process and waits for it to exit.
.Pp
Users are encouraged to customize
.Nm
by editing the sources, in particular
.Pa config.h .
The default key bindings are as follows:
.Bl -tag -width 20n -offset indent -compact
.It Mod-[1-9]
Show only all windows with a tag.
.It Mod-Ctrl-[1-9]
Show all windows with a tag.
.It Mod-Shift-[1-9]
Move window to a single tag.
.It Mod-Ctrl-Shift-[1-9]
Toggle tag for window.
.It Mod-p
Spawn
.Nm bemenu-run .
.It Mod-Shift-Return
Spawn
.Nm foot .
.It Mod-[jk]
Move focus down/up the stack.
.It Mod-[id]
Increase/decrease number of windows in master area.
.It Mod-[hl]
Decrease/increase master area.
.It Mod-Return
Move window on top of stack or switch top of stack with second window.
.It Mod-Tab
Show only all windows with previous tag.
.It Mod-Shift-c
Close window.
.It Mod-t
Switch to tabbed layout.
.It Mod-f
Switch to floating layout.
.It Mod-m
Switch to monocle layout.
.It Mod-Space
Switch to previous layout.
.It Mod-Shift-Space
Toggle floating state of window.
.It Mod-e
Toggle fullscreen state of window.
.It Mod-0
Show all windows.
.It Mod-Shift-0
Set all tags for window.
.It Mod-,
Move focus to previous monitor.
.It Mod-.
Move focus to next monitor.
.It Mod-Shift-,
Move window to previous monitor.
.It Mod-Shift-.
Move window to next monitor.
.It Mod-Shift-q
Quit
.Nm .
.El
These might differ depending on your keyboard layout.
.Sh ENVIRONMENT
These environment variables are used by
.Nm :
.Bl -tag -width XDG_RUNTIME_DIR
.It Ev XDG_RUNTIME_DIR
A directory where temporary user files, such as the Wayland socket,
are stored.
.It Ev XDG_CONFIG_DIR
A directory containung configuration of various programs and
libraries, including libxkbcommon.
.It Ev DISPLAY , WAYLAND_DISPLAY , WAYLAND_SOCKET
Tell how to connect to an underlying X11 or Wayland server.
.It Ev WLR_*
Various variables specific to wlroots.
.It Ev XKB_* , XLOCALEDIR , XCOMPOSEFILE
Various variables specific to libxkbcommon.
.It Ev XCURSOR_PATH
List of directories to search for XCursor themes in.
.It Ev HOME
A directory where there are always dear files there for you.
Waiting for you to clean them up.
.El
.Pp
These are set by
.Nm :
.Bl -tag -width WAYLAND_DISPLAY
.It Ev WAYLAND_DISPLAY
Tell how to connect to
.Nm .
.It Ev DISPLAY
If using
.Nm Xwayland ,
tell how to connect to the
.Nm Xwayland
server.
.El
.Sh EXAMPLES
Start
.Nm
with s6 in the background:
.Dl dwl -s 's6-svscan <&-'
.Sh SEE ALSO
.Xr foot 1 ,
.Xr bemenu 1 ,
.Xr dwm 1 ,
.Xr xkeyboard-config 7
.Sh CAVEATS
The child process's standard input is connected with a pipe to
.Nm .
If the child process neither reads from the pipe nor closes its
standard input,
.Nm
will freeze after a while due to it blocking when writing to the full
pipe buffer.
.Sh BUGS
All of them.
+1185 -990
View File
File diff suppressed because it is too large Load Diff
-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>
+35
View File
@@ -0,0 +1,35 @@
/* See LICENSE.dwm file for copyright and license details. */
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "util.h"
void
die(const char *fmt, ...) {
va_list ap;
va_start(ap, fmt);
vfprintf(stderr, fmt, ap);
va_end(ap);
if (fmt[0] && fmt[strlen(fmt)-1] == ':') {
fputc(' ', stderr);
perror(NULL);
} else {
fputc('\n', stderr);
}
exit(1);
}
void *
ecalloc(size_t nmemb, size_t size)
{
void *p;
if (!(p = calloc(nmemb, size)))
die("calloc:");
return p;
}
+4
View File
@@ -0,0 +1,4 @@
/* See LICENSE.dwm file for copyright and license details. */
void die(const char *fmt, ...);
void *ecalloc(size_t nmemb, size_t size);