2010-10-21 13:13:00 +01:00
|
|
|
/*
|
|
|
|
* Clutter.
|
|
|
|
*
|
|
|
|
* An OpenGL based 'interactive canvas' library.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2010 Intel Corporation.
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2023-07-21 15:37:20 +02:00
|
|
|
#pragma once
|
2010-10-21 11:29:09 +01:00
|
|
|
|
2023-08-07 15:38:12 +02:00
|
|
|
#include "clutter/clutter-grab.h"
|
|
|
|
#include "clutter/clutter-stage-window.h"
|
|
|
|
#include "clutter/clutter-stage.h"
|
|
|
|
#include "clutter/clutter-input-device.h"
|
|
|
|
#include "clutter/clutter-private.h"
|
2010-10-21 11:29:09 +01:00
|
|
|
|
2023-08-07 15:38:12 +02:00
|
|
|
#include "cogl/cogl.h"
|
2011-03-10 22:05:03 +00:00
|
|
|
|
2010-10-21 11:29:09 +01:00
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2022-04-07 12:10:13 +02:00
|
|
|
typedef gboolean (* ClutterEventHandler) (const ClutterEvent *event,
|
|
|
|
gpointer user_data);
|
2021-06-25 19:50:26 +02:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
CLUTTER_DEVICE_UPDATE_NONE = 0,
|
|
|
|
CLUTTER_DEVICE_UPDATE_EMIT_CROSSING = 1 << 0,
|
2021-07-05 17:23:21 +02:00
|
|
|
CLUTTER_DEVICE_UPDATE_IGNORE_CACHE = 1 << 1,
|
2021-06-25 19:50:26 +02:00
|
|
|
} ClutterDeviceUpdateFlags;
|
|
|
|
|
2010-10-21 11:29:09 +01:00
|
|
|
/* stage */
|
|
|
|
ClutterStageWindow *_clutter_stage_get_default_window (void);
|
2011-08-16 16:01:22 +01:00
|
|
|
|
2021-05-10 16:16:15 +02:00
|
|
|
CLUTTER_EXPORT
|
2020-02-06 09:00:12 +01:00
|
|
|
void clutter_stage_paint_view (ClutterStage *stage,
|
|
|
|
ClutterStageView *view,
|
2022-10-13 17:50:34 +02:00
|
|
|
const cairo_region_t *redraw_clip,
|
|
|
|
ClutterFrame *frame);
|
2011-08-16 16:01:22 +01:00
|
|
|
|
clutter: Paint views with individual frame clocks
Replace the default master clock with multiple frame clocks, each
driving its own stage view. As each stage view represents one CRTC, this
means we draw each CRTC with its own designated frame clock,
disconnected from all the others.
For example this means we when using the native backend will never need
to wait for one monitor to vsync before painting another, so e.g. having
a 144 Hz monitor next to a 60 Hz monitor, things including both Wayland
and X11 applications and shell UI will be able to render at the
corresponding monitor refresh rate.
This also changes a warning about missed frames when sending
_NETWM_FRAME_TIMINGS messages to a debug log entry, as it's expected
that we'll start missing frames e.g. when a X11 window (via Xwayland) is
exclusively within a stage view that was not painted, while another one
was, still increasing the global frame clock.
Addititonally, this also requires the X11 window actor to schedule
timeouts for _NET_WM_FRAME_DRAWN/_NET_WM_FRAME_TIMINGS event emitting,
if the actor wasn't on any stage views, as now we'll only get the frame
callbacks on actors when they actually were painted, while in the past,
we'd invoke that vfunc when anything was painted.
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/903
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1285
2020-05-30 00:27:56 +02:00
|
|
|
void clutter_stage_emit_before_update (ClutterStage *stage,
|
2022-10-13 17:50:34 +02:00
|
|
|
ClutterStageView *view,
|
|
|
|
ClutterFrame *frame);
|
2022-04-29 16:02:08 +02:00
|
|
|
void clutter_stage_emit_prepare_frame (ClutterStage *stage,
|
2022-10-13 17:50:34 +02:00
|
|
|
ClutterStageView *view,
|
|
|
|
ClutterFrame *frame);
|
clutter: Paint views with individual frame clocks
Replace the default master clock with multiple frame clocks, each
driving its own stage view. As each stage view represents one CRTC, this
means we draw each CRTC with its own designated frame clock,
disconnected from all the others.
For example this means we when using the native backend will never need
to wait for one monitor to vsync before painting another, so e.g. having
a 144 Hz monitor next to a 60 Hz monitor, things including both Wayland
and X11 applications and shell UI will be able to render at the
corresponding monitor refresh rate.
This also changes a warning about missed frames when sending
_NETWM_FRAME_TIMINGS messages to a debug log entry, as it's expected
that we'll start missing frames e.g. when a X11 window (via Xwayland) is
exclusively within a stage view that was not painted, while another one
was, still increasing the global frame clock.
Addititonally, this also requires the X11 window actor to schedule
timeouts for _NET_WM_FRAME_DRAWN/_NET_WM_FRAME_TIMINGS event emitting,
if the actor wasn't on any stage views, as now we'll only get the frame
callbacks on actors when they actually were painted, while in the past,
we'd invoke that vfunc when anything was painted.
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/903
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1285
2020-05-30 00:27:56 +02:00
|
|
|
void clutter_stage_emit_before_paint (ClutterStage *stage,
|
2022-10-13 17:50:34 +02:00
|
|
|
ClutterStageView *view,
|
|
|
|
ClutterFrame *frame);
|
clutter: Paint views with individual frame clocks
Replace the default master clock with multiple frame clocks, each
driving its own stage view. As each stage view represents one CRTC, this
means we draw each CRTC with its own designated frame clock,
disconnected from all the others.
For example this means we when using the native backend will never need
to wait for one monitor to vsync before painting another, so e.g. having
a 144 Hz monitor next to a 60 Hz monitor, things including both Wayland
and X11 applications and shell UI will be able to render at the
corresponding monitor refresh rate.
This also changes a warning about missed frames when sending
_NETWM_FRAME_TIMINGS messages to a debug log entry, as it's expected
that we'll start missing frames e.g. when a X11 window (via Xwayland) is
exclusively within a stage view that was not painted, while another one
was, still increasing the global frame clock.
Addititonally, this also requires the X11 window actor to schedule
timeouts for _NET_WM_FRAME_DRAWN/_NET_WM_FRAME_TIMINGS event emitting,
if the actor wasn't on any stage views, as now we'll only get the frame
callbacks on actors when they actually were painted, while in the past,
we'd invoke that vfunc when anything was painted.
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/903
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1285
2020-05-30 00:27:56 +02:00
|
|
|
void clutter_stage_emit_after_paint (ClutterStage *stage,
|
2022-10-13 17:50:34 +02:00
|
|
|
ClutterStageView *view,
|
|
|
|
ClutterFrame *frame);
|
2023-05-24 20:09:25 +02:00
|
|
|
void clutter_stage_after_update (ClutterStage *stage,
|
2022-10-13 17:50:34 +02:00
|
|
|
ClutterStageView *view,
|
|
|
|
ClutterFrame *frame);
|
2019-03-22 13:53:00 +01:00
|
|
|
|
|
|
|
CLUTTER_EXPORT
|
2010-10-21 11:29:09 +01:00
|
|
|
void _clutter_stage_set_window (ClutterStage *stage,
|
|
|
|
ClutterStageWindow *stage_window);
|
2019-03-22 13:53:00 +01:00
|
|
|
CLUTTER_EXPORT
|
2010-10-21 11:29:09 +01:00
|
|
|
ClutterStageWindow *_clutter_stage_get_window (ClutterStage *stage);
|
|
|
|
void _clutter_stage_get_projection_matrix (ClutterStage *stage,
|
2020-09-11 15:57:28 -03:00
|
|
|
graphene_matrix_t *projection);
|
2010-10-21 11:29:09 +01:00
|
|
|
void _clutter_stage_dirty_projection (ClutterStage *stage);
|
|
|
|
void _clutter_stage_get_viewport (ClutterStage *stage,
|
2011-02-01 16:51:58 +00:00
|
|
|
float *x,
|
|
|
|
float *y,
|
|
|
|
float *width,
|
|
|
|
float *height);
|
2010-10-21 11:29:09 +01:00
|
|
|
void _clutter_stage_dirty_viewport (ClutterStage *stage);
|
2021-05-10 16:16:15 +02:00
|
|
|
CLUTTER_EXPORT
|
Introduce regional stage rendering
Add support for drawing a stage using multiple framebuffers each making
up one part of the stage. This works by the stage backend
(ClutterStageWindow) providing a list of views which will be for
splitting up the stage in different regions.
A view layout, for now, is a set of rectangles. The stage window (i.e.
stage "backend" will use this information when drawing a frame, using
one framebuffer for each view. The scene graph is adapted to explictly
take a view when painting the stage. It will use this view, its
assigned framebuffer and layout to offset and clip the drawing
accordingly.
This effectively removes any notion of "stage framebuffer", since each
stage now may consist of multiple framebuffers. Therefore, API
involving this has been deprecated and made no-ops; namely
clutter_stage_ensure_context(). Callers are now assumed to either
always use a framebuffer reference explicitly, or push/pop the
framebuffer of a given view where the code has not yet changed to use
the explicit-buffer-using cogl API.
Currently only the nested X11 backend supports this mode fully, and the
per view framebuffers are all offscreen. Upon frame completion, it'll
blit each view's framebuffer onto the onscreen framebuffer before
swapping.
Other backends (X11 CM and native/KMS) are adapted to manage a
full-stage view. The X11 CM backend will continue to use this method,
while the native/KMS backend will be adopted to use multiple view
drawing.
https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-05-27 11:09:24 +08:00
|
|
|
void _clutter_stage_maybe_setup_viewport (ClutterStage *stage,
|
|
|
|
ClutterStageView *view);
|
2020-04-17 08:43:10 +02:00
|
|
|
void clutter_stage_maybe_relayout (ClutterActor *stage);
|
2022-01-26 18:39:27 +01:00
|
|
|
GSList * clutter_stage_find_updated_devices (ClutterStage *stage,
|
|
|
|
ClutterStageView *view);
|
2020-04-17 08:43:10 +02:00
|
|
|
void clutter_stage_update_devices (ClutterStage *stage,
|
|
|
|
GSList *devices);
|
2021-03-13 20:43:13 +01:00
|
|
|
void clutter_stage_finish_layout (ClutterStage *stage);
|
2010-10-21 11:29:09 +01:00
|
|
|
|
2019-03-22 13:53:00 +01:00
|
|
|
CLUTTER_EXPORT
|
2010-10-21 11:29:09 +01:00
|
|
|
void _clutter_stage_queue_event (ClutterStage *stage,
|
2013-11-11 18:16:32 +01:00
|
|
|
ClutterEvent *event,
|
|
|
|
gboolean copy_event);
|
2010-10-21 11:29:09 +01:00
|
|
|
gboolean _clutter_stage_has_queued_events (ClutterStage *stage);
|
|
|
|
void _clutter_stage_process_queued_events (ClutterStage *stage);
|
|
|
|
void _clutter_stage_update_input_devices (ClutterStage *stage);
|
|
|
|
gboolean _clutter_stage_has_full_redraw_queued (ClutterStage *stage);
|
2011-03-15 13:17:04 +00:00
|
|
|
|
2010-10-21 11:29:09 +01:00
|
|
|
ClutterPaintVolume *_clutter_stage_paint_volume_stack_allocate (ClutterStage *stage);
|
|
|
|
void _clutter_stage_paint_volume_stack_free_all (ClutterStage *stage);
|
|
|
|
|
2013-08-14 11:19:22 +01:00
|
|
|
void _clutter_stage_set_scale_factor (ClutterStage *stage,
|
|
|
|
int factor);
|
|
|
|
|
2020-05-29 23:02:20 +02:00
|
|
|
void clutter_stage_presented (ClutterStage *stage,
|
clutter: Paint views with individual frame clocks
Replace the default master clock with multiple frame clocks, each
driving its own stage view. As each stage view represents one CRTC, this
means we draw each CRTC with its own designated frame clock,
disconnected from all the others.
For example this means we when using the native backend will never need
to wait for one monitor to vsync before painting another, so e.g. having
a 144 Hz monitor next to a 60 Hz monitor, things including both Wayland
and X11 applications and shell UI will be able to render at the
corresponding monitor refresh rate.
This also changes a warning about missed frames when sending
_NETWM_FRAME_TIMINGS messages to a debug log entry, as it's expected
that we'll start missing frames e.g. when a X11 window (via Xwayland) is
exclusively within a stage view that was not painted, while another one
was, still increasing the global frame clock.
Addititonally, this also requires the X11 window actor to schedule
timeouts for _NET_WM_FRAME_DRAWN/_NET_WM_FRAME_TIMINGS event emitting,
if the actor wasn't on any stage views, as now we'll only get the frame
callbacks on actors when they actually were painted, while in the past,
we'd invoke that vfunc when anything was painted.
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/903
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1285
2020-05-30 00:27:56 +02:00
|
|
|
ClutterStageView *view,
|
2016-06-08 13:07:09 +08:00
|
|
|
ClutterFrameInfo *frame_info);
|
|
|
|
|
2019-05-07 13:02:55 +08:00
|
|
|
void clutter_stage_queue_actor_relayout (ClutterStage *stage,
|
|
|
|
ClutterActor *actor);
|
|
|
|
|
clutter/actor: Remove actors from shallow relayout list when unrealizing
With the introduction of the shallow relayout mechanism another small
but severe regression sneaked into our layout machinery: We might
allocate an actor twice during the same allocation cycle, with one
allocation happening using the wrong parent.
This issue happens when reparenting an actor from a NO_LAYOUT parent to
a non-NO_LAYOUT parent, in particular it triggered a bug in gnome-shell
when DND reparents a child from the NO_LAYOUT uiGroup to the overviews
Workspace actor after a drag ended. The reason the issue happens is the
following chain of events:
1. child of a NO_LAYOUT parent queues a relayout, this child is added to
the priv->pending_relayouts list maintained by ClutterStage
2. child is reparented to a different parent which doesn't have the
NO_LAYOUT flag set, another relayout is queued, this time a different
actor is added to the priv->pending_relayouts list
3. the relayout happens and we go through the pending_relayouts list
backwards, that means the correct relayout queued during 2. happens
first, then the old one happens and we simply call
clutter_actor_allocate_preferred_size() on the actor, that allocation
overrides the other, correct one.
So fix that issue by adding a method to ClutterStage which removes
actors from the pending_relayouts list again and call this method as
soon as an actor with a NO_LAYOUT parent is detached from the stage.
With that in place, we can also remove the check whether an actor is
still on stage while looping through pending_relayouts. In case
something else is going wrong and the actor is not on stage,
clutter_actor_allocate() will warn anyway.
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1356
2020-07-06 15:35:14 +02:00
|
|
|
void clutter_stage_dequeue_actor_relayout (ClutterStage *stage,
|
|
|
|
ClutterActor *actor);
|
|
|
|
|
2020-04-10 00:39:07 +02:00
|
|
|
GList * clutter_stage_get_views_for_rect (ClutterStage *stage,
|
|
|
|
const graphene_rect_t *rect);
|
|
|
|
|
2020-04-10 14:54:11 +02:00
|
|
|
void clutter_stage_set_actor_needs_immediate_relayout (ClutterStage *stage);
|
|
|
|
|
2020-10-15 16:39:00 +02:00
|
|
|
void clutter_stage_update_device_entry (ClutterStage *self,
|
|
|
|
ClutterInputDevice *device,
|
|
|
|
ClutterEventSequence *sequence,
|
|
|
|
graphene_point_t coords,
|
2021-07-05 17:23:21 +02:00
|
|
|
ClutterActor *actor,
|
|
|
|
cairo_region_t *clear_area);
|
2020-10-15 16:39:00 +02:00
|
|
|
|
|
|
|
void clutter_stage_remove_device_entry (ClutterStage *self,
|
|
|
|
ClutterInputDevice *device,
|
|
|
|
ClutterEventSequence *sequence);
|
2021-06-25 19:50:26 +02:00
|
|
|
ClutterActor * clutter_stage_pick_and_update_device (ClutterStage *stage,
|
|
|
|
ClutterInputDevice *device,
|
|
|
|
ClutterEventSequence *sequence,
|
2023-02-01 17:37:59 +01:00
|
|
|
ClutterInputDevice *source_device,
|
2021-06-25 19:50:26 +02:00
|
|
|
ClutterDeviceUpdateFlags flags,
|
|
|
|
graphene_point_t point,
|
|
|
|
uint32_t time_ms);
|
2020-10-15 16:39:00 +02:00
|
|
|
|
2021-10-28 14:04:58 +02:00
|
|
|
void clutter_stage_unlink_grab (ClutterStage *self,
|
|
|
|
ClutterGrab *grab);
|
|
|
|
|
2022-03-09 15:53:11 +01:00
|
|
|
void clutter_stage_invalidate_focus (ClutterStage *self,
|
|
|
|
ClutterActor *actor);
|
|
|
|
|
2022-07-26 13:53:21 +02:00
|
|
|
void clutter_stage_maybe_invalidate_focus (ClutterStage *self,
|
|
|
|
ClutterActor *actor);
|
|
|
|
|
2022-04-04 00:07:44 +02:00
|
|
|
void clutter_stage_emit_event (ClutterStage *self,
|
|
|
|
const ClutterEvent *event);
|
|
|
|
|
2022-08-03 17:57:13 +02:00
|
|
|
void clutter_stage_maybe_lost_implicit_grab (ClutterStage *self,
|
|
|
|
ClutterInputDevice *device,
|
|
|
|
ClutterEventSequence *sequence);
|
|
|
|
|
|
|
|
void clutter_stage_implicit_grab_actor_unmapped (ClutterStage *self,
|
|
|
|
ClutterActor *actor);
|
|
|
|
|
2022-11-18 15:40:10 +01:00
|
|
|
CLUTTER_EXPORT_TEST
|
2022-04-08 20:37:59 +02:00
|
|
|
void clutter_stage_notify_action_implicit_grab (ClutterStage *self,
|
|
|
|
ClutterInputDevice *device,
|
|
|
|
ClutterEventSequence *sequence);
|
|
|
|
|
2022-10-17 17:18:27 +02:00
|
|
|
void clutter_stage_add_to_redraw_clip (ClutterStage *self,
|
|
|
|
ClutterPaintVolume *clip);
|
|
|
|
|
2022-04-07 12:10:13 +02:00
|
|
|
CLUTTER_EXPORT
|
|
|
|
ClutterGrab * clutter_stage_grab_input_only (ClutterStage *self,
|
|
|
|
ClutterEventHandler handler,
|
|
|
|
gpointer user_data,
|
|
|
|
GDestroyNotify user_data_destroy);
|
|
|
|
|
2010-10-21 11:29:09 +01:00
|
|
|
G_END_DECLS
|