diff --git a/src/main.c b/src/main.c index 51c39ea..a7e92a0 100644 --- a/src/main.c +++ b/src/main.c @@ -1395,7 +1395,12 @@ activate(GtkApplication *app, gpointer data) create_simple_action(app, "quit", G_CALLBACK(run_quit_action)); // Setup shortcuts - const char *capture_accels[] = { "space", NULL }; + const char *capture_accels[] = { + "space", + "AudioLowerVolume", + "AudioRaiseVolume", + NULL + }; gtk_application_set_accels_for_action(app, "app.capture", capture_accels); const char *quit_accels[] = { "q", "w", NULL }; @@ -1496,6 +1501,12 @@ activate(GtkApplication *app, gpointer data) gtk_application_add_window(app, GTK_WINDOW(window)); gtk_widget_set_visible(window, true); + + // Inhibit system shortcuts to be able to use + // VolumeUp and VolumeDown hardware buttons to take a picture + GtkNative *native = gtk_widget_get_native (GTK_WIDGET (window)); + GdkSurface *surface = gtk_native_get_surface (native); + gdk_toplevel_inhibit_system_shortcuts (GDK_TOPLEVEL (surface), NULL); } static void