mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-22 21:05:58 +01:00
export-dmabuf, screencopy: schedule_frame -> needs_frame
needs_frame is for backends to trigger frames for reasons that compositors couldn't see coming. schedule_frame is freaky and I want to remove it. These protocols aren't backends but in this case they're close enough, so switch to needs_frame. CC #3664
This commit is contained in:
parent
7791ffe058
commit
71daec9441
2 changed files with 9 additions and 5 deletions
|
@ -4,7 +4,6 @@
|
||||||
#include <wlr/interfaces/wlr_output.h>
|
#include <wlr/interfaces/wlr_output.h>
|
||||||
#include <wlr/render/dmabuf.h>
|
#include <wlr/render/dmabuf.h>
|
||||||
#include <wlr/types/wlr_export_dmabuf_v1.h>
|
#include <wlr/types/wlr_export_dmabuf_v1.h>
|
||||||
#include <wlr/types/wlr_output.h>
|
|
||||||
#include <wlr/util/log.h>
|
#include <wlr/util/log.h>
|
||||||
#include "wlr-export-dmabuf-unstable-v1-protocol.h"
|
#include "wlr-export-dmabuf-unstable-v1-protocol.h"
|
||||||
|
|
||||||
|
@ -160,7 +159,10 @@ static void manager_handle_capture_output(struct wl_client *client,
|
||||||
wl_signal_add(&output->events.destroy, &frame->output_destroy);
|
wl_signal_add(&output->events.destroy, &frame->output_destroy);
|
||||||
frame->output_destroy.notify = frame_output_handle_destroy;
|
frame->output_destroy.notify = frame_output_handle_destroy;
|
||||||
|
|
||||||
wlr_output_schedule_frame(output);
|
// Request a frame because we can't assume that the current front buffer is still usable. It may
|
||||||
|
// have been released already, and we shouldn't lock it here because compositors want to render
|
||||||
|
// into the least damaged buffer.
|
||||||
|
wlr_output_update_needs_frame(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void manager_handle_destroy(struct wl_client *client,
|
static void manager_handle_destroy(struct wl_client *client,
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <drm_fourcc.h>
|
#include <drm_fourcc.h>
|
||||||
|
#include <wlr/interfaces/wlr_output.h>
|
||||||
#include <wlr/render/allocator.h>
|
#include <wlr/render/allocator.h>
|
||||||
#include <wlr/render/wlr_renderer.h>
|
#include <wlr/render/wlr_renderer.h>
|
||||||
#include <wlr/types/wlr_matrix.h>
|
#include <wlr/types/wlr_matrix.h>
|
||||||
#include <wlr/types/wlr_output.h>
|
|
||||||
#include <wlr/types/wlr_screencopy_v1.h>
|
#include <wlr/types/wlr_screencopy_v1.h>
|
||||||
#include <wlr/backend.h>
|
#include <wlr/backend.h>
|
||||||
#include <wlr/util/box.h>
|
#include <wlr/util/box.h>
|
||||||
|
@ -416,8 +416,10 @@ static void frame_handle_copy(struct wl_client *wl_client,
|
||||||
wl_signal_add(&output->events.destroy, &frame->output_enable);
|
wl_signal_add(&output->events.destroy, &frame->output_enable);
|
||||||
frame->output_enable.notify = frame_handle_output_enable;
|
frame->output_enable.notify = frame_handle_output_enable;
|
||||||
|
|
||||||
// Schedule a buffer commit
|
// Request a frame because we can't assume that the current front buffer is still usable. It may
|
||||||
wlr_output_schedule_frame(output);
|
// have been released already, and we shouldn't lock it here because compositors want to render
|
||||||
|
// into the least damaged buffer.
|
||||||
|
wlr_output_update_needs_frame(output);
|
||||||
|
|
||||||
wlr_output_lock_attach_render(output, true);
|
wlr_output_lock_attach_render(output, true);
|
||||||
if (frame->overlay_cursor) {
|
if (frame->overlay_cursor) {
|
||||||
|
|
Loading…
Reference in a new issue