mirror of
https://codeberg.org/dwl/dwl.git
synced 2026-06-23 15:42:45 +00:00
Compare commits
1 Commits
main
..
74fdafbaef
| Author | SHA1 | Date | |
|---|---|---|---|
| 74fdafbaef |
@@ -1,8 +1,7 @@
|
|||||||
# dwl - dwm for Wayland
|
# dwl - dwm for Wayland
|
||||||
|
|
||||||
Join us on our [Discord server]
|
Join us on our IRC channel: [#dwl on Libera Chat]
|
||||||
Or Matrix: [#dwl-official:matrix.org]
|
Or on the community-maintained [Discord server].
|
||||||
Or on our IRC channel: [#dwl on Libera Chat]
|
|
||||||
|
|
||||||
dwl is a compact, hackable compositor for [Wayland] based on [wlroots]. It 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,
|
intended to fill the same space in the Wayland world that [dwm] does in X11,
|
||||||
@@ -24,14 +23,12 @@ with each release on the [release] page
|
|||||||
|
|
||||||
### Development branch [main]
|
### Development branch [main]
|
||||||
Active development progresses on the `main` branch. The `main` branch is built
|
Active development progresses on the `main` branch. The `main` branch is built
|
||||||
against the latest release of [wlroots]. PRs should target this branch unless they
|
against a late (and often changing) git commit of wlroots. While the adventurous
|
||||||
depend on functionality that is not in the current release of `wlroots`.
|
are welcome to use `main`, it is a rocky road. Using `main` requires that the
|
||||||
|
user be willing to chase git commits of wlroots. Testing development pull
|
||||||
### Preview branch [wlroots-next]
|
requests may involve merging unmerged pull requests in [wlroots]' git repository
|
||||||
The `wlroots-next` branch is built against the git version of [wlroots], which
|
and/or git commits of wayland.
|
||||||
is unstable and changes frequently. PRs requiring functionality from the git
|
|
||||||
version of `wlroots` should target this branch.
|
|
||||||
|
|
||||||
### Building dwl
|
### Building dwl
|
||||||
dwl has the following dependencies:
|
dwl has the following dependencies:
|
||||||
- libinput
|
- libinput
|
||||||
@@ -205,7 +202,6 @@ inspiration, and to the various contributors to the project, including:
|
|||||||
[dwl-patches]: https://codeberg.org/dwl/dwl-patches
|
[dwl-patches]: https://codeberg.org/dwl/dwl-patches
|
||||||
[list of useful resources on our wiki]: https://codeberg.org/dwl/dwl/wiki/Home#migrating-from-x
|
[list of useful resources on our wiki]: https://codeberg.org/dwl/dwl/wiki/Home#migrating-from-x
|
||||||
[main]: https://codeberg.org/dwl/dwl/src/branch/main
|
[main]: https://codeberg.org/dwl/dwl/src/branch/main
|
||||||
[wlroots-next]: https://codeberg.org/dwl/dwl/src/branch/wlroots-next
|
|
||||||
[release]: https://codeberg.org/dwl/dwl/releases
|
[release]: https://codeberg.org/dwl/dwl/releases
|
||||||
[runit]: http://smarden.org/runit/faq.html#userservices
|
[runit]: http://smarden.org/runit/faq.html#userservices
|
||||||
[s6]: https://skarnet.org/software/s6/
|
[s6]: https://skarnet.org/software/s6/
|
||||||
@@ -213,4 +209,3 @@ inspiration, and to the various contributors to the project, including:
|
|||||||
[wiki]: https://codeberg.org/dwl/dwl/wiki/Home#compatible-status-bars
|
[wiki]: https://codeberg.org/dwl/dwl/wiki/Home#compatible-status-bars
|
||||||
[Discord server]: https://discord.gg/jJxZnrGPWN
|
[Discord server]: https://discord.gg/jJxZnrGPWN
|
||||||
[Wayland]: https://wayland.freedesktop.org/
|
[Wayland]: https://wayland.freedesktop.org/
|
||||||
[#dwl-official:matrix.org]: https://matrix.to/#/#dwl-official:matrix.org
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
static const int sloppyfocus = 1; /* focus follows mouse */
|
static const int sloppyfocus = 1; /* focus follows mouse */
|
||||||
static const int bypass_surface_visibility = 0; /* 1 means idle inhibitors will disable idle tracking even if it's surface isn't visible */
|
static const int bypass_surface_visibility = 0; /* 1 means idle inhibitors will disable idle tracking even if it's surface isn't visible */
|
||||||
static const unsigned int borderpx = 1; /* border pixel of windows */
|
static const unsigned int borderpx = 1; /* border pixel of windows */
|
||||||
|
static const unsigned int snap = 32; /* snap pixel */
|
||||||
static const float rootcolor[] = COLOR(0x222222ff);
|
static const float rootcolor[] = COLOR(0x222222ff);
|
||||||
static const float bordercolor[] = COLOR(0x444444ff);
|
static const float bordercolor[] = COLOR(0x444444ff);
|
||||||
static const float focuscolor[] = COLOR(0x005577ff);
|
static const float focuscolor[] = COLOR(0x005577ff);
|
||||||
|
|||||||
@@ -586,7 +586,7 @@ arrangelayers(Monitor *m)
|
|||||||
arrange(m);
|
arrange(m);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Arrange non-exclusive surfaces from top->bottom */
|
/* Arrange non-exlusive surfaces from top->bottom */
|
||||||
for (i = 3; i >= 0; i--)
|
for (i = 3; i >= 0; i--)
|
||||||
arrangelayer(m, &m->layers[i], &usable_area, 0);
|
arrangelayer(m, &m->layers[i], &usable_area, 0);
|
||||||
|
|
||||||
@@ -1863,6 +1863,7 @@ void
|
|||||||
motionnotify(uint32_t time, struct wlr_input_device *device, double dx, double dy,
|
motionnotify(uint32_t time, struct wlr_input_device *device, double dx, double dy,
|
||||||
double dx_unaccel, double dy_unaccel)
|
double dx_unaccel, double dy_unaccel)
|
||||||
{
|
{
|
||||||
|
int nx, ny;
|
||||||
double sx = 0, sy = 0, sx_confined, sy_confined;
|
double sx = 0, sy = 0, sx_confined, sy_confined;
|
||||||
Client *c = NULL, *w = NULL;
|
Client *c = NULL, *w = NULL;
|
||||||
LayerSurface *l = NULL;
|
LayerSurface *l = NULL;
|
||||||
@@ -1920,7 +1921,17 @@ motionnotify(uint32_t time, struct wlr_input_device *device, double dx, double d
|
|||||||
/* If we are currently grabbing the mouse, handle and return */
|
/* If we are currently grabbing the mouse, handle and return */
|
||||||
if (cursor_mode == CurMove) {
|
if (cursor_mode == CurMove) {
|
||||||
/* Move the grabbed client to the new position. */
|
/* Move the grabbed client to the new position. */
|
||||||
resize(grabc, (struct wlr_box){.x = (int)round(cursor->x) - grabcx, .y = (int)round(cursor->y) - grabcy,
|
nx = (int)round(cursor->x) - grabcx;
|
||||||
|
ny = (int)round(cursor->y) - grabcy;
|
||||||
|
if (abs(selmon->w.x - nx) < (int)snap)
|
||||||
|
nx = selmon->w.x;
|
||||||
|
else if (abs((selmon->w.x + selmon->w.width) - (nx + grabc->geom.width)) < (int)snap)
|
||||||
|
nx = selmon->w.x + selmon->w.width - grabc->geom.width;
|
||||||
|
if (abs(selmon->w.y - ny) < (int)snap)
|
||||||
|
ny = selmon->w.y;
|
||||||
|
else if (abs((selmon->w.y + selmon->w.height) - (ny + grabc->geom.height)) < (int)snap)
|
||||||
|
ny = selmon->w.y + selmon->w.height - grabc->geom.height;
|
||||||
|
resize(grabc, (struct wlr_box){.x = nx, .y = ny,
|
||||||
.width = grabc->geom.width, .height = grabc->geom.height}, 1);
|
.width = grabc->geom.width, .height = grabc->geom.height}, 1);
|
||||||
return;
|
return;
|
||||||
} else if (cursor_mode == CurResize) {
|
} else if (cursor_mode == CurResize) {
|
||||||
@@ -2134,7 +2145,7 @@ powermgrsetmode(struct wl_listener *listener, void *data)
|
|||||||
if (!m)
|
if (!m)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m->gamma_lut_changed = 1; /* Reapply gamma LUT when re-enabling the output */
|
m->gamma_lut_changed = 1; /* Reapply gamma LUT when re-enabling the ouput */
|
||||||
wlr_output_state_set_enabled(&state, event->mode);
|
wlr_output_state_set_enabled(&state, event->mode);
|
||||||
wlr_output_commit_state(m->wlr_output, &state);
|
wlr_output_commit_state(m->wlr_output, &state);
|
||||||
|
|
||||||
@@ -2456,7 +2467,7 @@ setup(void)
|
|||||||
wlr_log_init(log_level, NULL);
|
wlr_log_init(log_level, NULL);
|
||||||
|
|
||||||
/* The Wayland display is managed by libwayland. It handles accepting
|
/* The Wayland display is managed by libwayland. It handles accepting
|
||||||
* clients from the Unix socket, managing Wayland globals, and so on. */
|
* clients from the Unix socket, manging Wayland globals, and so on. */
|
||||||
dpy = wl_display_create();
|
dpy = wl_display_create();
|
||||||
event_loop = wl_display_get_event_loop(dpy);
|
event_loop = wl_display_get_event_loop(dpy);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user