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 734348 - Don't call into GDK when we don't have a GdkWindow yet
Don't call into GDK when we don't have a GdkWindow yet
Status: RESOLVED FIXED
Product: gtk-vnc
Classification: Other
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-vnc-maint
gtk-vnc-maint
Depends on:
Blocks:
 
 
Reported: 2014-08-06 11:12 UTC by Christophe Fergeau
Modified: 2014-08-28 12:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Don't call into GDK when we don't have a GdkWindow yet (6.42 KB, patch)
2014-08-06 11:12 UTC, Christophe Fergeau
reviewed Details | Review
Don't call into GDK when we don't have a GdkWindow yet (7.40 KB, patch)
2014-08-06 14:37 UTC, Christophe Fergeau
committed Details | Review

Description Christophe Fergeau 2014-08-06 11:12:18 UTC
In some situations, virt-viewer will call some gtk-vnc methods while
the gtk-vnc widget is not realized. This means it has no associated
GdkWindow and that it's not possible to do GDK calls on this widget.
Some of these gtk-vnc were trying to call into GDK without checking
this, causing runtime warnings such as:

(virt-viewer:29150): Gdk-CRITICAL **: gdk_window_set_cursor: assertion
'GDK_IS_WINDOW (window)' failed

or

(virt-viewer:20076): Gdk-CRITICAL **: gdk_window_get_width: assertion
`GDK_IS_WINDOW (window)' failed

(virt-viewer:20076): Gdk-CRITICAL **: gdk_window_get_height: assertion
`GDK_IS_WINDOW (window)' failed

  #0  g_logv (log_domain=0x3247a74066 "Gdk", log_level=G_LOG_LEVEL_CRITICAL,
      format=<optimized out>, args=args@entry=0x7fffffffd1b0) at gmessages.c:1038
  #1  0x0000003a97450eff in g_log (
      log_domain=log_domain@entry=0x3247a74066 "Gdk",
      log_level=log_level@entry=G_LOG_LEVEL_CRITICAL,
      format=format@entry=0x3a974bee3a "%s: assertion '%s' failed")
      at gmessages.c:1071
  #2  0x0000003a97450f39 in g_return_if_fail_warning (
      log_domain=log_domain@entry=0x3247a74066 "Gdk",
      pretty_function=pretty_function@entry=0x3247a8a320 <__FUNCTION__.33032> "gdk_window_get_width",
      expression=expression@entry=0x3247a74794 "GDK_IS_WINDOW (window)")
      at gmessages.c:1080
  #3  0x0000003247a35ed4 in gdk_window_get_width (window=0x0) at gdkwindow.c:6093
  #4  0x00007ffff7dc5e73 in gdk_drawable_get_size (w=0x0, ww=0x7fffffffd2f0,
      wh=0x7fffffffd2f4) at vncdisplay.c:140
  #5  0x00007ffff7dcc183 in vnc_display_set_scaling (obj=0x9661e0 [VncDisplay],
      enable=1) at vncdisplay.c:2446
  #6  0x0000000000425555 in virt_viewer_display_vnc_new (
      vnc=0x9661e0 [VncDisplay]) at virt-viewer-display-vnc.c:191
  #7  0x00000000004241b3 in virt_viewer_session_vnc_disconnected (
      vnc=0x9661e0 [VncDisplay], session=0x962560 [VirtViewerSessionVnc])
      at virt-viewer-session-vnc.c:114
  #8  0x0000003944a10747 in _g_closure_invoke_va (
      closure=closure@entry=0x6d2480, return_value=return_value@entry=0x0,
      instance=instance@entry=0x9661e0, args=args@entry=0x7fffffffd560,
      n_params=0, param_types=0x0) at gclosure.c:831
  #9  0x0000003944a299d7 in g_signal_emit_valist (instance=0x9661e0,
      signal_id=<optimized out>, detail=0,
      var_args=var_args@entry=0x7fffffffd560) at gsignal.c:3215
  #10 0x0000003944a2a63f in g_signal_emit (instance=<optimized out>,
      signal_id=<optimized out>, detail=<optimized out>) at gsignal.c:3363
  #11 0x00007ffff7dc9a60 in on_disconnected (conn=0x975cc0 [VncConnection],
      opaque=0x9661e0) at vncdisplay.c:1568
  #12 0x0000003944a10747 in _g_closure_invoke_va (
      closure=closure@entry=0x6d2190, return_value=return_value@entry=0x0,
      instance=instance@entry=0x975cc0, args=args@entry=0x7fffffffd850,
      n_params=0, param_types=0x0) at gclosure.c:831
  #13 0x0000003944a299d7 in g_signal_emit_valist (instance=0x975cc0,
      signal_id=<optimized out>, detail=0,
      var_args=var_args@entry=0x7fffffffd850) at gsignal.c:3215
  #14 0x0000003944a2a63f in g_signal_emit (instance=<optimized out>,
      signal_id=<optimized out>, detail=<optimized out>) at gsignal.c:3363
  #15 0x00007ffff7ba419c in do_vnc_connection_emit_main_context (
      opaque=0x7fffed16ef40) at vncconnection.c:578
  #16 0x0000003a97449c3a in g_main_dispatch (context=0x68d280) at gmain.c:3064
  #17 g_main_context_dispatch (context=context@entry=0x68d280) at gmain.c:3663
  #18 0x0000003a97449f88 in g_main_context_iterate (context=0x68d280,
      block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>)
      at gmain.c:3734
  #19 0x0000003a9744a25a in g_main_loop_run (loop=0x74c560) at gmain.c:3928
