river: remove wlroots 0.14 workarounds
Since updating to wlroots 0.15 we can remove several workarounds we had in place due to wlroots improvements.
This commit is contained in:
		
							
								
								
									
										2
									
								
								deps/zig-wlroots
									
									
									
									
										vendored
									
									
								
							
							
								
								
								
								
								
							
						
						
									
										2
									
								
								deps/zig-wlroots
									
									
									
									
										vendored
									
									
								
							 Submodule deps/zig-wlroots updated: a813d6c1c7...0bb32072a4
									
								
							| @ -677,8 +677,6 @@ fn xwaylandUnmanagedSurfaceAt(lx: f64, ly: f64) ?SurfaceAtResult { | ||||
| } | ||||
|  | ||||
| fn surfaceAtFilter(view: *View, filter_tags: u32) bool { | ||||
|     // TODO(wlroots): we can remove this view.surface != null check as surfaceAt | ||||
|     // will start filtering by mapped views by default in 0.15.0 | ||||
|     return view.surface != null and view.current.tags & filter_tags != 0; | ||||
| } | ||||
|  | ||||
|  | ||||
| @ -317,7 +317,7 @@ fn arrangeLayer( | ||||
|             ); | ||||
|             // This will cause the output to be rearranged, so it's fine to | ||||
|             // stop this attempt early. | ||||
|             layer_surface.wlr_layer_surface.close(); | ||||
|             layer_surface.wlr_layer_surface.destroy(); | ||||
|             return; | ||||
|         } else if (current_state.desired_width == 0) { | ||||
|             std.debug.assert(current_state.anchor.right and current_state.anchor.left); | ||||
| @ -342,7 +342,7 @@ fn arrangeLayer( | ||||
|                 "margins of layer surface '{s}' are too large to be reasonably handled. Closing.", | ||||
|                 .{layer_surface.wlr_layer_surface.namespace}, | ||||
|             ); | ||||
|             layer_surface.wlr_layer_surface.close(); | ||||
|             layer_surface.wlr_layer_surface.destroy(); | ||||
|             // This will cause the output to be rearranged, so it's fine to | ||||
|             // stop this attempt early. | ||||
|             return; | ||||
|  | ||||
| @ -179,15 +179,8 @@ pub fn removeOutput(self: *Self, output: *Output) void { | ||||
|  | ||||
|     // Close all layer surfaces on the removed output | ||||
|     for (output.layers) |*layer| { | ||||
|         // Closing the layer surface will cause LayerSurface.handleUnmap() | ||||
|         // to be called synchronously, which will remove it from this list. | ||||
|         while (layer.first) |layer_node| { | ||||
|             const layer_surface = &layer_node.data; | ||||
|  | ||||
|             layer_surface.wlr_layer_surface.close(); | ||||
|             layer_surface.wlr_layer_surface.output = null; | ||||
|             layer_surface.output = undefined; | ||||
|         } | ||||
|         // Destroying the layer surface will cause it to be removed from this list. | ||||
|         while (layer.first) |layer_node| layer_node.data.wlr_layer_surface.destroy(); | ||||
|     } | ||||
|  | ||||
|     // If any seat has the removed output focused, focus the fallback one | ||||
|  | ||||
| @ -84,7 +84,6 @@ status_trackers: std.SinglyLinkedList(SeatStatus) = .{}, | ||||
|  | ||||
| /// True if a pointer drag is currently in progress | ||||
| pointer_drag: bool = false, | ||||
| pointer_drag_idle_source: ?*wl.EventSource = null, | ||||
|  | ||||
| request_set_selection: wl.Listener(*wlr.Seat.event.RequestSetSelection) = | ||||
|     wl.Listener(*wlr.Seat.event.RequestSetSelection).init(handleRequestSetSelection), | ||||
| @ -129,8 +128,6 @@ pub fn deinit(self: *Self) void { | ||||
|         self.focus_stack.remove(node); | ||||
|         util.gpa.destroy(node); | ||||
|     } | ||||
|  | ||||
|     if (self.pointer_drag_idle_source) |idle_source| idle_source.remove(); | ||||
| } | ||||
|  | ||||
| /// Set the current focus. If a visible view is passed it will be focused. | ||||
| @ -460,7 +457,6 @@ fn handleRequestStartDrag( | ||||
|     if (self.pointer_drag) { | ||||
|         log.debug("ignoring request to start pointer drag, " ++ | ||||
|             "another pointer drag is already in progress", .{}); | ||||
|         if (event.drag.source) |source| source.destroy(); | ||||
|         return; | ||||
|     } | ||||
|  | ||||
| @ -492,22 +488,6 @@ fn handlePointerDragDestroy(listener: *wl.Listener(*wlr.Drag), wlr_drag: *wlr.Dr | ||||
|     const self = @fieldParentPtr(Self, "pointer_drag_destroy", listener); | ||||
|     self.pointer_drag_destroy.link.remove(); | ||||
|  | ||||
|     // TODO(wlroots): wlroots 0.14 doesn't send the wl_data_device.leave event | ||||
|     // until after this signal has been emitted. Triggering a wl_pointer.enter | ||||
|     // before the wl_data_device.leave breaks clients, so use an idle event | ||||
|     // source as a workaround. This has been fixed on the wlroots master branch | ||||
|     // in commit c9ba9e82. | ||||
|     const event_loop = server.wl_server.getEventLoop(); | ||||
|     assert(self.pointer_drag_idle_source == null); | ||||
|     self.pointer_drag_idle_source = event_loop.addIdle(*Self, finishPointerDragDestroy, self) catch { | ||||
|         log.crit("out of memory", .{}); | ||||
|         wlr_drag.seat_client.client.postNoMemory(); | ||||
|         return; | ||||
|     }; | ||||
| } | ||||
|  | ||||
| fn finishPointerDragDestroy(self: *Self) callconv(.C) void { | ||||
|     self.pointer_drag_idle_source = null; | ||||
|     self.pointer_drag = false; | ||||
|     self.cursor.checkFocusFollowsCursor(); | ||||
|     self.cursor.updateState(); | ||||
|  | ||||
| @ -219,7 +219,7 @@ fn handleNewLayerSurface(listener: *wl.Listener(*wlr.LayerSurfaceV1), wlr_layer_ | ||||
|         const output = self.input_manager.defaultSeat().focused_output; | ||||
|         if (output == &self.root.noop_output) { | ||||
|             log.err("no output available for layer surface '{s}'", .{wlr_layer_surface.namespace}); | ||||
|             wlr_layer_surface.close(); | ||||
|             wlr_layer_surface.destroy(); | ||||
|             return; | ||||
|         } | ||||
|  | ||||
|  | ||||
		Reference in New Issue
	
	Block a user