[perl-Gtk3] Fix handling of 2button-press and 3button-press events



commit baddfa6b4672a7f23c33a4f32b1101875da18ae8
Author: Torsten Schönfeld <kaffeetisch gmx de>
Date:   Sat Jan 17 15:18:27 2015 +0100

    Fix handling of 2button-press and 3button-press events
    
    Previously these kinds of events were not properly converted to
    Gtk3::Gdk::EventButton objects.

 NEWS            |    2 ++
 lib/Gtk3.pm     |    4 ++--
 t/zz-GdkEvent.t |    8 +++++---
 3 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/NEWS b/NEWS
index a741f73..6f04275 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,7 @@
 {{$NEXT}}
 
+* Fix handling of 2button-press and 3button-press events
+
 Overview of changes in Gtk3 0.020 [2014-12-25]
 ==============================================
 
diff --git a/lib/Gtk3.pm b/lib/Gtk3.pm
index 4ad94ca..ca6b01b 100644
--- a/lib/Gtk3.pm
+++ b/lib/Gtk3.pm
@@ -151,8 +151,8 @@ my %_GDK_EVENT_TYPE_TO_PACKAGE = (
   'expose' => 'Expose',
   'motion-notify' => 'Motion',
   'button-press' => 'Button',
-  'button-2press' => 'Button',
-  'button-3press' => 'Button',
+  '2button-press' => 'Button',
+  '3button-press' => 'Button',
   'button-release' => 'Button',
   'key-press' => 'Key',
   'key-release' => 'Key',
diff --git a/t/zz-GdkEvent.t b/t/zz-GdkEvent.t
index 320d321..4460038 100644
--- a/t/zz-GdkEvent.t
+++ b/t/zz-GdkEvent.t
@@ -7,7 +7,7 @@ BEGIN { require './t/inc/setup.pl' }
 use strict;
 use warnings;
 
-plan tests => 142;
+plan tests => 144;
 
 sub fields_ok {
   my ($event, %fields_values) = @_;
@@ -119,8 +119,10 @@ SKIP: {
 
 # Button #######################################################################
 
-isa_ok ($event = Gtk3::Gdk::Event->new ('button-press'),
-       'Gtk3::Gdk::EventButton', 'Gtk3::Gdk::Event->new button');
+foreach (qw/3button-press 2button-press button-press/) {
+  isa_ok ($event = Gtk3::Gdk::Event->new ($_),
+          'Gtk3::Gdk::EventButton', "Gtk3::Gdk::Event->new $_");
+}
 
 fields_ok ($event, time => 42,
                    x => 13,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]