mirror of
https://github.com/brl/mutter.git
synced 2025-01-13 13:12:28 +00:00
Make VT switch API explicitly part of the native backend
It already was, more or less, but make it a bit more in your face. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2718>
This commit is contained in:
parent
872420f460
commit
c45ab10c0e
@ -916,13 +916,13 @@ meta_backend_native_get_kms (MetaBackendNative *native)
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_activate_vt (int vt, GError **error)
|
||||
meta_backend_native_activate_vt (MetaBackendNative *backend_native,
|
||||
int vt,
|
||||
GError **error)
|
||||
{
|
||||
MetaBackend *backend = meta_get_backend ();
|
||||
MetaBackendNative *native = META_BACKEND_NATIVE (backend);
|
||||
MetaLauncher *launcher = meta_backend_native_get_launcher (native);
|
||||
MetaLauncher *launcher = meta_backend_native_get_launcher (backend_native);
|
||||
|
||||
switch (native->mode)
|
||||
switch (backend_native->mode)
|
||||
{
|
||||
case META_BACKEND_NATIVE_MODE_DEFAULT:
|
||||
return meta_launcher_activate_vt (launcher, vt, error);
|
||||
|
@ -38,7 +38,9 @@ META_EXPORT_TEST
|
||||
G_DECLARE_FINAL_TYPE (MetaBackendNative, meta_backend_native,
|
||||
META, BACKEND_NATIVE, MetaBackend)
|
||||
|
||||
gboolean meta_activate_vt (int vt, GError **error);
|
||||
gboolean meta_backend_native_activate_vt (MetaBackendNative *backend_native,
|
||||
int vt,
|
||||
GError **error);
|
||||
|
||||
void meta_backend_native_pause (MetaBackendNative *backend_native);
|
||||
|
||||
|
@ -3573,10 +3573,13 @@ handle_switch_vt (MetaDisplay *display,
|
||||
MetaKeyBinding *binding,
|
||||
gpointer dummy)
|
||||
{
|
||||
MetaContext *context = meta_display_get_context (display);
|
||||
MetaBackend *backend = meta_context_get_backend (context);
|
||||
gint vt = binding->handler->data;
|
||||
GError *error = NULL;
|
||||
|
||||
if (!meta_activate_vt (vt, &error))
|
||||
if (!meta_backend_native_activate_vt (META_BACKEND_NATIVE (backend),
|
||||
vt, &error))
|
||||
{
|
||||
g_warning ("Failed to switch VT: %s", error->message);
|
||||
g_error_free (error);
|
||||
|
Loading…
Reference in New Issue
Block a user