Hide window when focus listener detects focus out.
This commit is contained in:
		@ -46,7 +46,6 @@ struct _EekboardSystemClient {
 | 
				
			|||||||
    EekboardProxy *proxy;
 | 
					    EekboardProxy *proxy;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    EekKeyboard *keyboard;
 | 
					    EekKeyboard *keyboard;
 | 
				
			||||||
    Accessible *accessible;
 | 
					 | 
				
			||||||
    GdkDisplay *display;
 | 
					    GdkDisplay *display;
 | 
				
			||||||
    XklEngine *xkl_engine;
 | 
					    XklEngine *xkl_engine;
 | 
				
			||||||
    XklConfigRegistry *xkl_config_registry;
 | 
					    XklConfigRegistry *xkl_config_registry;
 | 
				
			||||||
@ -167,7 +166,6 @@ static void
 | 
				
			|||||||
eekboard_system_client_init (EekboardSystemClient *client)
 | 
					eekboard_system_client_init (EekboardSystemClient *client)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    client->keyboard = NULL;
 | 
					    client->keyboard = NULL;
 | 
				
			||||||
    client->accessible = NULL;
 | 
					 | 
				
			||||||
    client->display = NULL;
 | 
					    client->display = NULL;
 | 
				
			||||||
    client->xkl_engine = NULL;
 | 
					    client->xkl_engine = NULL;
 | 
				
			||||||
    client->xkl_config_registry = NULL;
 | 
					    client->xkl_config_registry = NULL;
 | 
				
			||||||
@ -318,29 +316,14 @@ focus_listener_cb (const AccessibleEvent *event,
 | 
				
			|||||||
        case SPI_ROLE_PARAGRAPH:
 | 
					        case SPI_ROLE_PARAGRAPH:
 | 
				
			||||||
        case SPI_ROLE_PASSWORD_TEXT:
 | 
					        case SPI_ROLE_PASSWORD_TEXT:
 | 
				
			||||||
        case SPI_ROLE_TERMINAL:
 | 
					        case SPI_ROLE_TERMINAL:
 | 
				
			||||||
            if (g_strcmp0 (event->type, "focus") == 0 ||
 | 
					 | 
				
			||||||
                event->detail1 == 1) {
 | 
					 | 
				
			||||||
                client->accessible = accessible;
 | 
					 | 
				
			||||||
                eekboard_proxy_show (client->proxy);
 | 
					 | 
				
			||||||
            } else if (event->detail1 == 0 &&
 | 
					 | 
				
			||||||
                       accessible == client->accessible) {
 | 
					 | 
				
			||||||
                client->accessible = NULL;
 | 
					 | 
				
			||||||
                eekboard_proxy_hide (client->proxy);
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        case SPI_ROLE_ENTRY:
 | 
					        case SPI_ROLE_ENTRY:
 | 
				
			||||||
            if (g_strcmp0 (event->type, "focus") == 0 ||
 | 
					            if (g_strcmp0 (event->type, "focus") == 0 || event->detail1 == 1)
 | 
				
			||||||
                event->detail1 == 1) {
 | 
					 | 
				
			||||||
                client->accessible = accessible;
 | 
					 | 
				
			||||||
                eekboard_proxy_show (client->proxy);
 | 
					                eekboard_proxy_show (client->proxy);
 | 
				
			||||||
            } else if (event->detail1 == 0 &&
 | 
					 | 
				
			||||||
                       accessible == client->accessible) {
 | 
					 | 
				
			||||||
                client->accessible = NULL;
 | 
					 | 
				
			||||||
                eekboard_proxy_hide (client->proxy);
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        default:
 | 
					        default:
 | 
				
			||||||
            ;
 | 
					            ;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    } else
 | 
				
			||||||
 | 
					        eekboard_proxy_hide (client->proxy);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return FALSE;
 | 
					    return FALSE;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user