mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-11-11 00:33:48 +01:00
only handle button 1
This commit is contained in:
parent
427b8eb51c
commit
4d00333fe8
@ -423,6 +423,9 @@ cb_zathura_page_widget_button_press_event(GtkWidget* widget, GdkEventButton* but
|
|||||||
{
|
{
|
||||||
g_return_val_if_fail(widget != NULL, false);
|
g_return_val_if_fail(widget != NULL, false);
|
||||||
g_return_val_if_fail(button != NULL, false);
|
g_return_val_if_fail(button != NULL, false);
|
||||||
|
if (button->button != 1) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
zathura_page_widget_private_t* priv = ZATHURA_PAGE_GET_PRIVATE(widget);
|
zathura_page_widget_private_t* priv = ZATHURA_PAGE_GET_PRIVATE(widget);
|
||||||
|
|
||||||
@ -447,12 +450,12 @@ cb_zathura_page_widget_button_release_event(GtkWidget* widget, GdkEventButton* b
|
|||||||
{
|
{
|
||||||
g_return_val_if_fail(widget != NULL, false);
|
g_return_val_if_fail(widget != NULL, false);
|
||||||
g_return_val_if_fail(button != NULL, false);
|
g_return_val_if_fail(button != NULL, false);
|
||||||
|
if (button->type != GDK_BUTTON_RELEASE || button->button != 1) {
|
||||||
zathura_page_widget_private_t* priv = ZATHURA_PAGE_GET_PRIVATE(widget);
|
|
||||||
if (button->type != GDK_BUTTON_RELEASE) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
zathura_page_widget_private_t* priv = ZATHURA_PAGE_GET_PRIVATE(widget);
|
||||||
|
|
||||||
if (priv->selection.y2 == -1 && priv->selection.x2 == -1 ) {
|
if (priv->selection.y2 == -1 && priv->selection.x2 == -1 ) {
|
||||||
/* simple single click */
|
/* simple single click */
|
||||||
/* get links */
|
/* get links */
|
||||||
@ -470,10 +473,10 @@ cb_zathura_page_widget_button_release_event(GtkWidget* widget, GdkEventButton* b
|
|||||||
switch (link->type) {
|
switch (link->type) {
|
||||||
case ZATHURA_LINK_TO_PAGE:
|
case ZATHURA_LINK_TO_PAGE:
|
||||||
page_set_delayed(priv->page->document->zathura, link->target.page_number);
|
page_set_delayed(priv->page->document->zathura, link->target.page_number);
|
||||||
return true;
|
return false;
|
||||||
case ZATHURA_LINK_EXTERNAL:
|
case ZATHURA_LINK_EXTERNAL:
|
||||||
girara_xdg_open(link->target.value);
|
girara_xdg_open(link->target.value);
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
GIRARA_LIST_FOREACH_END(priv->links, zathura_link_t*, iter, link);
|
GIRARA_LIST_FOREACH_END(priv->links, zathura_link_t*, iter, link);
|
||||||
|
Loading…
Reference in New Issue
Block a user