mirror of
https://codeberg.org/dwl/dwl.git
synced 2025-10-28 10:34:50 +00:00
Compare commits
No commits in common. "26504f9a6f93e5b14819d5ed84dd27d3fbb41f3f" and "30f5063474a70835d0178ffc12521a3e0fb1ef8b" have entirely different histories.
26504f9a6f
...
30f5063474
13
client.h
13
client.h
@ -213,15 +213,16 @@ client_is_float_type(Client *c)
|
|||||||
if (client_is_x11(c)) {
|
if (client_is_x11(c)) {
|
||||||
struct wlr_xwayland_surface *surface = c->surface.xwayland;
|
struct wlr_xwayland_surface *surface = c->surface.xwayland;
|
||||||
xcb_size_hints_t *size_hints = surface->size_hints;
|
xcb_size_hints_t *size_hints = surface->size_hints;
|
||||||
|
size_t i;
|
||||||
if (surface->modal)
|
if (surface->modal)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (wlr_xwayland_surface_has_window_type(surface, WLR_XWAYLAND_NET_WM_WINDOW_TYPE_DIALOG)
|
for (i = 0; i < surface->window_type_len; i++)
|
||||||
|| wlr_xwayland_surface_has_window_type(surface, WLR_XWAYLAND_NET_WM_WINDOW_TYPE_SPLASH)
|
if (surface->window_type[i] == netatom[NetWMWindowTypeDialog]
|
||||||
|| wlr_xwayland_surface_has_window_type(surface, WLR_XWAYLAND_NET_WM_WINDOW_TYPE_TOOLBAR)
|
|| surface->window_type[i] == netatom[NetWMWindowTypeSplash]
|
||||||
|| wlr_xwayland_surface_has_window_type(surface, WLR_XWAYLAND_NET_WM_WINDOW_TYPE_UTILITY)) {
|
|| surface->window_type[i] == netatom[NetWMWindowTypeToolbar]
|
||||||
return 1;
|
|| surface->window_type[i] == netatom[NetWMWindowTypeUtility])
|
||||||
}
|
return 1;
|
||||||
|
|
||||||
return size_hints && size_hints->min_width > 0 && size_hints->min_height > 0
|
return size_hints && size_hints->min_width > 0 && size_hints->min_height > 0
|
||||||
&& (size_hints->max_width == size_hints->min_width
|
&& (size_hints->max_width == size_hints->min_width
|
||||||
|
|||||||
50
dwl.c
50
dwl.c
@ -85,6 +85,10 @@
|
|||||||
enum { CurNormal, CurPressed, CurMove, CurResize }; /* cursor */
|
enum { CurNormal, CurPressed, CurMove, CurResize }; /* cursor */
|
||||||
enum { XDGShell, LayerShell, X11 }; /* client types */
|
enum { XDGShell, LayerShell, X11 }; /* client types */
|
||||||
enum { LyrBg, LyrBottom, LyrTile, LyrFloat, LyrTop, LyrFS, LyrOverlay, LyrBlock, NUM_LAYERS }; /* scene layers */
|
enum { LyrBg, LyrBottom, LyrTile, LyrFloat, LyrTop, LyrFS, LyrOverlay, LyrBlock, NUM_LAYERS }; /* scene layers */
|
||||||
|
#ifdef XWAYLAND
|
||||||
|
enum { NetWMWindowTypeDialog, NetWMWindowTypeSplash, NetWMWindowTypeToolbar,
|
||||||
|
NetWMWindowTypeUtility, NetLast }; /* EWMH atoms */
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef union {
|
typedef union {
|
||||||
int i;
|
int i;
|
||||||
@ -413,9 +417,11 @@ static void associatex11(struct wl_listener *listener, void *data);
|
|||||||
static void configurex11(struct wl_listener *listener, void *data);
|
static void configurex11(struct wl_listener *listener, void *data);
|
||||||
static void createnotifyx11(struct wl_listener *listener, void *data);
|
static void createnotifyx11(struct wl_listener *listener, void *data);
|
||||||
static void dissociatex11(struct wl_listener *listener, void *data);
|
static void dissociatex11(struct wl_listener *listener, void *data);
|
||||||
|
static xcb_atom_t getatom(xcb_connection_t *xc, const char *name);
|
||||||
static void sethints(struct wl_listener *listener, void *data);
|
static void sethints(struct wl_listener *listener, void *data);
|
||||||
static void xwaylandready(struct wl_listener *listener, void *data);
|
static void xwaylandready(struct wl_listener *listener, void *data);
|
||||||
static struct wlr_xwayland *xwayland;
|
static struct wlr_xwayland *xwayland;
|
||||||
|
static xcb_atom_t netatom[NetLast];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* configuration, allows nested code to access above variables */
|
/* configuration, allows nested code to access above variables */
|
||||||
@ -1486,10 +1492,22 @@ gpureset(struct wl_listener *listener, void *data)
|
|||||||
void
|
void
|
||||||
handlesig(int signo)
|
handlesig(int signo)
|
||||||
{
|
{
|
||||||
if (signo == SIGCHLD)
|
if (signo == SIGCHLD) {
|
||||||
|
#ifdef XWAYLAND
|
||||||
|
siginfo_t in;
|
||||||
|
/* wlroots expects to reap the XWayland process itself, so we
|
||||||
|
* use WNOWAIT to keep the child waitable until we know it's not
|
||||||
|
* XWayland.
|
||||||
|
*/
|
||||||
|
while (!waitid(P_ALL, 0, &in, WEXITED|WNOHANG|WNOWAIT) && in.si_pid
|
||||||
|
&& (!xwayland || in.si_pid != xwayland->server->pid))
|
||||||
|
waitpid(in.si_pid, NULL, 0);
|
||||||
|
#else
|
||||||
while (waitpid(-1, NULL, WNOHANG) > 0);
|
while (waitpid(-1, NULL, WNOHANG) > 0);
|
||||||
else if (signo == SIGINT || signo == SIGTERM)
|
#endif
|
||||||
|
} else if (signo == SIGINT || signo == SIGTERM) {
|
||||||
quit(NULL);
|
quit(NULL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -3073,6 +3091,19 @@ dissociatex11(struct wl_listener *listener, void *data)
|
|||||||
wl_list_remove(&c->unmap.link);
|
wl_list_remove(&c->unmap.link);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
xcb_atom_t
|
||||||
|
getatom(xcb_connection_t *xc, const char *name)
|
||||||
|
{
|
||||||
|
xcb_atom_t atom = 0;
|
||||||
|
xcb_intern_atom_reply_t *reply;
|
||||||
|
xcb_intern_atom_cookie_t cookie = xcb_intern_atom(xc, 0, strlen(name), name);
|
||||||
|
if ((reply = xcb_intern_atom_reply(xc, cookie, NULL)))
|
||||||
|
atom = reply->atom;
|
||||||
|
free(reply);
|
||||||
|
|
||||||
|
return atom;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
sethints(struct wl_listener *listener, void *data)
|
sethints(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
@ -3092,6 +3123,19 @@ void
|
|||||||
xwaylandready(struct wl_listener *listener, void *data)
|
xwaylandready(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
struct wlr_xcursor *xcursor;
|
struct wlr_xcursor *xcursor;
|
||||||
|
xcb_connection_t *xc = xcb_connect(xwayland->display_name, NULL);
|
||||||
|
int err = xcb_connection_has_error(xc);
|
||||||
|
if (err) {
|
||||||
|
fprintf(stderr, "xcb_connect to X server failed with code %d\n. Continuing with degraded functionality.\n", err);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Collect atoms we are interested in. If getatom returns 0, we will
|
||||||
|
* not detect that window type. */
|
||||||
|
netatom[NetWMWindowTypeDialog] = getatom(xc, "_NET_WM_WINDOW_TYPE_DIALOG");
|
||||||
|
netatom[NetWMWindowTypeSplash] = getatom(xc, "_NET_WM_WINDOW_TYPE_SPLASH");
|
||||||
|
netatom[NetWMWindowTypeToolbar] = getatom(xc, "_NET_WM_WINDOW_TYPE_TOOLBAR");
|
||||||
|
netatom[NetWMWindowTypeUtility] = getatom(xc, "_NET_WM_WINDOW_TYPE_UTILITY");
|
||||||
|
|
||||||
/* assign the one and only seat */
|
/* assign the one and only seat */
|
||||||
wlr_xwayland_set_seat(xwayland, seat);
|
wlr_xwayland_set_seat(xwayland, seat);
|
||||||
@ -3102,6 +3146,8 @@ xwaylandready(struct wl_listener *listener, void *data)
|
|||||||
xcursor->images[0]->buffer, xcursor->images[0]->width * 4,
|
xcursor->images[0]->buffer, xcursor->images[0]->width * 4,
|
||||||
xcursor->images[0]->width, xcursor->images[0]->height,
|
xcursor->images[0]->width, xcursor->images[0]->height,
|
||||||
xcursor->images[0]->hotspot_x, xcursor->images[0]->hotspot_y);
|
xcursor->images[0]->hotspot_x, xcursor->images[0]->hotspot_y);
|
||||||
|
|
||||||
|
xcb_disconnect(xc);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user