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 <qqmllist.h>
 | 
				
			||||||
#include <qquickwindow.h>
 | 
					#include <qquickwindow.h>
 | 
				
			||||||
#include <qscreen.h>
 | 
					#include <qscreen.h>
 | 
				
			||||||
 | 
					#include <qtenvironmentvariables.h>
 | 
				
			||||||
#include <qtimer.h>
 | 
					#include <qtimer.h>
 | 
				
			||||||
#include <qtmetamacros.h>
 | 
					#include <qtmetamacros.h>
 | 
				
			||||||
#include <qtypes.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) {
 | 
					void XPanelWindow::updateStrut(bool propagate) {
 | 
				
			||||||
	if (this->window == nullptr || this->window->handle() == nullptr) return;
 | 
						if (this->window == nullptr || this->window->handle() == nullptr) return;
 | 
				
			||||||
	auto* conn = x11Connection();
 | 
						auto* conn = x11Connection();
 | 
				
			||||||
| 
						 | 
					@ -405,12 +411,14 @@ void XPanelWindow::updateStrut(bool propagate) {
 | 
				
			||||||
	auto screenGeometry = this->window->screen()->geometry();
 | 
						auto screenGeometry = this->window->screen()->geometry();
 | 
				
			||||||
	auto horizontal = side == 0 || side == 1;
 | 
						auto horizontal = side == 0 || side == 1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	switch (side) {
 | 
						if (XINERAMA_STRUTS) {
 | 
				
			||||||
	case 0: exclusiveZone += screenGeometry.left(); break;
 | 
							switch (side) {
 | 
				
			||||||
	case 1: exclusiveZone += rootGeometry.right() - screenGeometry.right(); break;
 | 
							case 0: exclusiveZone += screenGeometry.left(); break;
 | 
				
			||||||
	case 2: exclusiveZone += screenGeometry.top(); break;
 | 
							case 1: exclusiveZone += rootGeometry.right() - screenGeometry.right(); break;
 | 
				
			||||||
	case 3: exclusiveZone += rootGeometry.bottom() - screenGeometry.bottom(); break;
 | 
							case 2: exclusiveZone += screenGeometry.top(); break;
 | 
				
			||||||
	default: break;
 | 
							case 3: exclusiveZone += rootGeometry.bottom() - screenGeometry.bottom(); break;
 | 
				
			||||||
 | 
							default: break;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	auto data = std::array<quint32, 12>();
 | 
						auto data = std::array<quint32, 12>();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue