forked from quickshell/quickshell
		
	wayland/layershell: support opposite-to-exclusion edge margins
This commit is contained in:
		
							parent
							
								
									3b4ebc5f16
								
							
						
					
					
						commit
						479ff58f84
					
				
					 1 changed files with 9 additions and 4 deletions
				
			
		| 
						 | 
					@ -21,11 +21,16 @@ WlrLayershell::WlrLayershell(QObject* parent): ProxyWindowBase(parent) {
 | 
				
			||||||
		case ExclusionMode::Ignore: return -1;
 | 
							case ExclusionMode::Ignore: return -1;
 | 
				
			||||||
		case ExclusionMode::Normal: return this->bExclusiveZone;
 | 
							case ExclusionMode::Normal: return this->bExclusiveZone;
 | 
				
			||||||
		case ExclusionMode::Auto:
 | 
							case ExclusionMode::Auto:
 | 
				
			||||||
			const auto edge = this->bcExclusionEdge.value();
 | 
								const auto margins = this->bMargins.value();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			if (edge == Qt::TopEdge || edge == Qt::BottomEdge) return this->bImplicitHeight;
 | 
								// add reverse edge margins which are ignored by wlr-layer-shell
 | 
				
			||||||
			else if (edge == Qt::LeftEdge || edge == Qt::RightEdge) return this->bImplicitWidth;
 | 
								switch (this->bcExclusionEdge.value()) {
 | 
				
			||||||
			else return 0;
 | 
								case Qt::TopEdge: return this->bImplicitHeight + margins.bottom;
 | 
				
			||||||
 | 
								case Qt::BottomEdge: return this->bImplicitHeight + margins.top;
 | 
				
			||||||
 | 
								case Qt::LeftEdge: return this->bImplicitHeight + margins.right;
 | 
				
			||||||
 | 
								case Qt::RightEdge: return this->bImplicitHeight + margins.left;
 | 
				
			||||||
 | 
								default: return 0;
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	});
 | 
						});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue