summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pluma/pluma-view.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/pluma/pluma-view.c b/pluma/pluma-view.c
index 437d7017..9bf60985 100644
--- a/pluma/pluma-view.c
+++ b/pluma/pluma-view.c
@@ -56,7 +56,9 @@
#define PLUMA_VIEW_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), PLUMA_TYPE_VIEW, PlumaViewPrivate))
+/* Local variables */
static gboolean middledown = FALSE;
+static gboolean rightdown = FALSE;
typedef enum
{
@@ -1993,15 +1995,20 @@ show_line_numbers_menu (GtkWidget *view,
static gboolean
pluma_view_button_press_event (GtkWidget *widget, GdkEventButton *event)
{
- if ((event->button == 3) && (middledown))
+ if (((event->button == 3) && (middledown)) || ((event->button == 2) && (rightdown)))
{
middledown = FALSE;
+ rightdown = FALSE;
return TRUE;
}
else if (event->button == 2)
{
middledown = TRUE;
}
+ else if (event->button == 3)
+ {
+ rightdown = TRUE;
+ }
if ((event->type == GDK_BUTTON_PRESS) &&
(event->window == gtk_text_view_get_window (GTK_TEXT_VIEW (widget),
@@ -2027,9 +2034,9 @@ static gboolean
pluma_view_button_release_event (GtkWidget *widget, GdkEventButton *event)
{
if (event->button == 2)
- {
middledown = FALSE;
- }
+ else if (event->button == 3)
+ rightdown = FALSE;
return GTK_WIDGET_CLASS (pluma_view_parent_class)->button_release_event (widget, event);
}