2022-11-10 14:27:04 +00:00
|
|
|
/*
|
|
|
|
* Copyright © 2022 Red Hat, Inc.
|
|
|
|
*
|
|
|
|
* 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/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2023-04-01 14:09:38 +00:00
|
|
|
#include "gdkprivate-wayland.h"
|
|
|
|
|
2022-11-10 14:27:04 +00:00
|
|
|
typedef enum _PopupState
|
|
|
|
{
|
|
|
|
POPUP_STATE_IDLE,
|
|
|
|
POPUP_STATE_WAITING_FOR_REPOSITIONED,
|
|
|
|
POPUP_STATE_WAITING_FOR_CONFIGURE,
|
|
|
|
POPUP_STATE_WAITING_FOR_FRAME,
|
|
|
|
} PopupState;
|
|
|
|
|
|
|
|
struct _GdkWaylandSurface
|
|
|
|
{
|
|
|
|
GdkSurface parent_instance;
|
|
|
|
|
|
|
|
struct {
|
|
|
|
GSList *outputs;
|
|
|
|
struct wl_surface *wl_surface;
|
|
|
|
struct xdg_surface *xdg_surface;
|
|
|
|
struct zxdg_surface_v6 *zxdg_surface_v6;
|
|
|
|
struct wl_egl_window *egl_window;
|
2023-04-01 10:48:26 +00:00
|
|
|
struct wp_fractional_scale_v1 *fractional_scale;
|
2023-04-01 12:41:30 +00:00
|
|
|
struct wp_viewport *viewport;
|
2022-11-10 14:27:04 +00:00
|
|
|
} display_server;
|
|
|
|
|
|
|
|
struct wl_event_queue *event_queue;
|
2023-04-28 20:21:42 +00:00
|
|
|
struct wl_callback *frame_callback;
|
2022-11-10 14:27:04 +00:00
|
|
|
|
2024-03-05 23:21:37 +00:00
|
|
|
GdkWaylandPresentationTime *presentation_time;
|
|
|
|
|
2022-11-10 14:27:04 +00:00
|
|
|
unsigned int initial_configure_received : 1;
|
|
|
|
unsigned int has_uncommitted_ack_configure : 1;
|
2023-10-28 01:47:30 +00:00
|
|
|
unsigned int has_pending_subsurface_commits : 1;
|
2022-11-10 14:27:04 +00:00
|
|
|
unsigned int mapped : 1;
|
|
|
|
unsigned int awaiting_frame_frozen : 1;
|
|
|
|
|
|
|
|
int pending_buffer_offset_x;
|
|
|
|
int pending_buffer_offset_y;
|
|
|
|
|
|
|
|
gint64 pending_frame_counter;
|
2023-04-01 11:40:14 +00:00
|
|
|
GdkFractionalScale scale;
|
2023-04-01 14:09:38 +00:00
|
|
|
gboolean buffer_is_fractional;
|
2023-03-21 23:04:56 +00:00
|
|
|
gboolean buffer_scale_dirty;
|
2023-04-01 12:41:30 +00:00
|
|
|
gboolean viewport_dirty;
|
2022-11-10 14:27:04 +00:00
|
|
|
|
|
|
|
int shadow_left;
|
|
|
|
int shadow_right;
|
|
|
|
int shadow_top;
|
|
|
|
int shadow_bottom;
|
|
|
|
|
|
|
|
cairo_region_t *opaque_region;
|
|
|
|
gboolean opaque_region_dirty;
|
|
|
|
|
|
|
|
cairo_region_t *input_region;
|
|
|
|
gboolean input_region_dirty;
|
|
|
|
|
|
|
|
GdkRectangle last_sent_window_geometry;
|
|
|
|
|
|
|
|
struct {
|
|
|
|
gboolean is_initial_configure;
|
|
|
|
uint32_t serial;
|
|
|
|
gboolean is_dirty;
|
|
|
|
} pending;
|
|
|
|
|
|
|
|
struct {
|
|
|
|
int configured_width;
|
|
|
|
int configured_height;
|
|
|
|
gboolean surface_geometry_dirty;
|
|
|
|
} next_layout;
|
|
|
|
|
|
|
|
uint32_t last_configure_serial;
|
|
|
|
|
|
|
|
int state_freeze_count;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct _GdkWaylandSurfaceClass GdkWaylandSurfaceClass;
|
|
|
|
struct _GdkWaylandSurfaceClass
|
|
|
|
{
|
|
|
|
GdkSurfaceClass parent_class;
|
2023-01-06 21:35:16 +00:00
|
|
|
|
|
|
|
void (* handle_configure) (GdkWaylandSurface *surface);
|
|
|
|
|
|
|
|
void (* handle_frame) (GdkWaylandSurface *surface);
|
|
|
|
|
|
|
|
void (* hide_surface) (GdkWaylandSurface *surface);
|
2022-11-10 14:27:04 +00:00
|
|
|
};
|
|
|
|
|
2023-01-06 21:35:16 +00:00
|
|
|
#define GDK_WAYLAND_SURFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WAYLAND_SURFACE, GdkWaylandSurfaceClass))
|
|
|
|
|
|
|
|
#define GDK_WAYLAND_SURFACE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WAYLAND_SURFACE, GdkWaylandSurfaceClass))
|
|
|
|
|
2023-04-01 11:40:14 +00:00
|
|
|
void gdk_wayland_surface_update_size (GdkSurface *surface,
|
|
|
|
int32_t width,
|
|
|
|
int32_t height,
|
|
|
|
const GdkFractionalScale *scale);
|
2023-01-06 18:53:27 +00:00
|
|
|
void gdk_wayland_surface_create_xdg_surface_resources (GdkSurface *surface);
|
|
|
|
void _gdk_wayland_surface_save_size (GdkSurface *surface);
|
|
|
|
|
2022-11-17 13:24:40 +00:00
|
|
|
void gdk_wayland_surface_hide_surface (GdkSurface *surface);
|
|
|
|
void gdk_wayland_surface_move_resize (GdkSurface *surface,
|
|
|
|
int x,
|
|
|
|
int y,
|
|
|
|
int width,
|
|
|
|
int height);
|
|
|
|
void gdk_wayland_surface_get_window_geometry (GdkSurface *surface,
|
|
|
|
GdkRectangle *geometry);
|
|
|
|
void gdk_wayland_surface_freeze_state (GdkSurface *surface);
|
|
|
|
void gdk_wayland_surface_thaw_state (GdkSurface *surface);
|
|
|
|
|
2023-11-10 13:26:10 +00:00
|
|
|
void gdk_wayland_surface_frame_callback (GdkSurface *surface,
|
|
|
|
uint32_t time);
|
|
|
|
|
2022-11-10 14:27:04 +00:00
|
|
|
|
|
|
|
#define GDK_TYPE_WAYLAND_DRAG_SURFACE (gdk_wayland_drag_surface_get_type ())
|
|
|
|
GType gdk_wayland_drag_surface_get_type (void) G_GNUC_CONST;
|