use wlr_xwayland_surface_has_window_type() (wlroots!4553)
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4553
This commit is contained in:
		
							
								
								
									
										13
									
								
								client.h
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								client.h
									
									
									
									
									
								
							| @@ -213,16 +213,15 @@ client_is_float_type(Client *c) | ||||
| 	if (client_is_x11(c)) { | ||||
| 		struct wlr_xwayland_surface *surface = c->surface.xwayland; | ||||
| 		xcb_size_hints_t *size_hints = surface->size_hints; | ||||
| 		size_t i; | ||||
| 		if (surface->modal) | ||||
| 			return 1; | ||||
|  | ||||
| 		for (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; | ||||
| 		if (wlr_xwayland_surface_has_window_type(surface, WLR_XWAYLAND_NET_WM_WINDOW_TYPE_DIALOG) | ||||
| 				|| wlr_xwayland_surface_has_window_type(surface, WLR_XWAYLAND_NET_WM_WINDOW_TYPE_SPLASH) | ||||
| 				|| wlr_xwayland_surface_has_window_type(surface, WLR_XWAYLAND_NET_WM_WINDOW_TYPE_TOOLBAR) | ||||
| 				|| wlr_xwayland_surface_has_window_type(surface, WLR_XWAYLAND_NET_WM_WINDOW_TYPE_UTILITY)) { | ||||
| 			return 1; | ||||
| 		} | ||||
|  | ||||
| 		return size_hints && size_hints->min_width > 0 && size_hints->min_height > 0 | ||||
| 			&& (size_hints->max_width == size_hints->min_width | ||||
|   | ||||
							
								
								
									
										34
									
								
								dwl.c
									
									
									
									
									
								
							
							
						
						
									
										34
									
								
								dwl.c
									
									
									
									
									
								
							| @@ -85,10 +85,6 @@ | ||||
| enum { CurNormal, CurPressed, CurMove, CurResize }; /* cursor */ | ||||
| enum { XDGShell, LayerShell, X11 }; /* client types */ | ||||
| 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 { | ||||
| 	int i; | ||||
| @@ -417,11 +413,9 @@ static void associatex11(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 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 xwaylandready(struct wl_listener *listener, void *data); | ||||
| static struct wlr_xwayland *xwayland; | ||||
| static xcb_atom_t netatom[NetLast]; | ||||
| #endif | ||||
|  | ||||
| /* configuration, allows nested code to access above variables */ | ||||
| @@ -3091,19 +3085,6 @@ dissociatex11(struct wl_listener *listener, void *data) | ||||
| 	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 | ||||
| sethints(struct wl_listener *listener, void *data) | ||||
| { | ||||
| @@ -3123,19 +3104,6 @@ void | ||||
| xwaylandready(struct wl_listener *listener, void *data) | ||||
| { | ||||
| 	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 */ | ||||
| 	wlr_xwayland_set_seat(xwayland, seat); | ||||
| @@ -3146,8 +3114,6 @@ xwaylandready(struct wl_listener *listener, void *data) | ||||
| 				xcursor->images[0]->buffer, xcursor->images[0]->width * 4, | ||||
| 				xcursor->images[0]->width, xcursor->images[0]->height, | ||||
| 				xcursor->images[0]->hotspot_x, xcursor->images[0]->hotspot_y); | ||||
|  | ||||
| 	xcb_disconnect(xc); | ||||
| } | ||||
| #endif | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user