mirror of
				https://codeberg.org/dwl/dwl.git
				synced 2025-10-31 12:04:16 +00:00 
			
		
		
		
	render floating clients above tiled ones
This first renders all fullscren clients, then floating clients, then tiled ones. xytoclient also needs to be modified to look for fullscreen and floating clients first.
This commit is contained in:
		
							parent
							
								
									1183a319a0
								
							
						
					
					
						commit
						50c4f500b4
					
				
							
								
								
									
										43
									
								
								dwl.c
									
									
									
									
									
								
							
							
						
						
									
										43
									
								
								dwl.c
									
									
									
									
									
								
							| @ -263,6 +263,7 @@ static void printstatus(void); | |||||||
| static void quit(const Arg *arg); | static void quit(const Arg *arg); | ||||||
| static void quitsignal(int signo); | static void quitsignal(int signo); | ||||||
| static void render(struct wlr_surface *surface, int sx, int sy, void *data); | static void render(struct wlr_surface *surface, int sx, int sy, void *data); | ||||||
|  | static void renderclient(Client *c, Monitor *m, struct timespec *now); | ||||||
| static void renderclients(Monitor *m, struct timespec *now); | static void renderclients(Monitor *m, struct timespec *now); | ||||||
| static void renderlayer(struct wl_list *layer_surfaces, struct timespec *now); | static void renderlayer(struct wl_list *layer_surfaces, struct timespec *now); | ||||||
| static void rendermon(struct wl_listener *listener, void *data); | static void rendermon(struct wl_listener *listener, void *data); | ||||||
| @ -1040,6 +1041,7 @@ setfullscreen(Client *c, int fullscreen) | |||||||
| 		resize(c, c->prevx, c->prevy, c->prevwidth, c->prevheight, 0); | 		resize(c, c->prevx, c->prevy, c->prevwidth, c->prevheight, 0); | ||||||
| 		arrange(c->mon); | 		arrange(c->mon); | ||||||
| 	} | 	} | ||||||
|  | 	motionnotify(0); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void | void | ||||||
| @ -1661,22 +1663,20 @@ render(struct wlr_surface *surface, int sx, int sy, void *data) | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void | void | ||||||
| renderclients(Monitor *m, struct timespec *now) | renderclient(Client *c, Monitor *m, struct timespec *now) | ||||||
| { | { | ||||||
| 	Client *c, *sel = selclient(); | 	Client *sel = selclient(); | ||||||
| 	const float *color; | 	const float *color; | ||||||
| 	double ox, oy; | 	double ox, oy; | ||||||
| 	int i, w, h; | 	int i, w, h; | ||||||
| 	struct render_data rdata; | 	struct render_data rdata; | ||||||
| 	struct wlr_box *borders; | 	struct wlr_box *borders; | ||||||
| 	struct wlr_surface *surface; | 	struct wlr_surface *surface; | ||||||
| 	/* Each subsequent window we render is rendered on top of the last. Because
 | 
 | ||||||
| 	 * our stacking list is ordered front-to-back, we iterate over it backwards. */ |  | ||||||
| 	wl_list_for_each_reverse(c, &stack, slink) { |  | ||||||
| 	/* Only render visible clients which show on this monitor */ | 	/* Only render visible clients which show on this monitor */ | ||||||
| 	if (!VISIBLEON(c, c->mon) || !wlr_output_layout_intersects( | 	if (!VISIBLEON(c, c->mon) || !wlr_output_layout_intersects( | ||||||
| 				output_layout, m->wlr_output, &c->geom)) | 				output_layout, m->wlr_output, &c->geom)) | ||||||
| 			continue; | 		return; | ||||||
| 
 | 
 | ||||||
| 	surface = client_surface(c); | 	surface = client_surface(c); | ||||||
| 	ox = c->geom.x, oy = c->geom.y; | 	ox = c->geom.x, oy = c->geom.y; | ||||||
| @ -1710,6 +1710,26 @@ renderclients(Monitor *m, struct timespec *now) | |||||||
| 	rdata.y = c->geom.y + c->bw; | 	rdata.y = c->geom.y + c->bw; | ||||||
| 	client_for_each_surface(c, render, &rdata); | 	client_for_each_surface(c, render, &rdata); | ||||||
| } | } | ||||||
|  | 
 | ||||||
|  | void | ||||||
|  | renderclients(Monitor *m, struct timespec *now) | ||||||
|  | { | ||||||
|  | 	Client *c; | ||||||
|  | 
 | ||||||
|  | 	/* Each subsequent window we render is rendered on top of the last. Because
 | ||||||
|  | 	 * our stacking list is ordered front-to-back, we iterate over it backwards. */ | ||||||
|  | 	wl_list_for_each_reverse(c, &stack, slink) { | ||||||
|  | 		if (!c->isfloating && !c->isfullscreen) | ||||||
|  | 			renderclient(c, m, now); | ||||||
|  | 	} | ||||||
|  | 	wl_list_for_each_reverse(c, &stack, slink) { | ||||||
|  | 		if (c->isfloating && !c->isfullscreen) | ||||||
|  | 			renderclient(c, m, now); | ||||||
|  | 	} | ||||||
|  | 	wl_list_for_each_reverse(c, &stack, slink) { | ||||||
|  | 		if (c->isfullscreen) | ||||||
|  | 			renderclient(c, m, now); | ||||||
|  | 	} | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void | void | ||||||
| @ -2389,7 +2409,16 @@ xytoclient(double x, double y) | |||||||
| 	 * borders. This relies on stack being ordered from top to bottom. */ | 	 * borders. This relies on stack being ordered from top to bottom. */ | ||||||
| 	Client *c; | 	Client *c; | ||||||
| 	wl_list_for_each(c, &stack, slink) | 	wl_list_for_each(c, &stack, slink) | ||||||
| 		if (VISIBLEON(c, c->mon) && wlr_box_contains_point(&c->geom, x, y)) | 		if (c->isfullscreen && VISIBLEON(c, c->mon) | ||||||
|  | 				&& wlr_box_contains_point(&c->geom, x, y)) | ||||||
|  | 			return c; | ||||||
|  | 	wl_list_for_each(c, &stack, slink) | ||||||
|  | 		if (c->isfloating && VISIBLEON(c, c->mon) | ||||||
|  | 				&& wlr_box_contains_point(&c->geom, x, y)) | ||||||
|  | 			return c; | ||||||
|  | 	wl_list_for_each(c, &stack, slink) | ||||||
|  | 		if (!c->isfloating && VISIBLEON(c, c->mon) | ||||||
|  | 				&& wlr_box_contains_point(&c->geom, x, y)) | ||||||
| 			return c; | 			return c; | ||||||
| 	return NULL; | 	return NULL; | ||||||
| } | } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Guido Cella
						Guido Cella