forked from quickshell/quickshell
		
	fix(wayland): fix ext screens resetting and causing protocol error
Could not reproduce this personally but I am told this fixes it.
This commit is contained in:
		
							parent
							
								
									48bdcf4db2
								
							
						
					
					
						commit
						4eac0b40c3
					
				
					 2 changed files with 6 additions and 0 deletions
				
			
		| 
						 | 
					@ -68,7 +68,10 @@ bool LockWindowExtension::attach(QWindow* window, SessionLockManager* manager) {
 | 
				
			||||||
	if (current != nullptr) {
 | 
						if (current != nullptr) {
 | 
				
			||||||
		current->surface->setExtension(this);
 | 
							current->surface->setExtension(this);
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
 | 
							// Qt appears to be resetting the window's screen on creation on some systems. This works around it.
 | 
				
			||||||
 | 
							auto* screen = window->screen();
 | 
				
			||||||
		window->create();
 | 
							window->create();
 | 
				
			||||||
 | 
							window->setScreen(screen);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		waylandWindow = dynamic_cast<QtWaylandClient::QWaylandWindow*>(window->handle());
 | 
							waylandWindow = dynamic_cast<QtWaylandClient::QWaylandWindow*>(window->handle());
 | 
				
			||||||
		if (waylandWindow == nullptr) {
 | 
							if (waylandWindow == nullptr) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -54,7 +54,10 @@ bool LayershellWindowExtension::attach(QWindow* window) {
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (!hasSurface) {
 | 
						if (!hasSurface) {
 | 
				
			||||||
 | 
							// Qt appears to be resetting the window's screen on creation on some systems. This works around it.
 | 
				
			||||||
 | 
							auto* screen = window->screen();
 | 
				
			||||||
		window->create();
 | 
							window->create();
 | 
				
			||||||
 | 
							window->setScreen(screen);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		auto* waylandWindow = dynamic_cast<QtWaylandClient::QWaylandWindow*>(window->handle());
 | 
							auto* waylandWindow = dynamic_cast<QtWaylandClient::QWaylandWindow*>(window->handle());
 | 
				
			||||||
		if (waylandWindow == nullptr) {
 | 
							if (waylandWindow == nullptr) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue