From 50895d08e15490e7df91001dcb6803e47a8d98f8 Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Wed, 23 Feb 2011 14:51:25 +0900 Subject: [PATCH] Avoid to send KeyboardVisibilityChanged on SetKeyboard and SetGroup. --- ...stem-client-main.c => desktop-client-main.c} | 0 src/{system-client.c => desktop-client.c} | 0 src/{system-client.h => desktop-client.h} | 0 src/server-context.c | 17 +++++++++++++++-- 4 files changed, 15 insertions(+), 2 deletions(-) rename src/{system-client-main.c => desktop-client-main.c} (100%) rename src/{system-client.c => desktop-client.c} (100%) rename src/{system-client.h => desktop-client.h} (100%) diff --git a/src/system-client-main.c b/src/desktop-client-main.c similarity index 100% rename from src/system-client-main.c rename to src/desktop-client-main.c diff --git a/src/system-client.c b/src/desktop-client.c similarity index 100% rename from src/system-client.c rename to src/desktop-client.c diff --git a/src/system-client.h b/src/desktop-client.h similarity index 100% rename from src/system-client.h rename to src/desktop-client.h diff --git a/src/server-context.c b/src/server-context.c index d4b1073c..f689a178 100644 --- a/src/server-context.c +++ b/src/server-context.c @@ -93,6 +93,7 @@ struct _ServerContext { gulong key_pressed_handler; gulong key_released_handler; + gulong notify_visible_handler; }; struct _ServerContextClass { @@ -207,8 +208,9 @@ update_widget (ServerContext *context) context->window = gtk_window_new (GTK_WINDOW_TOPLEVEL); g_signal_connect (context->window, "destroy", G_CALLBACK(on_destroy), context); - g_signal_connect (context->window, "notify::visible", - G_CALLBACK(on_notify_visible), context); + context->notify_visible_handler = + g_signal_connect (context->window, "notify::visible", + G_CALLBACK(on_notify_visible), context); gtk_container_add (GTK_CONTAINER(context->window), context->widget); gtk_widget_set_can_focus (context->window, FALSE); @@ -471,9 +473,14 @@ handle_method_call (GDBusConnection *connection, if (context->window) { gboolean was_visible = gtk_widget_get_visible (context->window); + /* avoid to send KeyboardVisibilityChanged */ + g_signal_handler_block (context->window, + context->notify_visible_handler); update_widget (context); if (was_visible) gtk_widget_show_all (context->window); + g_signal_handler_unblock (context->window, + context->notify_visible_handler); } g_dbus_method_invocation_return_value (invocation, NULL); @@ -496,9 +503,15 @@ handle_method_call (GDBusConnection *connection, if (context->window) { gboolean was_visible = gtk_widget_get_visible (context->window); + + /* avoid to send KeyboardVisibilityChanged */ + g_signal_handler_block (context->window, + context->notify_visible_handler); update_widget (context); if (was_visible) gtk_widget_show_all (context->window); + g_signal_handler_unblock (context->window, + context->notify_visible_handler); } g_dbus_method_invocation_return_value (invocation, NULL);