Add current view tags support
This commit is contained in:
		| @ -100,7 +100,7 @@ | ||||
|     </event> | ||||
|   </interface> | ||||
|  | ||||
|   <interface name="zriver_seat_status_v1" version="3"> | ||||
|   <interface name="zriver_seat_status_v1" version="4"> | ||||
|     <description summary="track seat focus"> | ||||
|       This interface allows clients to receive information about the current | ||||
|       focus of a seat. Note that (un)focused_output events will only be sent | ||||
| @ -128,13 +128,14 @@ | ||||
|       <arg name="output" type="object" interface="wl_output"/> | ||||
|     </event> | ||||
|  | ||||
|     <event name="focused_view"> | ||||
|     <event name="focused_view" since="4"> | ||||
|       <description summary="information on the focused view"> | ||||
|         Sent once on binding the interface and again whenever the focused | ||||
|         view or a property thereof changes. The title may be an empty string | ||||
|         if no view is focused or the focused view did not set a title. | ||||
|       </description> | ||||
|       <arg name="title" type="string" summary="title of the focused view"/> | ||||
|       <arg name="tags" type="uint" summary="32-bit bitfield"/> | ||||
|     </event> | ||||
|  | ||||
|     <event name="mode" since="3"> | ||||
|  | ||||
							
								
								
									
										10
									
								
								src/main.rs
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								src/main.rs
									
									
									
									
									
								
							| @ -53,6 +53,7 @@ struct Output { | ||||
|     name: Option<String>, | ||||
|     title: String, | ||||
|     geometry: OutputGeometry, | ||||
|     current_view_tags: Tags, | ||||
|     focused_tags: Tags, | ||||
|     urgent_tags: Tags, | ||||
|     populated_tags: Vec<u32>, | ||||
| @ -153,10 +154,11 @@ fn handle_river_seat_status( | ||||
|             zriver_seat_status_v1::Event::FocusedOutput { output } => { | ||||
|                 env.focused_output = Some(output.as_ref().id()); | ||||
|             }, | ||||
|             zriver_seat_status_v1::Event::FocusedView { title } => { | ||||
|             zriver_seat_status_v1::Event::FocusedView { title, tags } => { | ||||
|                 if let Some(focused_output) = env.focused_output { | ||||
|                     if let Some(output) = env.outputs.get_mut(&focused_output) { | ||||
|                         output.title = title; | ||||
|                         output.current_view_tags = Tags(tags); | ||||
|                     } | ||||
|                 } | ||||
|             }, | ||||
| @ -198,10 +200,10 @@ fn handle_river_output_status( | ||||
|         let output_id = output.as_ref().id(); | ||||
|         match event { | ||||
|             zriver_output_status_v1::Event::FocusedTags { | ||||
|                 tags: focused_tags, | ||||
|                 tags, | ||||
|             } => { | ||||
|                 if let Some(output) = env.outputs.get_mut(&output_id) { | ||||
|                     output.focused_tags = Tags(focused_tags); | ||||
|                     output.focused_tags = Tags(tags); | ||||
|                 } | ||||
|             }, | ||||
|             zriver_output_status_v1::Event::ViewTags { | ||||
| @ -307,7 +309,7 @@ fn global_manager_callback( | ||||
|                     let seat: Main<WlSeat> = registry.bind(version, id); | ||||
|                     seat.quick_assign(handle_seat_event); | ||||
|                 }, | ||||
|                 "zriver_status_manager_v1" => { | ||||
|                 "zriver_status_manager_v1" if version >= 4 => { | ||||
|                     let status_manager = registry.bind(version, id); | ||||
|                     if let Some(env) = env.get::<Env>() { | ||||
|                         env.status_manager = Some(status_manager); | ||||
|  | ||||
		Reference in New Issue
	
	Block a user