summaryrefslogtreecommitdiff
path: root/src/nautilus-shortcut-manager.c
blob: f5cd8970942e83034b1772b51a22cd6d918dbeb6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
 * Copyright (C) 2024 GNOME Foundation Inc.
 *
 * SPDX-License-Identifier: GPL-3.0-or-later
 */


#include "nautilus-shortcut-manager.h"


/**
 * NautilusShortcutManager:
 *
 * A bin container to limit the scope of GTK_SHORTCUT_SCOPE_MANAGED shortcuts.
 *
 * The primary use case is to prevent keyboard shortcuts from being triggered
 * while `AdwDialog`s are presented. This assumes an implementation detail: that
 * `AdwDialog`s are internally children of `AdwWindow`/`AdwApplicationWindow`,
 * but not children of `AdwWindow:child`/`AdwApplicationWindow:child`.
 *
 * This is simply an AdwBin augmented with the GtkShortcutManager interface. The
 * default implementation of the interface is sufficient for the purpose.
 */
struct _NautilusShortcutManager
{
    AdwBin parent_instance;
};

static void
nautilus_shortcut_manager_interface_init (GtkShortcutManagerInterface *iface)
{
}

G_DEFINE_FINAL_TYPE_WITH_CODE (NautilusShortcutManager, nautilus_shortcut_manager, ADW_TYPE_BIN,
                               G_IMPLEMENT_INTERFACE (GTK_TYPE_SHORTCUT_MANAGER,
                                                      nautilus_shortcut_manager_interface_init))

static void
nautilus_shortcut_manager_class_init (NautilusShortcutManagerClass *klass)
{
}

static void
nautilus_shortcut_manager_init (NautilusShortcutManager *self)
{
}

NautilusShortcutManager *
nautilus_shortcut_manager_new (void)
{
    return g_object_new (NAUTILUS_TYPE_SHORTCUT_MANAGER, NULL);
}