From 4253ff8e12dfb87272fd3b496fe500b66ab01266 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Fri, 13 Mar 2009 17:06:04 -0400 Subject: [PATCH] Add a "toggle_recording" keybinding Add a keybinding (defaulting to r) to record a screencast of the session. This isn't hooked up to anything in metacity itself, but a plugin can connect to a signal on MetaScreen. keybindings.c all-keybindings.h: Add the keybinding screen.c: Add a ::toggle-recording signal http://bugzilla.gnome.org/show_bug.cgi?id=575290 --- src/core/keybindings.c | 11 +++++++++++ src/core/screen.c | 10 ++++++++++ src/include/all-keybindings.h | 2 ++ 3 files changed, 23 insertions(+) diff --git a/src/core/keybindings.c b/src/core/keybindings.c index 6c1beadde..045cd7ebe 100644 --- a/src/core/keybindings.c +++ b/src/core/keybindings.c @@ -2853,6 +2853,17 @@ handle_panel (MetaDisplay *display, meta_error_trap_pop (display, FALSE); } +static void +handle_toggle_recording (MetaDisplay *display, + MetaScreen *screen, + MetaWindow *window, + XEvent *event, + MetaKeyBinding *binding, + gpointer dummy) +{ + g_signal_emit_by_name (screen, "toggle-recording"); +} + static void handle_activate_window_menu (MetaDisplay *display, MetaScreen *screen, diff --git a/src/core/screen.c b/src/core/screen.c index c48efb22c..6f1241a77 100644 --- a/src/core/screen.c +++ b/src/core/screen.c @@ -77,6 +77,7 @@ enum enum { RESTACKED, + TOGGLE_RECORDING, LAST_SIGNAL }; @@ -153,6 +154,15 @@ meta_screen_class_init (MetaScreenClass *klass) 1, G_MAXINT, 1, G_PARAM_READABLE); + screen_signals[TOGGLE_RECORDING] = + g_signal_new ("toggle-recording", + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, + 0, + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + g_object_class_install_property (object_class, PROP_N_WORKSPACES, pspec); diff --git a/src/include/all-keybindings.h b/src/include/all-keybindings.h index aa5095769..473377856 100644 --- a/src/include/all-keybindings.h +++ b/src/include/all-keybindings.h @@ -195,6 +195,8 @@ keybind (panel_main_menu, handle_panel, keybind (panel_run_dialog, handle_panel, META_KEYBINDING_ACTION_PANEL_RUN_DIALOG, 0, "F2", _("Show the panel's \"Run Application\" dialog box")) +keybind (toggle_recording, handle_toggle_recording, 0, 0, "r", + _("Start or stop recording the session")) /* Yes, the param is offset by one. Historical reasons. (Maybe worth fixing * at some point.) The description is NULL here because the stanza is