Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ udev_req = '>= 228'
gudev_req = '>= 232'

# wayland version requirements
wayland_server_req = '>= 1.20'
wayland_server_req = '>= 1.24'
wayland_protocols_req = '>= 1.36'

# native backend version requirements
Expand Down
2 changes: 2 additions & 0 deletions src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,8 @@ if have_wayland
'wayland/meta-wayland-dma-buf.h',
'wayland/meta-wayland-dnd-surface.c',
'wayland/meta-wayland-dnd-surface.h',
'wayland/meta-wayland-fixes.c',
'wayland/meta-wayland-fixes.h',
'wayland/meta-wayland-gtk-shell.c',
'wayland/meta-wayland-gtk-shell.h',
'wayland/meta-wayland.h',
Expand Down
70 changes: 70 additions & 0 deletions src/wayland/meta-wayland-fixes.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/*
* Copyright (C) 2024 Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program 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
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/

#include "config.h"

#include "wayland/meta-wayland-fixes.h"

#include "wayland/meta-wayland-private.h"
#include "wayland/meta-wayland-versions.h"

static void
wl_fixes_destroy (struct wl_client *client,
struct wl_resource *resource)
{
wl_resource_destroy (resource);
}

static void
wl_fixes_destroy_registry (struct wl_client *client,
struct wl_resource *resource,
struct wl_resource *registry_resource)
{
wl_resource_destroy (registry_resource);
}

static const struct wl_fixes_interface meta_wayland_fixes_interface = {
wl_fixes_destroy,
wl_fixes_destroy_registry,
};

static void
bind_wl_fixes (struct wl_client *client,
void *data,
uint32_t version,
uint32_t id)
{
MetaWaylandCompositor *compositor = data;
struct wl_resource *resource;

resource = wl_resource_create (client, &wl_fixes_interface, version, id);
wl_resource_set_implementation (resource,
&meta_wayland_fixes_interface,
compositor,
NULL);
}

void
meta_wayland_init_fixes (MetaWaylandCompositor *compositor)
{
if (wl_global_create (compositor->wayland_display,
&wl_fixes_interface,
META_WL_FIXES_VERSION,
compositor,
bind_wl_fixes) == NULL)
g_error ("Failed to register a global wl_fixes object");
}
22 changes: 22 additions & 0 deletions src/wayland/meta-wayland-fixes.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright (C) 2024 Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program 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
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/

#pragma once

#include "wayland/meta-wayland.h"

void meta_wayland_init_fixes (MetaWaylandCompositor *compositor);
1 change: 1 addition & 0 deletions src/wayland/meta-wayland-versions.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
#define META_ZWP_XWAYLAND_KEYBOARD_GRAB_V1_VERSION 1
#define META_ZWP_TEXT_INPUT_V3_VERSION 1
#define META_WP_VIEWPORTER_VERSION 1
#define META_WL_FIXES_VERSION 1
#define META_XDG_ACTIVATION_V1_VERSION 1
#define META_XDG_DIALOG_VERSION 1
#define META_ZWP_PRIMARY_SELECTION_V1_VERSION 1
Expand Down
2 changes: 2 additions & 0 deletions src/wayland/meta-wayland.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include "wayland/meta-wayland-data-device.h"
#include "wayland/meta-wayland-dma-buf.h"
#include "wayland/meta-wayland-egl-stream.h"
#include "wayland/meta-wayland-fixes.h"
#include "wayland/meta-wayland-inhibit-shortcuts-dialog.h"
#include "wayland/meta-wayland-inhibit-shortcuts.h"
#include "wayland/meta-wayland-legacy-xdg-foreign.h"
Expand Down Expand Up @@ -440,6 +441,7 @@ meta_wayland_compositor_setup (MetaWaylandCompositor *wayland_compositor)
meta_wayland_keyboard_shortcuts_inhibit_init (compositor);
meta_wayland_surface_inhibit_shortcuts_dialog_init ();
meta_wayland_text_input_init (compositor);
meta_wayland_init_fixes (compositor);
meta_wayland_activation_init (compositor);
meta_wayland_init_xdg_wm_dialog (compositor);

Expand Down
Loading