After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 734869 - gimp_test_utils_synthesize_key_event() broken for win32
gimp_test_utils_synthesize_key_event() broken for win32
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: General
git master
Other Windows
: Normal normal
: 2.10
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2014-08-15 16:05 UTC by Jehan
Modified: 2014-08-15 21:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix gimp_test_utils_synthesize_key_event() (3.68 KB, patch)
2014-08-15 16:05 UTC, Jehan
none Details | Review

Description Jehan 2014-08-15 16:05:03 UTC
Created attachment 283527 [details] [review]
Fix gimp_test_utils_synthesize_key_event()

2 tests were failing for win32: crop_tool_can_crop() in app/tests/test-tools.c and keyboard_zoom_focus() in app/tests/test-ui.c. gimp_test_utils_synthesize_key_event() was at fault, in particular because here is gdk_test_simulate_key() implementation for win32:

gboolean
gdk_test_simulate_key (GdkWindow      *window,
                       gint            x,
                       gint            y,
                       guint           keyval,
                       GdkModifierType modifiers,
                       GdkEventType    key_pressrelease)
{
  g_return_val_if_fail (key_pressrelease == GDK_KEY_PRESS || key_pressrelease == GDK_KEY_RELEASE, FALSE);
  g_return_val_if_fail (window != NULL, FALSE);
  return FALSE;
}

Basically it does nothing.
I wrote down an alternative win32 implementation, I'll also send a patch for GTK+, but for the time being, let's have a copy of the working implementation in GIMP code too.
With this patch, both failing tests are now working.
Comment 1 Jehan 2014-08-15 18:11:53 UTC
The proposed patch for GTK+ is at bug 734879.
Comment 2 Jehan 2014-08-15 21:17:44 UTC
commit 2b64efc11d50e2d714827205cba13cdd9af32eea
Author: Jehan <jehan@girinstud.io>
Date:   Fri Aug 15 16:35:57 2014 +0000

    tests: gimp_test_utils_synthesize_key_event() not working for win32.
    
    gdk_test_simulate_key() has currently no win32 implementation.
    Add this implementation in our code until a patch to GTK+ for this is
    merged. This fixes 2 `make check` tests for win32.