Merge lp:~ted/hud/bamf-focus-fix into lp:hud/13.10

Proposed by Ted Gould
Status: Merged
Approved by: Antti Kaijanmäki
Approved revision: 276
Merged at revision: 274
Proposed branch: lp:~ted/hud/bamf-focus-fix
Merge into: lp:hud/13.10
Diff against target: 57 lines (+19/-20)
1 file modified
src/application-list.c (+19/-20)
To merge this branch: bzr merge lp:~ted/hud/bamf-focus-fix
Reviewer Review Type Date Requested Status
Antti Kaijanmäki (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+168539@code.launchpad.net

Commit message

Don't clear the last focused pointer when we get a NULL new window

Description of the change

The new BAMF changed it's behavior slightly in that it always gives us two events. One for clearing the previous window and one for the new window. This caused us to loose the last focused window and then show no results.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:276
http://jenkins.qa.ubuntu.com/job/hud-ci/56/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/hud-saucy-amd64-ci/17
    SUCCESS: http://jenkins.qa.ubuntu.com/job/hud-saucy-i386-ci/17

Click here to trigger a rebuild:
http://s-jenkins:8080/job/hud-ci/56/rebuild

review: Approve (continuous-integration)
Revision history for this message
Antti Kaijanmäki (kaijanmaki) wrote :

you just got to love BAMF! :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/application-list.c'
2--- src/application-list.c 2013-05-21 01:03:09 +0000
3+++ src/application-list.c 2013-06-10 20:13:29 +0000
4@@ -365,12 +365,6 @@
5 {
6 HudApplicationList * list = HUD_APPLICATION_LIST(user_data);
7
8- /* We care where we're going, not where we've been */
9- if (new_win == NULL) {
10- g_clear_object(&list->priv->last_focused_main_stage_source);
11- return;
12- }
13-
14 if (hud_application_list_name_in_ignore_list (new_win))
15 return;
16
17@@ -570,21 +564,26 @@
18
19 HudApplicationSource * source = NULL;
20
21-#ifdef HAVE_BAMF
22- AbstractApplication * app = NULL;
23- app = bamf_matcher_get_active_application(list->priv->matcher);
24-
25- if (app != NULL) {
26- source = bamf_app_to_source(list, app);
27- }
28-#endif
29-
30-#ifdef HAVE_PLATFORM_API
31- /* Hybris doesn't allow us to query what is currently focused,
32- we'll just have to hope we've tracked it perfectly. Hopefully
33- there are no races in the API, we can't protect ourselves against
34- them in any way. */
35+ /* First see if we've already got it */
36 source = list->priv->last_focused_main_stage_source;
37+
38+#ifdef HAVE_PLATFORM_API
39+ /* Check the side stage */
40+ if (source == NULL) {
41+ source = list->priv->last_focused_side_stage_source;
42+ }
43+#endif
44+
45+#ifdef HAVE_BAMF
46+ if (source == NULL) {
47+ /* Try using the application first */
48+ AbstractApplication * app = NULL;
49+ app = bamf_matcher_get_active_application(list->priv->matcher);
50+
51+ if (app != NULL) {
52+ source = bamf_app_to_source(list, app);
53+ }
54+ }
55 #endif
56
57 /* If we weren't able to use BAMF, let's try to find a source

Subscribers

People subscribed via source and target branches