diff --git a/src/application.c b/src/application.c index 77387e6..3c4203f 100644 --- a/src/application.c +++ b/src/application.c @@ -208,6 +208,8 @@ static void keypress_handler(GtkWidget *widget, GdkEventKey *event, switch_mode_to_arrow(state); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(state->popover->arrow), true); + } else if (event->keyval == GDK_KEY_c && event->state & GDK_CONTROL_MASK) { + clipboard_copy_drawing_area_to_selection(state); } } diff --git a/src/clipboard.c b/src/clipboard.c index 9555a23..8de7d50 100644 --- a/src/clipboard.c +++ b/src/clipboard.c @@ -1,5 +1,7 @@ #include "clipboard.h" +#include "notification.h" + bool clipboard_copy_drawing_area_to_selection(struct swappy_state *state) { g_debug("generating pixbuf from area"); GtkClipboard *clipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD); @@ -10,5 +12,9 @@ bool clipboard_copy_drawing_area_to_selection(struct swappy_state *state) { gtk_clipboard_set_image(clipboard, pixbuf); + char message[MAX_PATH]; + snprintf(message, MAX_PATH, "Swappshot copied to clipboard\n"); + notification_send("Swappy", message); + return true; } \ No newline at end of file