From 36c9b4303fa855b2c8d1f07f5b368e93ea66d718 Mon Sep 17 00:00:00 2001 From: Patryk Kaczmarek Date: Tue, 7 Jul 2015 11:49:51 +0200 Subject: [PATCH] Unused function deleted -_get_window_object_from_given is not used after this commit: 9218c05897b60a59c5b0b5276d763246e5a90942 Change-Id: I5bfe138a7025cd8854bee971b56033aa08f4435c Signed-off-by: Patryk Kaczmarek --- src/window_tracker.c | 43 +------------------------------------------ 1 file changed, 1 insertion(+), 42 deletions(-) diff --git a/src/window_tracker.c b/src/window_tracker.c index eae96e6..454f1e4 100644 --- a/src/window_tracker.c +++ b/src/window_tracker.c @@ -7,47 +7,6 @@ static void *user_data; static AtspiEventListener *listener; static AtspiAccessible *last_active_win; -static AtspiAccessible* -_get_window_object_from_given(AtspiAccessible *obj) -{ - if (!obj) - return NULL; - - if (atspi_accessible_get_role(obj, NULL) != ATSPI_ROLE_DESKTOP_FRAME) - return NULL; - - AtspiAccessible *win = NULL; - AtspiAccessible *app = NULL; - AtspiAccessible *ret = NULL; - AtspiStateSet *st = NULL; - int desktop_childs; - int app_childs; - int i,j; - - desktop_childs = atspi_accessible_get_child_count(obj, NULL); - - for (i=0; i < desktop_childs; i++) - { - app = atspi_accessible_get_child_at_index(obj, i, NULL); - if (atspi_accessible_get_role(app, NULL) == ATSPI_ROLE_APPLICATION) - { - app_childs = atspi_accessible_get_child_count(app, NULL); - for (j=0; j < app_childs; j++) - { - win = atspi_accessible_get_child_at_index(app, j, NULL); - if (win) { - st = atspi_accessible_get_state_set (win); - if (atspi_state_set_contains(st, ATSPI_STATE_ACTIVE)) { - return win; - } - } - } - } - } - - return ret; -} - static void _on_atspi_window_cb(const AtspiEvent *event) { @@ -65,7 +24,7 @@ _on_atspi_window_cb(const AtspiEvent *event) !strcmp(event->type, "window:destroy")) { if (last_active_win != event->source) - return; + return; if (user_cb) user_cb(user_data, NULL); last_active_win = NULL; } -- 2.7.4