mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 16:02:45 +00:00 
			
		
		
		
	Applets: Add DesktopPicker applet
This applet displays a grid of desktops, and shows the user what virtual desktop they are on. When clicked, the desktop will be changed.
This commit is contained in:
		
							parent
							
								
									2b37fad60b
								
							
						
					
					
						commit
						01248d28ef
					
				
					 6 changed files with 194 additions and 0 deletions
				
			
		
							
								
								
									
										40
									
								
								Userland/Applets/DesktopPicker/main.cpp
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										40
									
								
								Userland/Applets/DesktopPicker/main.cpp
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,40 @@ | |||
| /*
 | ||||
|  * Copyright (c) 2021, Peter Elliott <pelliott@ualberta.ca> | ||||
|  * | ||||
|  * SPDX-License-Identifier: BSD-2-Clause | ||||
|  */ | ||||
| 
 | ||||
| #include "DesktopStatusWindow.h" | ||||
| #include <LibGUI/Application.h> | ||||
| #include <LibGUI/Frame.h> | ||||
| #include <LibGUI/Painter.h> | ||||
| #include <LibGUI/Window.h> | ||||
| #include <LibGUI/WindowManagerServerConnection.h> | ||||
| #include <WindowServer/Window.h> | ||||
| #include <serenity.h> | ||||
| #include <stdio.h> | ||||
| 
 | ||||
| int main(int argc, char** argv) | ||||
| { | ||||
|     if (pledge("stdio recvfd sendfd rpath unix", nullptr) < 0) { | ||||
|         perror("pledge"); | ||||
|         return 1; | ||||
|     } | ||||
| 
 | ||||
|     auto app = GUI::Application::construct(argc, argv); | ||||
| 
 | ||||
|     // We need to obtain the WM connection here as well before the pledge shortening.
 | ||||
|     GUI::WindowManagerServerConnection::the(); | ||||
| 
 | ||||
|     if (pledge("stdio recvfd sendfd rpath", nullptr) < 0) { | ||||
|         perror("pledge"); | ||||
|         return 1; | ||||
|     } | ||||
| 
 | ||||
|     auto window = DesktopStatusWindow::construct(); | ||||
|     window->resize(28, 16); | ||||
|     window->show(); | ||||
|     window->make_window_manager(WindowServer::WMEventMask::VirtualDesktopChanges); | ||||
| 
 | ||||
|     return app->exec(); | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Peter Elliott
						Peter Elliott