Skip to content

Commit

Permalink
chore: update to dwl v0.4-rc3
Browse files Browse the repository at this point in the history
  • Loading branch information
Frewacom committed Dec 25, 2022
1 parent 68caafe commit c698a97
Show file tree
Hide file tree
Showing 3 changed files with 241 additions and 48 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include config.mk

CFLAGS += -I. -DWLR_USE_UNSTABLE -std=c99 -Wno-declaration-after-statement -Wno-unused-label -Wno-error=implicit-function-declaration $(XWAYLAND)
CFLAGS += -I. -DWLR_USE_UNSTABLE -D_POSIX_C_SOURCE=200809L -Wno-declaration-after-statement -Wno-unused-label -Wno-error=implicit-function-declaration $(XWAYLAND)

WAYLAND_PROTOCOLS=$(shell pkg-config --variable=pkgdatadir wayland-protocols)
WAYLAND_SCANNER=$(shell pkg-config --variable=wayland_scanner wayland-scanner)
Expand Down
31 changes: 30 additions & 1 deletion client.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ client_set_bounds(Client *c, int32_t width, int32_t height)
return 0;
#endif
if (c->surface.xdg->client->shell->version >=
XDG_TOPLEVEL_CONFIGURE_BOUNDS_SINCE_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;
}
Expand Down Expand Up @@ -255,6 +255,32 @@ client_is_rendered_on_mon(Client *c, Monitor *m)
return 0;
}

static inline int
client_is_stopped(Client *c)
{
int pid;
siginfo_t in = {0};
#ifdef XWAYLAND
if (client_is_x11(c))
return 0;
#endif

wl_client_get_credentials(c->surface.xdg->client->client, &pid, NULL, NULL);
if (waitid(P_PID, pid, &in, WNOHANG|WCONTINUED|WSTOPPED|WNOWAIT) < 0) {
/* This process is not our child process, while is very unluckely that
* it is stopped, in order to do not skip frames assume that it is. */
if (errno == ECHILD)
return 1;
} else if (in.si_pid) {
if (in.si_code == CLD_STOPPED || in.si_code == CLD_TRAPPED)
return 1;
if (in.si_code == CLD_CONTINUED)
return 0;
}

return 0;
}

static inline int
client_is_unmanaged(Client *c)
{
Expand Down Expand Up @@ -319,6 +345,9 @@ client_set_size(Client *c, uint32_t width, uint32_t height)
return 0;
}
#endif
if (width == c->surface.xdg->toplevel->current.width
&& height ==c->surface.xdg->toplevel->current.height)
return 0;
return wlr_xdg_toplevel_set_size(c->surface.xdg->toplevel, width, height);
}

Expand Down
Loading

0 comments on commit c698a97

Please sign in to comment.