mirror of
https://codeberg.org/dwl/dwl.git
synced 2026-11-03 20:02:23 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a6e2c155de | ||
|
|
be2bd72314 | ||
|
|
12a5856427 | ||
|
|
4ecb2a9df5 | ||
|
|
4953b7ea0c | ||
|
|
9dfaea2f79 | ||
|
|
afbafd53ab | ||
|
|
4ff9db2c40 | ||
|
|
d3fa32993c | ||
|
|
f08d8b3913 | ||
|
|
90e7c722e9 | ||
|
|
e2038450f2 | ||
|
|
4fd683cc84 | ||
|
|
d29259c26a | ||
|
|
fccce97448 | ||
|
|
d9ddaba762 | ||
|
|
f1675a4800 | ||
|
|
a75ca79630 | ||
|
|
87029e21c0 | ||
|
|
a514a928e4 | ||
|
|
242ffd7a75 | ||
|
|
f22c223cbf | ||
|
|
b83881f881 | ||
|
|
fa400c5d3d | ||
|
|
40b0ae76ae | ||
|
|
2a567195e6 | ||
|
|
cc23250527 |
@@ -153,6 +153,7 @@ given the base on which it is built. Implemented default features are:
|
||||
- Support screen lockers via ext-session-lock-v1 protocol
|
||||
- Various Wayland protocols
|
||||
- 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
|
||||
|
||||
|
||||
@@ -189,6 +189,7 @@ client_get_geometry(Client *c, struct wlr_box *geom)
|
||||
}
|
||||
#endif
|
||||
*geom = c->surface.xdg->geometry;
|
||||
geom->x = geom->y = 0;
|
||||
}
|
||||
|
||||
static inline Client *
|
||||
@@ -257,48 +258,6 @@ client_is_float_type(Client *c)
|
||||
(min.width == max.width || min.height == max.height));
|
||||
}
|
||||
|
||||
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;
|
||||
int unused_lx, unused_ly;
|
||||
if (!wlr_scene_node_coords(&c->scene->node, &unused_lx, &unused_ly))
|
||||
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 unlikely that
|
||||
* it is stopped, in order to do not skip frames, assume that it is. */
|
||||
if (errno == ECHILD)
|
||||
return 1;
|
||||
} else if (in.si_pid) {
|
||||
if (in.si_code == CLD_STOPPED || in.si_code == CLD_TRAPPED)
|
||||
return 1;
|
||||
if (in.si_code == CLD_CONTINUED)
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int
|
||||
client_is_unmanaged(Client *c)
|
||||
{
|
||||
@@ -365,19 +324,36 @@ client_set_scale(struct wlr_surface *s, float scale)
|
||||
wlr_surface_set_preferred_buffer_scale(s, (int32_t)ceilf(scale));
|
||||
}
|
||||
|
||||
static inline void
|
||||
/* Returns nonzero if the client has to commit a buffer with the new size */
|
||||
static inline uint32_t
|
||||
client_set_size(Client *c, uint32_t width, uint32_t height)
|
||||
{
|
||||
#ifdef XWAYLAND
|
||||
if (client_is_x11(c)) {
|
||||
wlr_xwayland_surface_configure(c->surface.xwayland,
|
||||
c->geom.x + c->bw, c->geom.y + c->bw, width, height);
|
||||
return;
|
||||
return (int)width != client_surface(c)->current.width
|
||||
|| (int)height != client_surface(c)->current.height;
|
||||
}
|
||||
#endif
|
||||
if ((int32_t)width != c->surface.xdg->toplevel->current.width
|
||||
|| (int32_t)height != c->surface.xdg->toplevel->current.height)
|
||||
wlr_xdg_toplevel_set_size(c->surface.xdg->toplevel, (int32_t)width, (int32_t)height);
|
||||
if ((int32_t)width == c->surface.xdg->toplevel->scheduled.width
|
||||
&& (int32_t)height == c->surface.xdg->toplevel->scheduled.height)
|
||||
return 0;
|
||||
return wlr_xdg_toplevel_set_size(c->surface.xdg->toplevel, (int32_t)width, (int32_t)height);
|
||||
}
|
||||
|
||||
static inline void
|
||||
client_send_frame_done_iterator(struct wlr_surface *s, int sx, int sy, void *data)
|
||||
{
|
||||
wlr_surface_send_frame_done(s, data);
|
||||
}
|
||||
|
||||
static inline void
|
||||
client_send_frame_done(Client *c)
|
||||
{
|
||||
struct timespec now;
|
||||
clock_gettime(CLOCK_MONOTONIC, &now);
|
||||
wlr_surface_for_each_surface(client_surface(c), client_send_frame_done_iterator, &now);
|
||||
}
|
||||
|
||||
static inline void
|
||||
|
||||
+4
-2
@@ -12,7 +12,6 @@ static const float rootcolor[] = COLOR(0x222222ff);
|
||||
static const float bordercolor[] = COLOR(0x444444ff);
|
||||
static const float focuscolor[] = COLOR(0x005577ff);
|
||||
static const float urgentcolor[] = COLOR(0xff0000ff);
|
||||
/* This conforms to the xdg-protocol. Set the alpha to zero to restore the old behavior */
|
||||
static const float fullscreen_bg[] = {0.0f, 0.0f, 0.0f, 1.0f}; /* You can also use glsl colors */
|
||||
|
||||
/* tagging - TAGCOUNT must be no greater than 31 */
|
||||
@@ -172,6 +171,9 @@ static const Button buttons[] = {
|
||||
};
|
||||
|
||||
static const Axis axes[] = {
|
||||
/* example of volume control:
|
||||
{ MODKEY, AxisUp, spawn, SHCMD("volume-up_EXAMPLE") },
|
||||
{ MODKEY, AxisDown, spawn, SHCMD("volume-down_EXAMPLE") },
|
||||
{ MODKEY, AxisDown, spawn, SHCMD("volume-down_EXAMPLE") }, */
|
||||
{ 0, 0, NULL, {0} },
|
||||
/* does nothing, but the array cannot be empty */
|
||||
};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
_VERSION = 0.9-dev
|
||||
_VERSION = 0.10-dev
|
||||
VERSION = `git describe --tags --dirty 2>/dev/null || echo $(_VERSION)`
|
||||
|
||||
PKG_CONFIG = pkg-config
|
||||
|
||||
Reference in New Issue
Block a user