mirror of
				https://github.com/swaywm/sway.git
				synced 2025-11-03 09:01:43 -05:00 
			
		
		
		
	Merge pull request #1126 from zandrmartin/prevent-fullscreen-focus-stealing
prevent fullscreen focus thievery
This commit is contained in:
		
						commit
						0fa8b5abfb
					
				
					 1 changed files with 5 additions and 2 deletions
				
			
		| 
						 | 
					@ -310,7 +310,7 @@ static void positioner_place_window(wlc_handle handle) {
 | 
				
			||||||
		/* default */
 | 
							/* default */
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
		geo.origin.x -= geo.size.w / 2;
 | 
							geo.origin.x -= geo.size.w / 2;
 | 
				
			||||||
	} 
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	sway_log(L_DEBUG, "xdg-positioner: placing window %" PRIuPTR " "
 | 
						sway_log(L_DEBUG, "xdg-positioner: placing window %" PRIuPTR " "
 | 
				
			||||||
		"sized (%u,%u) offset by (%d,%d), "
 | 
							"sized (%u,%u) offset by (%d,%d), "
 | 
				
			||||||
| 
						 | 
					@ -605,10 +605,13 @@ static void handle_view_state_request(wlc_handle view, enum wlc_view_state_bit s
 | 
				
			||||||
			sway_log(L_DEBUG, "setting view %" PRIuPTR " %s, fullscreen %d", view, c->name, toggle);
 | 
								sway_log(L_DEBUG, "setting view %" PRIuPTR " %s, fullscreen %d", view, c->name, toggle);
 | 
				
			||||||
			arrange_windows(c->parent, -1, -1);
 | 
								arrange_windows(c->parent, -1, -1);
 | 
				
			||||||
			// Set it as focused window for that workspace if its going fullscreen
 | 
								// Set it as focused window for that workspace if its going fullscreen
 | 
				
			||||||
 | 
								swayc_t *ws = swayc_parent_by_type(c, C_WORKSPACE);
 | 
				
			||||||
			if (toggle) {
 | 
								if (toggle) {
 | 
				
			||||||
				swayc_t *ws = swayc_parent_by_type(c, C_WORKSPACE);
 | 
					 | 
				
			||||||
				// Set ws focus to c
 | 
									// Set ws focus to c
 | 
				
			||||||
				set_focused_container_for(ws, c);
 | 
									set_focused_container_for(ws, c);
 | 
				
			||||||
 | 
									ws->fullscreen = c;
 | 
				
			||||||
 | 
								} else {
 | 
				
			||||||
 | 
									ws->fullscreen = NULL;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		break;
 | 
							break;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue