summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2015-09-09 10:03:59 +0200
committerGerd Hoffmann <kraxel@redhat.com>2015-09-15 12:27:39 +0200
commit695cc59d42f2e285abd5cf278bdc07360a995eaa (patch)
tree02bf85dc7c7661843e9c5dc7eef827e38a117d90
parentaa4f4058ba8cde200e62ef3dafc4e1595f6033e9 (diff)
downloadfocaccia-qemu-695cc59d42f2e285abd5cf278bdc07360a995eaa.tar.gz
focaccia-qemu-695cc59d42f2e285abd5cf278bdc07360a995eaa.zip
gtk: move gd_update_caption calls to gd_{grab,ungrab}_{pointer,keyboard}
Then we don't have to pair the grab/ungrab calls with update_caption
calls any more because things happen automatically ;)

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
-rw-r--r--ui/gtk.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/ui/gtk.c b/ui/gtk.c
index 24a1edb988..5f87475f2e 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -856,7 +856,6 @@ static gboolean gd_button_event(GtkWidget *widget, GdkEventButton *button,
                                            TRUE);
         } else {
             gd_grab_pointer(vc);
-            gd_update_caption(s);
         }
         return TRUE;
     }
@@ -1095,7 +1094,6 @@ static gboolean gd_win_grab(void *opaque)
     } else {
         gd_grab_pointer(vc);
     }
-    gd_update_caption(vc->s);
     return TRUE;
 }
 
@@ -1278,6 +1276,7 @@ static void gd_grab_keyboard(VirtualConsole *vc)
                       GDK_CURRENT_TIME);
 #endif
     vc->s->kbd_owner = vc;
+    gd_update_caption(vc->s);
     trace_gd_grab(vc->label, "kbd", true);
 }
 
@@ -1295,6 +1294,7 @@ static void gd_ungrab_keyboard(GtkDisplayState *s)
 #else
     gdk_keyboard_ungrab(GDK_CURRENT_TIME);
 #endif
+    gd_update_caption(s);
     trace_gd_grab(vc->label, "kbd", false);
 }
 
@@ -1336,6 +1336,7 @@ static void gd_grab_pointer(VirtualConsole *vc)
                             &vc->s->grab_x_root, &vc->s->grab_y_root, NULL);
 #endif
     vc->s->ptr_owner = vc;
+    gd_update_caption(vc->s);
     trace_gd_grab(vc->label, "ptr", true);
 }
 
@@ -1361,6 +1362,7 @@ static void gd_ungrab_pointer(GtkDisplayState *s)
                              gtk_widget_get_screen(vc->gfx.drawing_area),
                              vc->s->grab_x_root, vc->s->grab_y_root);
 #endif
+    gd_update_caption(s);
     trace_gd_grab(vc->label, "ptr", false);
 }
 
@@ -1377,7 +1379,6 @@ static void gd_menu_grab_input(GtkMenuItem *item, void *opaque)
         gd_ungrab_pointer(s);
     }
 
-    gd_update_caption(s);
     gd_update_cursor(vc);
 }
 
@@ -1432,7 +1433,6 @@ static gboolean gd_enter_event(GtkWidget *widget, GdkEventCrossing *crossing,
 
     if (gd_grab_on_hover(s)) {
         gd_grab_keyboard(vc);
-        gd_update_caption(s);
     }
     return TRUE;
 }
@@ -1445,7 +1445,6 @@ static gboolean gd_leave_event(GtkWidget *widget, GdkEventCrossing *crossing,
 
     if (gd_grab_on_hover(s)) {
         gd_ungrab_keyboard(s);
-        gd_update_caption(s);
     }
     return TRUE;
 }