keybindings: Move grab/freeze functions per backend

By making those functions virtual functions of MetaBackend
and have the BackendNative implementation no op

Helps https://gitlab.gnome.org/GNOME/mutter/-/issues/2272

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3583>
This commit is contained in:
Bilal Elmoussaoui
2022-06-20 10:24:49 +02:00
committed by Marge Bot
parent 868fbe622b
commit bd1ca76168
6 changed files with 123 additions and 118 deletions

View File

@ -647,6 +647,36 @@ meta_backend_real_is_headless (MetaBackend *backend)
return FALSE;
}
void
meta_backend_freeze_keyboard (MetaBackend *backend,
uint32_t timestamp)
{
g_return_if_fail (META_IS_BACKEND (backend));
if (META_BACKEND_GET_CLASS (backend)->freeze_keyboard)
META_BACKEND_GET_CLASS (backend)->freeze_keyboard (backend, timestamp);
}
void
meta_backend_unfreeze_keyboard (MetaBackend *backend,
uint32_t timestamp)
{
g_return_if_fail (META_IS_BACKEND (backend));
if (META_BACKEND_GET_CLASS (backend)->unfreeze_keyboard)
META_BACKEND_GET_CLASS (backend)->unfreeze_keyboard (backend, timestamp);
}
void
meta_backend_ungrab_keyboard (MetaBackend *backend,
uint32_t timestamp)
{
g_return_if_fail (META_IS_BACKEND (backend));
if (META_BACKEND_GET_CLASS (backend)->ungrab_keyboard)
META_BACKEND_GET_CLASS (backend)->ungrab_keyboard (backend, timestamp);
}
gboolean
meta_backend_is_lid_closed (MetaBackend *backend)
{