summaryrefslogtreecommitdiffstats
path: root/meta-efl/recipes-efl/e17/e-wm/Fix-Illume-Home-Button.diff
blob: 09b5feb877c7cd85ed9df2c8e0917ee0013640e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
Index: e/src/modules/illume2/policies/illume/policy.c
===================================================================
--- e/src/modules/illume2/policies/illume/policy.c	(revision 67951)
+++ e/src/modules/illume2/policies/illume/policy.c	(revision 76646)
@@ -13,4 +13,5 @@
 static void _policy_border_move(E_Border *bd, int x, int y);
 static void _policy_border_resize(E_Border *bd, int w, int h);
+static void _policy_border_hide_above(E_Border *bd);
 static void _policy_border_hide_below(E_Border *bd);
 static void _policy_border_show_below(E_Border *bd);
@@ -124,23 +125,57 @@
 
 static void 
+_policy_border_hide_above(E_Border *bd)
+{
+   int pos = 0, layer = 0, i;
+
+   if (!bd) return;
+
+   /* determine layering position */
+   layer = bd->layer;
+   if (layer < 0) layer = 0;
+   pos = 1 + (layer / 50);
+   if (pos > 10) pos = 10;
+
+   /* Find the windows above this one */
+   for (i = (pos + 1); i < 11; i++)
+     {
+        Eina_List *l;
+        E_Border *b;
+
+        EINA_LIST_REVERSE_FOREACH(bd->zone->container->layers[i].clients, l, b) 
+          {
+             /* skip if it's the same border */
+             if (b == bd) continue;
+
+             /* skip if it's not on this zone */
+             if (b->zone != bd->zone) continue;
+
+             /* skip special borders */
+             if (e_illume_border_is_indicator(b)) continue;
+             if (e_illume_border_is_softkey(b)) continue;
+             if (e_illume_border_is_keyboard(b)) continue;
+             if (e_illume_border_is_quickpanel(b)) continue;
+             if (e_illume_border_is_home(b)) continue;
+
+             e_border_iconify(b);
+          }
+     }
+}
+
+static void 
 _policy_border_hide_below(E_Border *bd) 
 {
-   int pos = 0, i;
-
-//   printf("Hide Borders Below: %s %d %d\n", 
-//          bd->client.icccm.name, bd->x, bd->y);
+   int pos = 0, layer = 0, i;
 
    if (!bd) return;
 
    /* determine layering position */
-   if (bd->layer <= 0) pos = 0;
-   else if ((bd->layer > 0) && (bd->layer <= 50)) pos = 1;
-   else if ((bd->layer > 50) && (bd->layer <= 100)) pos = 2;
-   else if ((bd->layer > 100) && (bd->layer <= 150)) pos = 3;
-   else if ((bd->layer > 150) && (bd->layer <= 200)) pos = 4;
-   else pos = 5;
+   layer = bd->layer;
+   if (layer < 0) layer = 0;
+   pos = 1 + (layer / 50);
+   if (pos > 10) pos = 10;
 
    /* Find the windows below this one */
-   for (i = pos; i >= 2; i--) 
+   for (i = (pos - 1); i >= 0; i--)
      {
         Eina_List *l;
@@ -184,5 +219,5 @@
    Eina_List *l;
    E_Border *prev;
-   int pos = 0, i;
+   int pos = 0, layer = 0, i;
 
 //   printf("Show Borders Below: %s %d %d\n", 
@@ -201,13 +236,11 @@
 
    /* determine layering position */
-   if (bd->layer <= 0) pos = 0;
-   else if ((bd->layer > 0) && (bd->layer <= 50)) pos = 1;
-   else if ((bd->layer > 50) && (bd->layer <= 100)) pos = 2;
-   else if ((bd->layer > 100) && (bd->layer <= 150)) pos = 3;
-   else if ((bd->layer > 150) && (bd->layer <= 200)) pos = 4;
-   else pos = 5;
+   layer = bd->layer;
+   if (layer < 0) layer = 0;
+   pos = 1 + (layer / 50);
+   if (pos > 10) pos = 10;
 
    /* Find the windows below this one */
-   for (i = pos; i >= 2; i--) 
+   for (i = (pos + 1); i < 11; i++)
      {
         E_Border *b;
@@ -1039,7 +1072,7 @@
 _policy_border_add(E_Border *bd) 
 {
-//   printf("Border added: %s\n", bd->client.icccm.class);
-
    if (!bd) return;
+
+//   printf("\nBorder added: %s\n", bd->client.icccm.class);
 
    /* NB: this call sets an atom on the window that specifices the zone.
@@ -1159,5 +1192,5 @@
         if ((ind = e_illume_border_indicator_get(bd->zone))) 
           {
-             /* we have the indicator, show it if needed */
+             /* we have the indicator, hide it if needed */
 	     if (ind->visible) e_illume_border_hide(ind);
           }
@@ -1178,7 +1211,7 @@
 _policy_border_focus_out(E_Border *bd) 
 {
+   if (!bd) return;
+
 //   printf("Border focus out: %s\n", bd->client.icccm.name);
-
-   if (!bd) return;
 
    /* NB: if we got this focus_out event on a deleted border, we check if 
@@ -1202,5 +1235,5 @@
    E_Border *sft;
 
-//   printf("Border Activate: %s\n", bd->client.icccm.name);
+   printf("Border Activate: %s\n", bd->client.icccm.name);
 
    if (!bd) return;
@@ -1707,5 +1740,18 @@
    if (!zone) return;
    if (!(bd = e_illume_border_home_get(zone))) return;
-   _policy_border_set_focus(bd);
+
+   /* if the border was hidden due to layout, we need to unhide */
+   if (!bd->visible) e_illume_border_show(bd);
+
+   if ((bd->iconic) && (!bd->lock_user_iconify)) 
+     e_border_uniconify(bd);
+
+   if (!bd->lock_user_stacking) e_border_raise(bd);
+
+   /* hide the border(s) above this one */
+   _policy_border_hide_above(bd);
+
+   /* focus the border */
+   e_border_focus_set(bd, 1, 1);
 }
 
@@ -1835,5 +1881,5 @@
         h = kbd->border->h;
 
-        /* adjust Y for keyboard visibility because keyboard uses fx_offset */
+        /* adjust for keyboard visibility because keyboard uses fx_offset */
         y = 0;
         if (kbd->border->fx.y <= 0) y = kbd->border->y;