Qt cleanup (#2622)
	
		
	
				
					
				
			* scale * contain weston hack in one file * rest * no show * missed onepull/214/head
							parent
							
								
									013b073463
								
							
						
					
					
						commit
						efc30f4a83
					
				
				 9 changed files with 55 additions and 106 deletions
			
			
		| @ -0,0 +1,25 @@ | |||||||
|  | #include <string> | ||||||
|  | 
 | ||||||
|  | #ifdef QCOM2 | ||||||
|  | #include <qpa/qplatformnativeinterface.h> | ||||||
|  | #include <QPlatformSurfaceEvent> | ||||||
|  | #include <wayland-client-protocol.h> | ||||||
|  | #endif | ||||||
|  | 
 | ||||||
|  | #include "qt_window.hpp" | ||||||
|  | 
 | ||||||
|  | void setMainWindow(QWidget *w) { | ||||||
|  |   float scale = getenv("SCALE") != NULL ? std::stof(getenv("SCALE")) : 1.0; | ||||||
|  |   w->setFixedSize(vwp_w*scale, vwp_h*scale); | ||||||
|  |   w->show(); | ||||||
|  | 
 | ||||||
|  | #ifdef QCOM2 | ||||||
|  |   QPlatformNativeInterface *native = QGuiApplication::platformNativeInterface(); | ||||||
|  |   wl_surface *s = reinterpret_cast<wl_surface*>(native->nativeResourceForWindow("surface", w.windowHandle())); | ||||||
|  |   wl_surface_set_buffer_transform(s, WL_OUTPUT_TRANSFORM_270); | ||||||
|  |   wl_surface_commit(s); | ||||||
|  |   w.showFullScreen(); | ||||||
|  | #endif | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
| @ -0,0 +1,9 @@ | |||||||
|  | #include <QWidget> | ||||||
|  | 
 | ||||||
|  | #ifdef QCOM2 | ||||||
|  |   const int vwp_w = 2160, vwp_h = 1080; | ||||||
|  | #else | ||||||
|  |   const int vwp_w = 1920, vwp_h = 1080; | ||||||
|  | #endif | ||||||
|  | 
 | ||||||
|  | void setMainWindow(QWidget *w); | ||||||
					Loading…
					
					
				
		Reference in new issue