Comment 1 Christophe Fergeau 2014-08-06 11:12:23 UTC
Created attachment 282656 [details] [review]
Don't call into GDK when we don't have a GdkWindow yet
Comment 2 Marc-Andre Lureau 2014-08-06 11:42:44 UTC
Review of attachment 282656 [details] [review]:

Why not set the cursor when the widget will be realized? looks good otherwise
Comment 3 Christophe Fergeau 2014-08-06 14:37:15 UTC
Created attachment 282705 [details] [review]
Don't call into GDK when we don't have a GdkWindow yet

In some situations, virt-viewer will call some gtk-vnc methods while
the gtk-vnc widget is not realized. This means it has no associated
GdkWindow and that it's not possible to do GDK calls on this widget.
Some of these gtk-vnc were trying to call into GDK without checking
this, causing runtime warnings such as:

(virt-viewer:29150): Gdk-CRITICAL **: gdk_window_set_cursor: assertion
'GDK_IS_WINDOW (window)' failed

or

(virt-viewer:20076): Gdk-CRITICAL **: gdk_window_get_width: assertion
`GDK_IS_WINDOW (window)' failed

(virt-viewer:20076): Gdk-CRITICAL **: gdk_window_get_height: assertion
`GDK_IS_WINDOW (window)' failed

  #0  g_logv (log_domain=0x3247a74066 "Gdk", log_level=G_LOG_LEVEL_CRITICAL,
      format=<optimized out>, args=args@entry=0x7fffffffd1b0) at gmessages.c:1038
  #1  0x0000003a97450eff in g_log (
      log_domain=log_domain@entry=0x3247a74066 "Gdk",
      log_level=log_level@entry=G_LOG_LEVEL_CRITICAL,
      format=format@entry=0x3a974bee3a "%s: assertion '%s' failed")
      at gmessages.c:1071
  #2  0x0000003a97450f39 in g_return_if_fail_warning (
      log_domain=log_domain@entry=0x3247a74066 "Gdk",
      pretty_function=pretty_function@entry=0x3247a8a320 <__FUNCTION__.33032> "gdk_window_get_width",
      expression=expression@entry=0x3247a74794 "GDK_IS_WINDOW (window)")
      at gmessages.c:1080
  #3  0x0000003247a35ed4 in gdk_window_get_width (window=0x0) at gdkwindow.c:6093
  #4  0x00007ffff7dc5e73 in gdk_drawable_get_size (w=0x0, ww=0x7fffffffd2f0,
      wh=0x7fffffffd2f4) at vncdisplay.c:140
  #5  0x00007ffff7dcc183 in vnc_display_set_scaling (obj=0x9661e0 [VncDisplay],
      enable=1) at vncdisplay.c:2446
  #6  0x0000000000425555 in virt_viewer_display_vnc_new (
      vnc=0x9661e0 [VncDisplay]) at virt-viewer-display-vnc.c:191
  #7  0x00000000004241b3 in virt_viewer_session_vnc_disconnected (
      vnc=0x9661e0 [VncDisplay], session=0x962560 [VirtViewerSessionVnc])
      at virt-viewer-session-vnc.c:114
  #8  0x0000003944a10747 in _g_closure_invoke_va (
      closure=closure@entry=0x6d2480, return_value=return_value@entry=0x0,
      instance=instance@entry=0x9661e0, args=args@entry=0x7fffffffd560,
      n_params=0, param_types=0x0) at gclosure.c:831
  #9  0x0000003944a299d7 in g_signal_emit_valist (instance=0x9661e0,
      signal_id=<optimized out>, detail=0,
      var_args=var_args@entry=0x7fffffffd560) at gsignal.c:3215
  #10 0x0000003944a2a63f in g_signal_emit (instance=<optimized out>,
      signal_id=<optimized out>, detail=<optimized out>) at gsignal.c:3363
  #11 0x00007ffff7dc9a60 in on_disconnected (conn=0x975cc0 [VncConnection],
      opaque=0x9661e0) at vncdisplay.c:1568
  #12 0x0000003944a10747 in _g_closure_invoke_va (
      closure=closure@entry=0x6d2190, return_value=return_value@entry=0x0,
      instance=instance@entry=0x975cc0, args=args@entry=0x7fffffffd850,
      n_params=0, param_types=0x0) at gclosure.c:831
  #13 0x0000003944a299d7 in g_signal_emit_valist (instance=0x975cc0,
      signal_id=<optimized out>, detail=0,
      var_args=var_args@entry=0x7fffffffd850) at gsignal.c:3215
  #14 0x0000003944a2a63f in g_signal_emit (instance=<optimized out>,
      signal_id=<optimized out>, detail=<optimized out>) at gsignal.c:3363
  #15 0x00007ffff7ba419c in do_vnc_connection_emit_main_context (
      opaque=0x7fffed16ef40) at vncconnection.c:578
  #16 0x0000003a97449c3a in g_main_dispatch (context=0x68d280) at gmain.c:3064
  #17 g_main_context_dispatch (context=context@entry=0x68d280) at gmain.c:3663
  #18 0x0000003a97449f88 in g_main_context_iterate (context=0x68d280,
      block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>)
      at gmain.c:3734
  #19 0x0000003a9744a25a in g_main_loop_run (loop=0x74c560) at gmain.c:3928
Comment 4 Marc-Andre Lureau 2014-08-28 11:22:59 UTC
Review of attachment 282705 [details] [review]:

ack
Comment 5 Christophe Fergeau 2014-08-28 12:51:24 UTC
Attachment 282705 [details] pushed as 910c4d4 - Don't call into GDK when we don't have a GdkWindow yet