mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-11-11 00:53:48 +01:00
Print target selection
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This commit is contained in:
parent
50ec6192be
commit
5780a99291
@ -580,9 +580,13 @@ cb_page_widget_text_selected(ZathuraPage* page, const char* text, void* data)
|
||||
girara_setting_get(zathura->ui.session, "selection-notification", ¬ification);
|
||||
|
||||
if (notification == true) {
|
||||
char* target = NULL;
|
||||
girara_setting_get(zathura->ui.session, "selection-clipboard", &target);
|
||||
|
||||
char* stripped_text = g_strdelimit(g_strdup(text), "\n\t\r\n", ' ');
|
||||
char* escaped_text = g_markup_printf_escaped(
|
||||
_("Copied selected text to clipboard: %s"), stripped_text);
|
||||
_("Copied selected text to selection %s: %s"), target, stripped_text);
|
||||
g_free(target);
|
||||
g_free(stripped_text);
|
||||
|
||||
girara_notify(zathura->ui.session, GIRARA_INFO, "%s", escaped_text);
|
||||
|
@ -229,11 +229,15 @@ GdkAtom* get_selection(zathura_t* zathura)
|
||||
{
|
||||
g_return_val_if_fail(zathura != NULL, NULL);
|
||||
|
||||
char* value;
|
||||
char* value = NULL;
|
||||
girara_setting_get(zathura->ui.session, "selection-clipboard", &value);
|
||||
if (value == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
GdkAtom* selection = g_try_malloc(sizeof(GdkAtom));
|
||||
if (selection == NULL) {
|
||||
g_free(selection);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user