Re: [Spice-devel] [PATCH] spice-widget: Don't return early from focus_in_event when widget is not realized

2015-01-23 Thread Marc-André Lureau
thanks! ack

- Original Message -
 Otherwise SpiceDisplay might not get the keyboard grab.
 It also silence GSpice-CRITICAL on focus out event:
 GSpice-CRITICAL **: spice_gtk_session_request_auto_usbredir: assertion
 's-auto_usbredir_reqs  0' failed
 ---
  gtk/spice-widget.c | 7 +++
  1 file changed, 3 insertions(+), 4 deletions(-)
 
 diff --git a/gtk/spice-widget.c b/gtk/spice-widget.c
 index 3a2be87..147271c 100644
 --- a/gtk/spice-widget.c
 +++ b/gtk/spice-widget.c
 @@ -1475,9 +1475,6 @@ static gboolean focus_in_event(GtkWidget *widget,
 GdkEventFocus *focus G_GNUC_UN
  
  SPICE_DEBUG(%s, __FUNCTION__);
  
 -if (!gtk_widget_get_realized(widget))
 -return true;
 -
  /*
   * Ignore focus in when we already have the focus
   * (this happens when doing an ungrab from the leave_event callback).
 @@ -1492,7 +1489,9 @@ static gboolean focus_in_event(GtkWidget *widget,
 GdkEventFocus *focus G_GNUC_UN
  memset(d-activeseq, 0, sizeof(gboolean) * d-grabseq-nkeysyms);
  update_keyboard_focus(display, true);
  try_keyboard_grab(display);
 -update_display(display);
 +
 +if (gtk_widget_get_realized(widget))
 +update_display(display);
  
  return true;
  }
 --
 1.9.3
 
 ___
 Spice-devel mailing list
 Spice-devel@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/spice-devel
 
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] [PATCH] spice-widget: Don't return early from focus_in_event when widget is not realized

2015-01-23 Thread Pavel Grunt

 
 thanks! ack
 
thanks, pushed as 4c4d7b20822a8ae916df902dd8218cadfe6f0a17
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [PATCH] spice-widget: Don't return early from focus_in_event when widget is not realized

2015-01-23 Thread Pavel Grunt
Otherwise SpiceDisplay might not get the keyboard grab.
It also silence GSpice-CRITICAL on focus out event:
GSpice-CRITICAL **: spice_gtk_session_request_auto_usbredir: assertion 
's-auto_usbredir_reqs  0' failed
---
 gtk/spice-widget.c | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/gtk/spice-widget.c b/gtk/spice-widget.c
index 3a2be87..147271c 100644
--- a/gtk/spice-widget.c
+++ b/gtk/spice-widget.c
@@ -1475,9 +1475,6 @@ static gboolean focus_in_event(GtkWidget *widget, 
GdkEventFocus *focus G_GNUC_UN
 
 SPICE_DEBUG(%s, __FUNCTION__);
 
-if (!gtk_widget_get_realized(widget))
-return true;
-
 /*
  * Ignore focus in when we already have the focus
  * (this happens when doing an ungrab from the leave_event callback).
@@ -1492,7 +1489,9 @@ static gboolean focus_in_event(GtkWidget *widget, 
GdkEventFocus *focus G_GNUC_UN
 memset(d-activeseq, 0, sizeof(gboolean) * d-grabseq-nkeysyms);
 update_keyboard_focus(display, true);
 try_keyboard_grab(display);
-update_display(display);
+
+if (gtk_widget_get_realized(widget))
+update_display(display);
 
 return true;
 }
-- 
1.9.3

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel