Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
pwmt
zathura
Commits
5780a992
Commit
5780a992
authored
Dec 08, 2014
by
Sebastian Ramacher
Browse files
Print target selection
Signed-off-by:
Sebastian Ramacher
<
sebastian+dev@ramacher.at
>
parent
50ec6192
Changes
2
Hide whitespace changes
Inline
Side-by-side
zathura/callbacks.c
View file @
5780a992
...
...
@@ -580,9 +580,13 @@ cb_page_widget_text_selected(ZathuraPage* page, const char* text, void* data)
girara_setting_get
(
zathura
->
ui
.
session
,
"selection-notification"
,
&
notification
);
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
);
...
...
zathura/utils.c
View file @
5780a992
...
...
@@ -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
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment