mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 12:22:44 +00:00 
			
		
		
		
	WindowServer+Userland: Pass wallpapers as Gfx::Bitmap instead of path
				
					
				
			The WindowServer _really_ does not need to know the filesystem path to it's wallpaper, and allows setting arbitrary wallpapers (those outside of `/res/wallpapers`). The GUI::Desktop will keep track of the path to the wallpaper (if any), and save it to config if desired (to be persisted). This avoids the need to `unveil` paths to the wallpaper, fixing #11158
This commit is contained in:
		
							parent
							
								
									f538545987
								
							
						
					
					
						commit
						a0e7a4b9a8
					
				
					 13 changed files with 61 additions and 58 deletions
				
			
		|  | @ -169,8 +169,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) | |||
| 
 | ||||
|     auto desktop_wallpaper_action = GUI::Action::create("Set as Desktop &Wallpaper", TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-display-settings.png")), | ||||
|         [&](auto&) { | ||||
|             auto could_set_wallpaper = GUI::Desktop::the().set_wallpaper(widget->path()); | ||||
|             if (!could_set_wallpaper) { | ||||
|             if (!GUI::Desktop::the().set_wallpaper(widget->bitmap(), widget->path())) { | ||||
|                 GUI::MessageBox::show(window, | ||||
|                     String::formatted("set_wallpaper({}) failed", widget->path()), | ||||
|                     "Could not set wallpaper", | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 James Puleo
						James Puleo