2010-12-18 20:38:49 +00:00
|
|
|
/*
|
|
|
|
* gdkdisplay-wayland.h
|
2015-02-28 03:28:28 +00:00
|
|
|
*
|
|
|
|
* Copyright 2001 Sun Microsystems Inc.
|
2010-12-18 20:38:49 +00:00
|
|
|
*
|
|
|
|
* Erwann Chenede <erwann.chenede@sun.com>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library 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
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
2012-02-27 13:01:10 +00:00
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
2010-12-18 20:38:49 +00:00
|
|
|
*/
|
|
|
|
|
2012-04-16 15:55:43 +00:00
|
|
|
#ifndef __GDK_WAYLAND_DISPLAY__
|
|
|
|
#define __GDK_WAYLAND_DISPLAY__
|
2010-12-18 20:38:49 +00:00
|
|
|
|
2017-11-25 13:22:12 +00:00
|
|
|
#include "config.h"
|
|
|
|
|
2010-12-18 20:38:49 +00:00
|
|
|
#include <stdint.h>
|
|
|
|
#include <wayland-client.h>
|
2014-10-09 09:06:48 +00:00
|
|
|
#include <wayland-egl.h>
|
2016-07-22 18:58:55 +00:00
|
|
|
#include <gdk/wayland/tablet-unstable-v2-client-protocol.h>
|
2013-09-03 21:48:30 +00:00
|
|
|
#include <gdk/wayland/gtk-shell-client-protocol.h>
|
2017-12-18 12:00:36 +00:00
|
|
|
#include <gdk/wayland/xdg-shell-client-protocol.h>
|
2016-07-01 09:03:36 +00:00
|
|
|
#include <gdk/wayland/xdg-shell-unstable-v6-client-protocol.h>
|
2016-07-12 03:49:39 +00:00
|
|
|
#include <gdk/wayland/xdg-foreign-unstable-v1-client-protocol.h>
|
2017-03-22 09:21:02 +00:00
|
|
|
#include <gdk/wayland/keyboard-shortcuts-inhibit-unstable-v1-client-protocol.h>
|
2017-04-29 00:35:51 +00:00
|
|
|
#include <gdk/wayland/server-decoration-client-protocol.h>
|
2019-04-15 14:42:45 +00:00
|
|
|
#include <gdk/wayland/xdg-output-unstable-v1-client-protocol.h>
|
2012-04-04 16:20:13 +00:00
|
|
|
|
2010-12-18 20:38:49 +00:00
|
|
|
#include <glib.h>
|
|
|
|
#include <gdk/gdkkeys.h>
|
2018-03-20 10:46:11 +00:00
|
|
|
#include <gdk/gdksurface.h>
|
2010-12-18 20:38:49 +00:00
|
|
|
#include <gdk/gdkinternals.h>
|
|
|
|
#include <gdk/gdk.h> /* For gdk_get_program_class() */
|
|
|
|
|
|
|
|
#include "gdkdisplayprivate.h"
|
2017-11-25 13:22:12 +00:00
|
|
|
#include "gdkwaylanddevice.h"
|
2020-01-24 18:33:13 +00:00
|
|
|
#include "cursor/wayland-cursor.h"
|
2010-12-18 20:38:49 +00:00
|
|
|
|
2014-10-09 09:06:48 +00:00
|
|
|
#include <epoxy/egl.h>
|
|
|
|
|
2010-12-18 20:38:49 +00:00
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2017-12-17 21:41:00 +00:00
|
|
|
#define GDK_WAYLAND_MAX_THEME_SCALE 3
|
2015-03-13 07:40:18 +00:00
|
|
|
#define GDK_WAYLAND_THEME_SCALES_COUNT GDK_WAYLAND_MAX_THEME_SCALE
|
|
|
|
|
2015-11-18 03:38:28 +00:00
|
|
|
#define GDK_ZWP_POINTER_GESTURES_V1_VERSION 1
|
2015-08-20 03:38:43 +00:00
|
|
|
|
2014-08-21 16:34:01 +00:00
|
|
|
typedef struct _GdkWaylandSelection GdkWaylandSelection;
|
|
|
|
|
2017-11-01 23:25:45 +00:00
|
|
|
typedef struct {
|
|
|
|
gboolean antialias;
|
|
|
|
gboolean hinting;
|
|
|
|
gint dpi;
|
|
|
|
const gchar *rgba;
|
|
|
|
const gchar *hintstyle;
|
|
|
|
} GsdXftSettings;
|
|
|
|
|
2017-12-18 12:00:36 +00:00
|
|
|
typedef enum _GdkWaylandShellVariant
|
|
|
|
{
|
|
|
|
GDK_WAYLAND_SHELL_VARIANT_XDG_SHELL,
|
|
|
|
GDK_WAYLAND_SHELL_VARIANT_ZXDG_SHELL_V6
|
|
|
|
} GdkWaylandShellVariant;
|
|
|
|
|
2012-04-16 15:55:43 +00:00
|
|
|
struct _GdkWaylandDisplay
|
2010-12-18 20:38:49 +00:00
|
|
|
{
|
|
|
|
GdkDisplay parent_instance;
|
2017-11-06 23:30:27 +00:00
|
|
|
GList *toplevels;
|
2017-11-01 23:25:45 +00:00
|
|
|
|
|
|
|
GHashTable *settings;
|
|
|
|
GsdXftSettings xft_settings;
|
2018-11-01 23:47:46 +00:00
|
|
|
GDBusProxy *settings_portal;
|
2017-11-01 23:25:45 +00:00
|
|
|
|
|
|
|
guint32 shell_capabilities;
|
2010-12-18 20:38:49 +00:00
|
|
|
|
|
|
|
/* Startup notification */
|
|
|
|
gchar *startup_notification_id;
|
|
|
|
|
2014-05-15 22:11:20 +00:00
|
|
|
/* Most recent serial */
|
2012-07-11 16:06:32 +00:00
|
|
|
guint32 serial;
|
2010-12-18 20:38:49 +00:00
|
|
|
|
2017-12-18 12:00:36 +00:00
|
|
|
uint32_t xdg_wm_base_id;
|
|
|
|
uint32_t zxdg_shell_v6_id;
|
|
|
|
GdkWaylandShellVariant shell_variant;
|
|
|
|
|
2010-12-18 20:38:49 +00:00
|
|
|
/* Wayland fields below */
|
|
|
|
struct wl_display *wl_display;
|
2012-10-17 02:38:41 +00:00
|
|
|
struct wl_registry *wl_registry;
|
2010-12-18 20:38:49 +00:00
|
|
|
struct wl_compositor *compositor;
|
2011-02-09 19:48:29 +00:00
|
|
|
struct wl_shm *shm;
|
2017-12-18 12:00:36 +00:00
|
|
|
struct xdg_wm_base *xdg_wm_base;
|
|
|
|
struct zxdg_shell_v6 *zxdg_shell_v6;
|
2016-03-07 03:49:35 +00:00
|
|
|
struct gtk_shell1 *gtk_shell;
|
2010-12-18 20:38:49 +00:00
|
|
|
struct wl_input_device *input_device;
|
2011-12-12 13:56:25 +00:00
|
|
|
struct wl_data_device_manager *data_device_manager;
|
2014-08-21 15:27:26 +00:00
|
|
|
struct wl_subcompositor *subcompositor;
|
2015-11-18 03:38:28 +00:00
|
|
|
struct zwp_pointer_gestures_v1 *pointer_gestures;
|
2016-02-04 16:33:51 +00:00
|
|
|
struct gtk_primary_selection_device_manager *primary_selection_manager;
|
2016-05-13 13:19:04 +00:00
|
|
|
struct zwp_tablet_manager_v2 *tablet_manager;
|
2016-07-12 03:49:39 +00:00
|
|
|
struct zxdg_exporter_v1 *xdg_exporter;
|
2016-07-13 07:24:19 +00:00
|
|
|
struct zxdg_importer_v1 *xdg_importer;
|
2017-03-22 09:21:02 +00:00
|
|
|
struct zwp_keyboard_shortcuts_inhibit_manager_v1 *keyboard_shortcuts_inhibit;
|
2017-04-29 00:35:51 +00:00
|
|
|
struct org_kde_kwin_server_decoration_manager *server_decoration_manager;
|
2019-04-15 14:42:45 +00:00
|
|
|
struct zxdg_output_manager_v1 *xdg_output_manager;
|
2012-07-11 13:18:28 +00:00
|
|
|
|
2015-05-18 08:02:45 +00:00
|
|
|
GList *async_roundtrips;
|
|
|
|
|
2015-05-18 06:55:08 +00:00
|
|
|
/* Keep track of the ID's of the known globals and their corresponding
|
|
|
|
* names. This way we can check whether an interface is known, and
|
|
|
|
* remove globals given its ID. This table is not expected to be very
|
|
|
|
* large, meaning the lookup by interface name time is insignificant. */
|
|
|
|
GHashTable *known_globals;
|
|
|
|
GList *on_has_globals_closures;
|
|
|
|
|
2020-01-07 16:13:22 +00:00
|
|
|
GList *event_queues;
|
|
|
|
|
2016-04-26 03:46:25 +00:00
|
|
|
/* Keep a list of orphaned dialogs (i.e. without parent) */
|
|
|
|
GList *orphan_dialogs;
|
|
|
|
|
2016-09-02 10:51:34 +00:00
|
|
|
GList *current_popups;
|
2020-02-16 15:24:12 +00:00
|
|
|
GList *current_grabbing_popups;
|
2016-09-02 10:51:34 +00:00
|
|
|
|
2020-01-24 18:33:13 +00:00
|
|
|
struct wl_cursor_theme *cursor_theme;
|
2015-03-13 07:40:18 +00:00
|
|
|
gchar *cursor_theme_name;
|
|
|
|
int cursor_theme_size;
|
2017-11-03 21:41:31 +00:00
|
|
|
GHashTable *cursor_surface_cache;
|
2012-07-11 13:18:28 +00:00
|
|
|
|
2010-12-18 20:38:49 +00:00
|
|
|
GSource *event_source;
|
2012-04-04 16:20:13 +00:00
|
|
|
|
2013-07-12 14:49:52 +00:00
|
|
|
int compositor_version;
|
2015-10-20 03:21:54 +00:00
|
|
|
int seat_version;
|
2016-01-13 20:00:34 +00:00
|
|
|
int data_device_manager_version;
|
2016-02-06 14:07:52 +00:00
|
|
|
int gtk_shell_version;
|
2019-06-20 14:55:58 +00:00
|
|
|
int xdg_output_manager_version;
|
2013-03-26 18:42:14 +00:00
|
|
|
|
2017-04-29 00:35:51 +00:00
|
|
|
uint32_t server_decoration_mode;
|
|
|
|
|
2012-07-16 11:33:35 +00:00
|
|
|
struct xkb_context *xkb_context;
|
2014-08-21 16:34:01 +00:00
|
|
|
|
2016-04-02 14:18:56 +00:00
|
|
|
GPtrArray *monitors;
|
|
|
|
|
2017-03-13 06:42:38 +00:00
|
|
|
gint64 last_bell_time_ms;
|
|
|
|
|
2014-10-09 09:06:48 +00:00
|
|
|
/* egl info */
|
|
|
|
EGLDisplay egl_display;
|
|
|
|
int egl_major_version;
|
|
|
|
int egl_minor_version;
|
|
|
|
|
|
|
|
guint have_egl : 1;
|
|
|
|
guint have_egl_khr_create_context : 1;
|
|
|
|
guint have_egl_buffer_age : 1;
|
|
|
|
guint have_egl_swap_buffers_with_damage : 1;
|
2014-10-09 14:09:05 +00:00
|
|
|
guint have_egl_surfaceless_context : 1;
|
2010-12-18 20:38:49 +00:00
|
|
|
};
|
|
|
|
|
2012-04-16 15:55:43 +00:00
|
|
|
struct _GdkWaylandDisplayClass
|
2010-12-18 20:38:49 +00:00
|
|
|
{
|
|
|
|
GdkDisplayClass parent_class;
|
|
|
|
};
|
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
|
2015-02-28 03:28:28 +00:00
|
|
|
#endif /* __GDK_WAYLAND_DISPLAY__ */
|