forked from quickshell/quickshell
		
	x11/panelwindow: add option to disable Xinerama aware struts
Breaks bad WMs less.
This commit is contained in:
		
							parent
							
								
									6cb7d894ab
								
							
						
					
					
						commit
						397476244c
					
				
					 1 changed files with 14 additions and 6 deletions
				
			
		| 
						 | 
				
			
			@ -10,6 +10,7 @@
 | 
			
		|||
#include <qqmllist.h>
 | 
			
		||||
#include <qquickwindow.h>
 | 
			
		||||
#include <qscreen.h>
 | 
			
		||||
#include <qtenvironmentvariables.h>
 | 
			
		||||
#include <qtimer.h>
 | 
			
		||||
#include <qtmetamacros.h>
 | 
			
		||||
#include <qtypes.h>
 | 
			
		||||
| 
						 | 
				
			
			@ -386,6 +387,11 @@ void XPanelWindow::getExclusion(int& side, quint32& exclusiveZone) {
 | 
			
		|||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Disable xinerama structs to break multi monitor configurations with bad WMs less.
 | 
			
		||||
// Usually this results in one monitor at the top left corner of the root window working
 | 
			
		||||
// perfectly and all others being broken semi randomly.
 | 
			
		||||
static bool XINERAMA_STRUTS = qEnvironmentVariableIsEmpty("QS_NO_XINERAMA_STRUTS"); // NOLINT
 | 
			
		||||
 | 
			
		||||
void XPanelWindow::updateStrut(bool propagate) {
 | 
			
		||||
	if (this->window == nullptr || this->window->handle() == nullptr) return;
 | 
			
		||||
	auto* conn = x11Connection();
 | 
			
		||||
| 
						 | 
				
			
			@ -405,6 +411,7 @@ void XPanelWindow::updateStrut(bool propagate) {
 | 
			
		|||
	auto screenGeometry = this->window->screen()->geometry();
 | 
			
		||||
	auto horizontal = side == 0 || side == 1;
 | 
			
		||||
 | 
			
		||||
	if (XINERAMA_STRUTS) {
 | 
			
		||||
		switch (side) {
 | 
			
		||||
		case 0: exclusiveZone += screenGeometry.left(); break;
 | 
			
		||||
		case 1: exclusiveZone += rootGeometry.right() - screenGeometry.right(); break;
 | 
			
		||||
| 
						 | 
				
			
			@ -412,6 +419,7 @@ void XPanelWindow::updateStrut(bool propagate) {
 | 
			
		|||
		case 3: exclusiveZone += rootGeometry.bottom() - screenGeometry.bottom(); break;
 | 
			
		||||
		default: break;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	auto data = std::array<quint32, 12>();
 | 
			
		||||
	data[side] = exclusiveZone;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue