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 713240 - Console warning when using keyboard
Console warning when using keyboard
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Bindings: GTK+ GStreamer WebKitGTK+
0.23.x
Other All
: High normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2013-05-07 09:12 UTC by Eric Gregory
Modified: 2014-02-12 12:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fixed gdk-3.0.vapi (297.37 KB, text/plain)
2014-02-03 21:46 UTC, Jürg Billeter
Details
Fixed gdk-3.0.vapi (297.81 KB, text/x-vala)
2014-02-03 22:01 UTC, Jürg Billeter
Details

Description Charles Lindsay 2013-11-21 20:18:59 UTC


---- Reported by eric@yorba.org 2013-05-07 14:12:00 -0700 ----

Original Redmine bug id: 6913
Original URL: http://redmine.yorba.org/issues/6913
Searchable id: yorba-bug-6913
Original author: Eric Gregory
Original description:

When Geary first starts, pressing almost any key on the keyboard will result
in the following console warning:

    
    
    (geary:16185): Gdk-WARNING **: Event with type 8 not holding a GdkDevice. It is most likely synthesized outside Gdk/GTK+
    

The stack trace indicates this is coming from GdkEvent.

    
    
    g_logv (log_domain=0x7ffff50aa8c6 "Gdk", log_level=G_LOG_LEVEL_WARNING, format=<optimized out>, args=args@entry=0x7fffffffd1c8) at /build/buildd/glib2.0-2.36.0/./glib/gmessages.c:981
    981    /build/buildd/glib2.0-2.36.0/./glib/gmessages.c: No such file or directory.
    (gdb) bt
    #0  g_logv (log_domain=0x7ffff50aa8c6 "Gdk", log_level=G_LOG_LEVEL_WARNING, format=<optimized out>, args=args@entry=0x7fffffffd1c8) at /build/buildd/glib2.0-2.36.0/./glib/gmessages.c:981
    #1  0x00007ffff3bfe492 in g_log (log_domain=log_domain@entry=0x7ffff50aa8c6 "Gdk", log_level=log_level@entry=G_LOG_LEVEL_WARNING, 
        format=format@entry=0x7ffff50ad0d8 "Event with type %d not holding a GdkDevice. It is most likely synthesized outside Gdk/GTK+\n") at /build/buildd/glib2.0-2.36.0/./glib/gmessages.c:1010
    #2  0x00007ffff506a6f9 in gdk_event_get_device (event=event@entry=0x7fffffffd770) at /build/buildd/gtk+3.0-3.6.4/./gdk/gdkevents.c:1481
    #3  0x00007ffff5579fb5 in gtk_tree_view_key_press (widget=0xb60020, event=0x7fffffffd770) at /build/buildd/gtk+3.0-3.6.4/./gtk/gtktreeview.c:5880
    #4  0x00007ffff54615ac in _gtk_marshal_BOOLEAN__BOXEDv (closure=0x8c1840, return_value=0x7fffffffd470, instance=<optimized out>, args=<optimized out>, marshal_data=<optimized out>, n_params=<optimized out>, 
        param_types=0x8c10e0) at /build/buildd/gtk+3.0-3.6.4/./gtk/gtkmarshalers.c:130
    #5  0x00007ffff3eba8e7 in _g_closure_invoke_va (closure=0x8c1840, return_value=0x7fffffffd470, instance=0xb60020, args=0x7fffffffd638, n_params=1, param_types=0x8c10e0)
        at /build/buildd/glib2.0-2.36.0/./gobject/gclosure.c:840
    #6  0x00007ffff3ed32df in g_signal_emit_valist (instance=0xb60020, signal_id=<optimized out>, detail=0, var_args=var_args@entry=0x7fffffffd638) at /build/buildd/glib2.0-2.36.0/./gobject/gsignal.c:3234
    #7  0x00007ffff3ed3f92 in g_signal_emit (instance=instance@entry=0xb60020, signal_id=<optimized out>, detail=detail@entry=0) at /build/buildd/glib2.0-2.36.0/./gobject/gsignal.c:3384
    #8  0x00007ffff559077e in gtk_widget_event_internal (widget=widget@entry=0xb60020, event=event@entry=0x7fffffffd770) at /build/buildd/gtk+3.0-3.6.4/./gtk/gtkwidget.c:6303
    #9  0x00007ffff5590b99 in gtk_widget_event (widget=widget@entry=0xb60020, event=event@entry=0x7fffffffd770) at /build/buildd/gtk+3.0-3.6.4/./gtk/gtkwidget.c:5960
    #10 0x00007ffff55aa7a3 in gtk_window_propagate_key_event (window=0x90a2f0, event=event@entry=0x7fffffffd770) at /build/buildd/gtk+3.0-3.6.4/./gtk/gtkwindow.c:6091
    #11 0x00000000004a38cd in main_window_on_key_press_event (event=0xc199b0, self=0x90a2f0) at /home/eric/Development/geary2/src/client/ui/main-window.vala:150
    #12 _main_window_on_key_press_event_gtk_widget_key_press_event (_sender=_sender@entry=0x90a2f0, event=0xc199b0, self=self@entry=0x90a2f0) at main-window.c:588
    #13 0x00007ffff546149c in _gtk_marshal_BOOLEAN__BOXED (closure=0xbb4f30, return_value=0x7fffffffd930, n_param_values=<optimized out>, param_values=0x7fffffffd9e0, invocation_hint=<optimized out>, 
        marshal_data=<optimized out>) at /build/buildd/gtk+3.0-3.6.4/./gtk/gtkmarshalers.c:85
    #14 0x00007ffff3eba620 in g_closure_invoke (closure=0xbb4f30, return_value=0x7fffffffd930, n_param_values=2, param_values=0x7fffffffd9e0, invocation_hint=0x7fffffffd980)
        at /build/buildd/glib2.0-2.36.0/./gobject/gclosure.c:777
    #15 0x00007ffff3ecbf00 in signal_emit_unlocked_R (node=node@entry=0x8c1100, detail=detail@entry=0, instance=instance@entry=0x90a2f0, emission_return=emission_return@entry=0x7fffffffdab0, 
        instance_and_params=instance_and_params@entry=0x7fffffffd9e0) at /build/buildd/glib2.0-2.36.0/./gobject/gsignal.c:3584
    #16 0x00007ffff3ed3996 in g_signal_emit_valist (instance=0x90a2f0, signal_id=<optimized out>, detail=0, var_args=var_args@entry=0x7fffffffdc38) at /build/buildd/glib2.0-2.36.0/./gobject/gsignal.c:3338
    #17 0x00007ffff3ed3f92 in g_signal_emit (instance=instance@entry=0x90a2f0, signal_id=<optimized out>, detail=detail@entry=0) at /build/buildd/glib2.0-2.36.0/./gobject/gsignal.c:3384
    #18 0x00007ffff559077e in gtk_widget_event_internal (widget=0x90a2f0, event=0xc199b0) at /build/buildd/gtk+3.0-3.6.4/./gtk/gtkwidget.c:6303
    #19 0x00007ffff545f555 in propagate_event (widget=0x90a2f0, event=0xc199b0, captured=<optimized out>, topmost=0x0) at /build/buildd/gtk+3.0-3.6.4/./gtk/gtkmain.c:2500
    #20 0x00007ffff5461185 in gtk_main_do_event (event=0xc199b0) at /build/buildd/gtk+3.0-3.6.4/./gtk/gtkmain.c:1716
    #21 0x00007ffff50905e2 in gdk_event_source_dispatch (source=source@entry=0x90f350, callback=<optimized out>, user_data=<optimized out>) at /build/buildd/gtk+3.0-3.6.4/./gdk/x11/gdkeventsource.c:358
    #22 0x00007ffff3bf6f05 in g_main_dispatch (context=0x8a80c0) at /build/buildd/glib2.0-2.36.0/./glib/gmain.c:3054
    #23 g_main_context_dispatch (context=context@entry=0x8a80c0) at /build/buildd/glib2.0-2.36.0/./glib/gmain.c:3630
    #24 0x00007ffff3bf7248 in g_main_context_iterate (context=0x8a80c0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at /build/buildd/glib2.0-2.36.0/./glib/gmain.c:3701
    #25 0x00007ffff3bf76ba in g_main_loop_run (loop=0x8e0fe0) at /build/buildd/glib2.0-2.36.0/./glib/gmain.c:3895
    #26 0x00007ffff54604a5 in gtk_main () at /build/buildd/gtk+3.0-3.6.4/./gtk/gtkmain.c:1160
    #27 0x00000000005967c4 in yorba_application_run (self=0x89a810, args=args@entry=0x7fffffffe038, args_length1=args_length1@entry=2) at /home/eric/Development/geary2/src/common/common-yorba-application.vala:143
    #28 0x000000000046265f in _vala_main (args=0x7fffffffe038, args_length1=2) at /home/eric/Development/geary2/src/client/main.vala:10
    #29 0x00007ffff30e1ea5 in __libc_start_main (main=0x452110 <main>, argc=2, ubp_av=0x7fffffffe038, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffe028)
        at libc-start.c:260
    #30 0x0000000000452159 in _start ()
    

From looking at the GdkEvent code, it's not at all clear to me why this
warning exists. We've been burned by this in Shotwell as well.

This is a side effect of using propagate_key_event(), which was added in
#6199.

Related issues:
related to shotwell - 5414: Occasionally, a warning appears in the
console while Shif... (Open)
related to shotwell - 4924: A warning appears in the console if the zoom
slider is ma... (Open)
related to shotwell - 4923: Pictures briefly visually distorted when
zooming in libra... (Open)
related to geary - 7516: pasting a gibberish address in composer triggers
a gtk-cr... (Open)



---- Additional Comments From geary-maint@gnome.bugs 2013-09-04 12:39:00 -0700 ----

### History

####

#1

Updated by Eric Gregory 7 months ago

I've posted a message to the Gtk mailing list regarding this issue:

https://mail.gnome.org/archives/gtk-list/2013-May/msg00020.html

####

#2

Updated by Jim Nelson 3 months ago

  * **Target version** changed from _0.4.0_ to _0.5.0_



--- Bug imported by chaz@yorba.org 2013-11-21 20:19 UTC  ---

This bug was previously known as _bug_ 6913 at http://redmine.yorba.org/show_bug.cgi?id=6913

Unknown milestone "unknown in product geary. 
   Setting to default milestone for this product, "---".
Setting qa contact to the default for this product.
   This bug either had no qa contact or an invalid one.
Resolution set on an open status.
   Dropping resolution 

Comment 1 Jim Nelson 2014-01-08 19:46:12 UTC
See also bug #721789.
Comment 2 Jim Nelson 2014-01-09 00:08:51 UTC
garnacho on IRC revealed the problem: Vala makes a shallow copy of GdkEventKey to pass to gtk_window_propagate_key_event().  This is a no-no, as all GdkEvents have hidden private data that Vala doesn't copy.  That's why the low-level handler thinks this is a synthesized event.

Still looking into this.
Comment 3 Jürg Billeter 2014-02-03 20:57:25 UTC
(In reply to comment #2)
> garnacho on IRC revealed the problem: Vala makes a shallow copy of GdkEventKey
> to pass to gtk_window_propagate_key_event().  This is a no-no, as all GdkEvents
> have hidden private data that Vala doesn't copy.  That's why the low-level
> handler thinks this is a synthesized event.

Binding issue, moving bug to Vala.
Comment 4 Jürg Billeter 2014-02-03 21:46:25 UTC
Created attachment 268003 [details]
Fixed gdk-3.0.vapi

I've pushed a fix to the bug713240 vala branch. Could you please verify that this fixes this issue? Instead of using Vala from that branch, you could also build geary with the attached gdk-3.0.vapi, without updating valac.

As this is a relatively invasive bindings change of GdkEvent*, please also check whether you encounter any regressions with this change, be it in geary or shotwell.

If I get a positive response soon, I'll likely include this change in tomorrow's development release.
Comment 5 Jürg Billeter 2014-02-03 22:01:23 UTC
Created attachment 268006 [details]
Fixed gdk-3.0.vapi

There was a typo in the previous attachment. It shouldn't affect geary but I'll attach the fixed version just in case.
Comment 6 Jim Nelson 2014-02-04 19:37:57 UTC
Jürg, this definitely fixes the console warning, but our keyboard shortcuts still don't work (bug #721789).  This may be a bug on our end, we'll need to investigate.

For anyone out there that wants to try the patched GDK binding with Geary, be sure to add it and Vala's distributed gdk-3.0.deps file into Geary's bindings/vapi directory.  If you don't include the .deps file, you'll get build errors related to missing Pango symbols.
Comment 7 Jürg Billeter 2014-02-04 22:15:59 UTC
commit 598942f1795ebcf651525bfde4e4033d5b09c254
Author: Jürg Billeter <j@bitron.ch>
Date:   Sun Jan 26 14:11:43 2014 +0100

    gdk-3.0: Fix GdkEvent* bindings
    
    GdkEvent structs have hidden fields and must be exposed as compact
    classes.
    
    Fixes bug 713240.
Comment 8 Allison Karlitskaya (desrt) 2014-02-12 03:09:43 UTC
This change broke baobab.  See bug 724204.

Do we have any policy about stability of binding API these days?
Comment 9 Luca Bruno 2014-02-12 06:01:13 UTC
(In reply to comment #8)
> This change broke baobab.  See bug 724204.
> 
> Do we have any policy about stability of binding API these days?

This change is not in a stable release, it's for vala 0.24, and it's necessary.
Comment 10 Jürg Billeter 2014-02-12 06:40:53 UTC
While we do not guarantee binding API stability outside Vala stable branches, we try hard to avoid incompatible changes in bindings for stable/core libraries.

In this particular change, compatibility API for Gdk.Event was introduced that covers most uses. Unfortunately, it wasn't possible to provide 100% backward compatibility. I'm not aware of any other projects that were broken by this change. And as Luca mentioned, this change was necessary. The previous binding had significant flaws.
Comment 11 Allison Karlitskaya (desrt) 2014-02-12 12:13:17 UTC
Sounds fine.  Thanks for the clarification. :)