Merge pull request #3016 from fufesou/fix/wayland_add_default_portal_stream_position
add default position for portal streams
This commit is contained in:
		
						commit
						bd5ed0d671
					
				| @ -386,21 +386,22 @@ fn streams_from_response(response: OrgFreedesktopPortalRequestResponse) -> Vec<P | |||||||
|                             info.size.1 = v[1] as _; |                             info.size.1 = v[1] as _; | ||||||
|                         } |                         } | ||||||
|                     } |                     } | ||||||
|                     let v = attributes |                     if let Some(pos) = attributes.get("position") { | ||||||
|                         .get("position")? |                         let v = pos | ||||||
|                         .as_iter()? |                             .as_iter()? | ||||||
|                         .filter_map(|v| { |                             .filter_map(|v| { | ||||||
|                             Some( |                                 Some( | ||||||
|                                 v.as_iter()? |                                     v.as_iter()? | ||||||
|                                     .map(|x| x.as_i64().unwrap_or(0)) |                                         .map(|x| x.as_i64().unwrap_or(0)) | ||||||
|                                     .collect::<Vec<i64>>(), |                                         .collect::<Vec<i64>>(), | ||||||
|                             ) |                                 ) | ||||||
|                         }) |                             }) | ||||||
|                         .next(); |                             .next(); | ||||||
|                     if let Some(v) = v { |                         if let Some(v) = v { | ||||||
|                         if v.len() == 2 { |                             if v.len() == 2 { | ||||||
|                             info.position.0 = v[0] as _; |                                 info.position.0 = v[0] as _; | ||||||
|                             info.position.1 = v[1] as _; |                                 info.position.1 = v[1] as _; | ||||||
|  |                             } | ||||||
|                         } |                         } | ||||||
|                     } |                     } | ||||||
|                     Some(info) |                     Some(info) | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user