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 751721 - No release event for shift key when both shift keys were pressed
No release event for shift key when both shift keys were pressed
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Win32
unspecified
Other Windows
: Normal normal
: ---
Assigned To: gtk-win32 maintainers
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2015-06-30 12:59 UTC by Pavel Grunt
Modified: 2015-07-23 16:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
simple app for logging key release event (945 bytes, text/plain)
2015-06-30 12:59 UTC, Pavel Grunt
  Details
gdk-win32: Send fake release key event for shift key (2.23 KB, patch)
2015-07-01 13:58 UTC, Pavel Grunt
none Details | Review
gdk-win32: Send fake release key event for shift key (2.64 KB, patch)
2015-07-23 10:00 UTC, Pavel Grunt
committed Details | Review

Description Pavel Grunt 2015-06-30 12:59:43 UTC
Created attachment 306398 [details]
simple app for logging key release event

On Windows there is no "key-release-event" when both shift keys were pressed and only one is released.

Steps to reproduce:
1. Press right shift
2. Press left shift
3. Release right shift

Actual result:
no "key-release-event"

Expected result:
"key-release-event" for the right shift
Comment 1 Pavel Grunt 2015-07-01 13:58:56 UTC
Created attachment 306513 [details] [review]
gdk-win32: Send fake release key event for shift key

Windows does not send any release key event for one of the shift keys
when both shift keys were pressed together. This commit solves
the problem by sending the extra release key event for the shift key
which was released as first, when the other shift key is released.
Comment 2 Pavel Grunt 2015-07-01 14:08:15 UTC
About the use case - in spice-gtk the shift key remains stucked if the release key event is "missing".

https://bugs.freedesktop.org/show_bug.cgi?id=77259
https://bugzilla.redhat.com/show_bug.cgi?id=1169286
Comment 3 Pavel Grunt 2015-07-23 10:00:00 UTC
Created attachment 307977 [details] [review]
gdk-win32: Send fake release key event for shift key

Windows does not send any release key event for one of the shift keys
when both shift keys were pressed together. This commit solves
the problem by sending the extra release key event for the shift key
which was released as first, when the other shift key is released.

Other modifiers (e.g. Ctrl, Alt) do not have this problem.

v2: added comment explaining the fix
Comment 4 Matthias Clasen 2015-07-23 12:14:25 UTC
Review of attachment 307977 [details] [review]:

thanks for adding the comment
Comment 5 Fabiano Fidêncio 2015-07-23 15:54:26 UTC
Pushed as 44608dadc67749df15525b8386f95ad39e48c5ef (3.17.6+)!
Comment 6 Fabiano Fidêncio 2015-07-23 16:05:52 UTC
And as bb9401f35a873167a1fa91f1913937fbd5ceac30 (3.16.7+)!