diff options
| author | Leonardo Hernández Hernández <leohdz172@proton.me> | 2023-07-08 20:07:27 -0600 | 
|---|---|---|
| committer | Leonardo Hernández Hernández <leohdz172@proton.me> | 2023-11-14 19:44:28 -0600 | 
| commit | 31bf1cbaf6418a6fb39e41b21cadc5c20826a663 (patch) | |
| tree | e9609275aa6c11381be9ee8fd7bc0fde6613d603 /client.h | |
| parent | a4a83e95e69afd45ff1770149810d79de39b8467 (diff) | |
Revert "respect size hints"
This reverts commit 72e0a560d9836c5e8658003f548203bcd722e565.
Diffstat (limited to '')
| -rw-r--r-- | client.h | 53 | 
1 files changed, 19 insertions, 34 deletions
| @@ -16,31 +16,6 @@ client_is_x11(Client *c)  #endif  } -static inline void -client_get_size_hints(Client *c, struct wlr_box *max, struct wlr_box *min) -{ -	struct wlr_xdg_toplevel *toplevel; -	struct wlr_xdg_toplevel_state *state; -#ifdef XWAYLAND -	if (client_is_x11(c)) { -		xcb_size_hints_t *size_hints = c->surface.xwayland->size_hints; -		if (size_hints) { -			max->width = size_hints->max_width; -			max->height = size_hints->max_height; -			min->width = size_hints->min_width; -			min->height = size_hints->min_height; -		} -		return; -	} -#endif -	toplevel = c->surface.xdg->toplevel; -	state = &toplevel->current; -	max->width = state->max_width; -	max->height = state->max_height; -	min->width = state->min_width; -	min->height = state->min_height; -} -  static inline struct wlr_surface *  client_surface(Client *c)  { @@ -190,7 +165,6 @@ client_get_parent(Client *c)  #endif  	if (c->surface.xdg->toplevel->parent)  		toplevel_from_wlr_surface(c->surface.xdg->toplevel->parent->base->surface, &p, NULL); -  	return p;  } @@ -207,25 +181,36 @@ client_get_title(Client *c)  static inline int  client_is_float_type(Client *c)  { -	struct wlr_box min = {0}, max = {0}; -	client_get_size_hints(c, &max, &min); +	struct wlr_xdg_toplevel *toplevel; +	struct wlr_xdg_toplevel_state state;  #ifdef XWAYLAND  	if (client_is_x11(c)) {  		struct wlr_xwayland_surface *surface = c->surface.xwayland; +		xcb_size_hints_t *size_hints;  		if (surface->modal)  			return 1;  		for (size_t 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]) +			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; + +		size_hints = surface->size_hints; +		return size_hints && size_hints->min_width > 0 && size_hints->min_height > 0 +			&& (size_hints->max_width == size_hints->min_width +				|| size_hints->max_height == size_hints->min_height);  	}  #endif -	return ((min.width > 0 || min.height > 0 || max.width > 0 || max.height > 0) -		&& (min.width == max.width || min.height == max.height)); + +	toplevel = c->surface.xdg->toplevel; +	state = toplevel->current; +	return (state.min_width != 0 && state.min_height != 0 +		&& (state.min_width == state.max_width +		|| state.min_height == state.max_height)) +		|| toplevel->parent;  }  static inline int | 
