Commit a85decc8 authored by Sebastian Ramacher's avatar Sebastian Ramacher

Only copy selected text in normal and fullscreen mode

Signed-off-by: Sebastian Ramacher's avatarSebastian Ramacher <sebastian+dev@ramacher.at>
parent f2fbf926
......@@ -50,7 +50,8 @@ cb_buffer_changed(girara_session_t* session)
}
static void
update_visible_pages(zathura_t* zathura) {
update_visible_pages(zathura_t* zathura)
{
const unsigned int number_of_pages = zathura_document_get_number_of_pages(zathura->document);
for (unsigned int page_id = 0; page_id < number_of_pages; page_id++) {
......@@ -539,6 +540,11 @@ cb_page_widget_text_selected(ZathuraPage* page, const char* text, void* data)
g_return_if_fail(data != NULL);
zathura_t* zathura = data;
girara_mode_t mode = girara_mode_get(zathura->ui.session);
if (mode != zathura->modes.normal && mode != zathura->modes.fullscreen) {
return;
}
GdkAtom* selection = get_selection(zathura);
/* copy to clipboard */
......
......@@ -483,8 +483,8 @@ zathura_dbus_goto_page_and_highlight(const char* filename, unsigned int page,
}
GError* error = NULL;
GDBusConnection* connection = g_bus_get_sync(G_BUS_TYPE_SESSION,
NULL, &error);
GDBusConnection* connection = g_bus_get_sync(G_BUS_TYPE_SESSION, NULL,
&error);
if (connection == NULL) {
girara_error("Could not connect to session bus: %s", error->message);
g_error_free(error);
......
......@@ -1242,7 +1242,7 @@ sc_toggle_fullscreen(girara_session_t* session, girara_argument_t*
girara_mode_set(session, zathura->modes.fullscreen);
}
fullscreen = fullscreen ? false : true;
fullscreen = !fullscreen;
return false;
}
......@@ -1315,7 +1315,7 @@ sc_toggle_presentation(girara_session_t* session, girara_argument_t*
girara_mode_set(session, zathura->modes.presentation);
}
fullscreen = fullscreen ? false : true;
fullscreen = !fullscreen;
return false;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment