configurable layer shell setup
This commit is contained in:
		
							parent
							
								
									9b72acd912
								
							
						
					
					
						commit
						b60462feb6
					
				| @ -15,9 +15,12 @@ const zwlr_layer_surface_v1_listener Bar::_layerSurfaceListener = { | |||||||
| Bar::Bar(const wl_output *output) | Bar::Bar(const wl_output *output) | ||||||
| { | { | ||||||
|     _surface = wl_compositor_create_surface(compositor); |     _surface = wl_compositor_create_surface(compositor); | ||||||
|     _layerSurface = zwlr_layer_shell_v1_get_layer_surface(wlrLayerShell, _surface, nullptr, ZWLR_LAYER_SHELL_V1_LAYER_TOP, "net.tapesoftware.Somebar"); |     _layerSurface = zwlr_layer_shell_v1_get_layer_surface(wlrLayerShell, | ||||||
|  |         _surface, nullptr, ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM, "net.tapesoftware.Somebar"); | ||||||
|     zwlr_layer_surface_v1_add_listener(_layerSurface, &_layerSurfaceListener, this); |     zwlr_layer_surface_v1_add_listener(_layerSurface, &_layerSurfaceListener, this); | ||||||
|     zwlr_layer_surface_v1_set_anchor(_layerSurface, ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP | ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT | ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT); |     auto anchor = topbar ? ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP : ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM; | ||||||
|  |     zwlr_layer_surface_v1_set_anchor(_layerSurface, | ||||||
|  |         anchor | ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT | ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT); | ||||||
|     zwlr_layer_surface_v1_set_size(_layerSurface, 0, barSize); |     zwlr_layer_surface_v1_set_size(_layerSurface, 0, barSize); | ||||||
|     zwlr_layer_surface_v1_set_exclusive_zone(_layerSurface, barSize); |     zwlr_layer_surface_v1_set_exclusive_zone(_layerSurface, barSize); | ||||||
|     wl_surface_commit(_surface); |     wl_surface_commit(_surface); | ||||||
|  | |||||||
| @ -2,3 +2,4 @@ | |||||||
| // See LICENSE file for copyright and license details.
 | // See LICENSE file for copyright and license details.
 | ||||||
| 
 | 
 | ||||||
| constexpr int barSize = 20; | constexpr int barSize = 20; | ||||||
|  | constexpr bool topbar = 1; | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user