summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--NEWS1
-rw-r--r--data/themes/edc/border.edc63
-rw-r--r--src/bin/e_actions.c8
-rw-r--r--src/bin/e_border.c1622
-rw-r--r--src/bin/e_border.h31
-rw-r--r--src/bin/e_comp.c363
-rw-r--r--src/bin/e_comp.h4
-rw-r--r--src/bin/e_container.c2
-rw-r--r--src/bin/e_container.h4
-rw-r--r--src/bin/e_desklock.c4
-rw-r--r--src/bin/e_dnd.c3
-rw-r--r--src/bin/e_manager.c22
-rw-r--r--src/bin/e_pointer.c91
-rw-r--r--src/bin/e_pointer.h19
-rw-r--r--src/bin/e_shelf.c1
-rw-r--r--src/bin/e_win.c44
-rw-r--r--src/modules/everything/e_mod_main.h1
-rw-r--r--src/modules/everything/evry.c133
-rw-r--r--src/modules/everything/evry_gadget.c15
-rw-r--r--src/modules/fileman/e_fwin.c2
-rw-r--r--src/modules/illume-indicator/e_mod_ind_win.c8
-rw-r--r--src/modules/shot/e_mod_main.c27
-rw-r--r--src/modules/tasks/e_mod_main.c10
-rw-r--r--src/modules/winlist/e_winlist.c11
25 files changed, 1213 insertions, 1280 deletions
diff --git a/ChangeLog b/ChangeLog
index 1e76acb..5204c34 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
12013-04-15 Mike Blumenkrantz
2
3 * window borders now drawn on compositor canvas
4
12013-04-05 Jérémy Zurcher 52013-04-05 Jérémy Zurcher
2 6
3 * added support for systemd halt and poweroff 7 * added support for systemd halt and poweroff
diff --git a/NEWS b/NEWS
index 3cf0eb1..a25ba46 100644
--- a/NEWS
+++ b/NEWS
@@ -126,6 +126,7 @@ Improvements:
126 * shelf gadcon can no longer resize smaller than 16x16, ensuring dnd success 126 * shelf gadcon can no longer resize smaller than 16x16, ensuring dnd success
127 * Don't rely on bash or zsh behavior when starting enlightenment_init and tempget. 127 * Don't rely on bash or zsh behavior when starting enlightenment_init and tempget.
128 * menus are now drawn directly on the compositor canvas 128 * menus are now drawn directly on the compositor canvas
129 * window borders now drawn on compositor canvas
129 130
130Fixes: 131Fixes:
131 * IBar menu didn't allow to configure different icon sources, show contents menu even on empty IBar. 132 * IBar menu didn't allow to configure different icon sources, show contents menu even on empty IBar.
diff --git a/data/themes/edc/border.edc b/data/themes/edc/border.edc
index 28f5d41..d445a47 100644
--- a/data/themes/edc/border.edc
+++ b/data/themes/edc/border.edc
@@ -19,6 +19,8 @@ group { name: "e/widgets/border/default/border";
19 images.image: "sym_up_light_selected.png" COMP; 19 images.image: "sym_up_light_selected.png" COMP;
20 images.image: "glow_round_corners_small.png" COMP; 20 images.image: "glow_round_corners_small.png" COMP;
21 images.image: "knob_round_small_busy.png" COMP; 21 images.image: "knob_round_small_busy.png" COMP;
22 images.image: "screen_circular_shadow.png" COMP;
23 data.item: "shadow" "1";
22 parts { 24 parts {
23 part { name: "client_clip"; type: RECT; 25 part { name: "client_clip"; type: RECT;
24 description { state: "default" 0.0; 26 description { state: "default" 0.0;
@@ -71,7 +73,7 @@ group { name: "e/widgets/border/default/border";
71 fill.smooth: 0; 73 fill.smooth: 0;
72 } 74 }
73 } 75 }
74 part { name: "e.text.title"; type: TEXT; 76 part { name: "e.text.title"; type: TEXT; mouse_events: 0;
75 scale: 1; 77 scale: 1;
76 effect: SHADOW BOTTOM; 78 effect: SHADOW BOTTOM;
77 description { state: "default" 0.0; 79 description { state: "default" 0.0;
@@ -97,7 +99,7 @@ group { name: "e/widgets/border/default/border";
97 visible: 0; 99 visible: 0;
98 } 100 }
99 } 101 }
100 part { name: "title2"; type: TEXT; 102 part { name: "title2"; type: TEXT; mouse_events: 0;
101 scale: 1; 103 scale: 1;
102 effect: SOFT_SHADOW BOTTOM; 104 effect: SOFT_SHADOW BOTTOM;
103 description { state: "default" 0.0; 105 description { state: "default" 0.0;
@@ -141,7 +143,7 @@ group { name: "e/widgets/border/default/border";
141 rel2.relative: 1.0 0.85; 143 rel2.relative: 1.0 0.85;
142 } 144 }
143 } 145 }
144 part { name: "e.swallow.icon"; type: SWALLOW; 146 part { name: "e.swallow.icon"; type: SWALLOW; mouse_events: 0;
145 description { state: "default" 0.0; 147 description { state: "default" 0.0;
146 rel1.to: "icon"; 148 rel1.to: "icon";
147 rel1.relative: 0.15 0.15; 149 rel1.relative: 0.15 0.15;
@@ -150,7 +152,7 @@ group { name: "e/widgets/border/default/border";
150 rel2.offset: 0 0; 152 rel2.offset: 0 0;
151 } 153 }
152 } 154 }
153 part { name: "busy_clip"; type: RECT; 155 part { name: "busy_clip"; type: RECT; mouse_events: 0;
154 description { state: "default" 0.0; 156 description { state: "default" 0.0;
155 color: 255 255 255 0; 157 color: 255 255 255 0;
156 visible: 0; 158 visible: 0;
@@ -194,7 +196,7 @@ group { name: "e/widgets/border/default/border";
194 map.rotation.z: 360; 196 map.rotation.z: 360;
195 } 197 }
196 } 198 }
197 part { name: "clip1"; type: RECT; 199 part { name: "clip1"; type: RECT; mouse_events: 0;
198 description { state: "default" 0.0; 200 description { state: "default" 0.0;
199 rel1.to: "top"; 201 rel1.to: "top";
200 rel2.to: "top"; 202 rel2.to: "top";
@@ -204,7 +206,7 @@ group { name: "e/widgets/border/default/border";
204 visible: 0; 206 visible: 0;
205 } 207 }
206 } 208 }
207 part { name: "clip2"; type: RECT; 209 part { name: "clip2"; type: RECT; mouse_events: 0;
208 description { state: "default" 0.0; 210 description { state: "default" 0.0;
209 rel1.to: "top"; 211 rel1.to: "top";
210 rel2.to: "top"; 212 rel2.to: "top";
@@ -215,7 +217,7 @@ group { name: "e/widgets/border/default/border";
215 visible: 1; 217 visible: 1;
216 } 218 }
217 } 219 }
218 part { name: "close1"; 220 part { name: "close1"; mouse_events: 0;
219 clip_to: "clip1"; 221 clip_to: "clip1";
220 description { state: "default" 0.0; 222 description { state: "default" 0.0;
221 image.normal: "sym_close_dark_normal.png"; 223 image.normal: "sym_close_dark_normal.png";
@@ -230,7 +232,7 @@ group { name: "e/widgets/border/default/border";
230 image.normal: "sym_close_dark_selected.png"; 232 image.normal: "sym_close_dark_selected.png";
231 } 233 }
232 } 234 }
233 part { name: "max1"; 235 part { name: "max1"; mouse_events: 0;
234 clip_to: "clip1"; 236 clip_to: "clip1";
235 description { state: "default" 0.0; 237 description { state: "default" 0.0;
236 image.normal: "sym_up_dark_normal.png"; 238 image.normal: "sym_up_dark_normal.png";
@@ -245,7 +247,7 @@ group { name: "e/widgets/border/default/border";
245 image.normal: "sym_up_dark_selected.png"; 247 image.normal: "sym_up_dark_selected.png";
246 } 248 }
247 } 249 }
248 part { name: "min1"; 250 part { name: "min1"; mouse_events: 0;
249 clip_to: "clip1"; 251 clip_to: "clip1";
250 description { state: "default" 0.0; 252 description { state: "default" 0.0;
251 image.normal: "sym_down_dark_normal.png"; 253 image.normal: "sym_down_dark_normal.png";
@@ -260,7 +262,7 @@ group { name: "e/widgets/border/default/border";
260 image.normal: "sym_down_dark_selected.png"; 262 image.normal: "sym_down_dark_selected.png";
261 } 263 }
262 } 264 }
263 part { name: "close2"; 265 part { name: "close2"; mouse_events: 0;
264 clip_to: "clip2"; 266 clip_to: "clip2";
265 description { state: "default" 0.0; 267 description { state: "default" 0.0;
266 image.normal: "sym_close_light_normal.png"; 268 image.normal: "sym_close_light_normal.png";
@@ -275,7 +277,7 @@ group { name: "e/widgets/border/default/border";
275 image.normal: "sym_close_light_selected.png"; 277 image.normal: "sym_close_light_selected.png";
276 } 278 }
277 } 279 }
278 part { name: "max2"; 280 part { name: "max2"; mouse_events: 0;
279 clip_to: "clip2"; 281 clip_to: "clip2";
280 description { state: "default" 0.0; 282 description { state: "default" 0.0;
281 image.normal: "sym_up_light_normal.png"; 283 image.normal: "sym_up_light_normal.png";
@@ -290,7 +292,7 @@ group { name: "e/widgets/border/default/border";
290 image.normal: "sym_up_light_selected.png"; 292 image.normal: "sym_up_light_selected.png";
291 } 293 }
292 } 294 }
293 part { name: "min2"; 295 part { name: "min2"; mouse_events: 0;
294 clip_to: "clip2"; 296 clip_to: "clip2";
295 description { state: "default" 0.0; 297 description { state: "default" 0.0;
296 image.normal: "sym_down_light_normal.png"; 298 image.normal: "sym_down_light_normal.png";
@@ -389,7 +391,7 @@ group { name: "e/widgets/border/default/border";
389 color: 0 0 0 0; 391 color: 0 0 0 0;
390 } 392 }
391 } 393 }
392 part { name: "bottom"; type: RECT; 394 part { name: "bottom"; type: RECT; mouse_events: 0;
393 description { state: "default" 0.0; 395 description { state: "default" 0.0;
394 color_class: "border_bottom"; 396 color_class: "border_bottom";
395 rel1.relative: 0.0 1.0; 397 rel1.relative: 0.0 1.0;
@@ -410,7 +412,7 @@ group { name: "e/widgets/border/default/border";
410 visible: 0; 412 visible: 0;
411 } 413 }
412 } 414 }
413 part { name: "bevel2"; 415 part { name: "bevel2"; mouse_events: 0;
414 description { state: "default" 0.0; 416 description { state: "default" 0.0;
415 image.normal: "bevel_dark_out.png"; 417 image.normal: "bevel_dark_out.png";
416 image.border: 1 1 1 1; 418 image.border: 1 1 1 1;
@@ -428,6 +430,24 @@ group { name: "e/widgets/border/default/border";
428 visible: 0; 430 visible: 0;
429 } 431 }
430 } 432 }
433 part { name: "shadow";
434 mouse_events: 0;
435 description { state: "default" 0.0;
436 image.normal: "win_shadow.png";
437 image.border: 14 14 14 14;
438 image.middle: 0;
439 rel1.relative: 0.0 1.0;
440 rel1.to: "top";
441 rel1.offset: -7 -3;
442 rel2.to: "bottom";
443 rel2.offset: 6 11;
444 fill.smooth: 0;
445 }
446 description { state: "hidden" 0.0;
447 inherit: "default" 0.0;
448 visible: 0;
449 }
450 }
431 part { name: "e.event.resize.bl"; type: RECT; 451 part { name: "e.event.resize.bl"; type: RECT;
432 description { state: "default" 0.0; 452 description { state: "default" 0.0;
433 rel1.relative: 0.0 1.0; 453 rel1.relative: 0.0 1.0;
@@ -501,9 +521,24 @@ group { name: "e/widgets/border/default/border";
501 FIXED_SIZE(69, 5) 521 FIXED_SIZE(69, 5)
502 } 522 }
503 } 523 }
524 part { name: "events"; type: RECT; repeat_events: 1;
525 description { state: "default";
526 color: 0 0 0 0;
527 }
528 }
504 } 529 }
505 programs { 530 programs {
506 program { 531 program {
532 signal: "e,state,shadow,on"; source: "e";
533 action: STATE_SET "default" 0.0;
534 target: "shadow";
535 }
536 program {
537 signal: "e,state,shadow,off"; source: "e";
538 action: STATE_SET "hidden" 0.0;
539 target: "shadow";
540 }
541 program {
507 signal: "e,state,focused"; source: "e"; 542 signal: "e,state,focused"; source: "e";
508 action: STATE_SET "focused" 0.0; 543 action: STATE_SET "focused" 0.0;
509 target: "top"; 544 target: "top";
diff --git a/src/bin/e_actions.c b/src/bin/e_actions.c
index 038feb3..599df02 100644
--- a/src/bin/e_actions.c
+++ b/src/bin/e_actions.c
@@ -119,9 +119,7 @@ ACT_FN_GO_SIGNAL(window_move, )
119 e_border_signal_move_end((E_Border *)obj, sig, src); 119 e_border_signal_move_end((E_Border *)obj, sig, src);
120 else 120 else
121 { 121 {
122 if (((E_Border *)obj)->moving) 122 if (!((E_Border *)obj)->moving)
123 e_border_signal_move_end((E_Border *)obj, sig, src);
124 else
125 e_border_signal_move_begin((E_Border *)obj, sig, src); 123 e_border_signal_move_begin((E_Border *)obj, sig, src);
126 } 124 }
127 } 125 }
@@ -2488,7 +2486,7 @@ ACT_FN_GO(pointer_resize_push, )
2488 if ((bd->lock_user_size) || (bd->shaded) || (bd->shading) || 2486 if ((bd->lock_user_size) || (bd->shaded) || (bd->shading) ||
2489 (bd->fullscreen) || ((bd->maximized) && (!e_config->allow_manip))) 2487 (bd->fullscreen) || ((bd->maximized) && (!e_config->allow_manip)))
2490 return; 2488 return;
2491 e_pointer_type_push(bd->pointer, bd, params); 2489 e_pointer_type_push(e_comp_get(bd)->pointer, bd, params);
2492 } 2490 }
2493} 2491}
2494 2492
@@ -2504,7 +2502,7 @@ ACT_FN_GO(pointer_resize_pop, )
2504 if ((bd->lock_user_size) || (bd->shaded) || (bd->shading) || 2502 if ((bd->lock_user_size) || (bd->shaded) || (bd->shading) ||
2505 (bd->fullscreen) || ((bd->maximized) && (!e_config->allow_manip))) 2503 (bd->fullscreen) || ((bd->maximized) && (!e_config->allow_manip)))
2506 return; 2504 return;
2507 e_pointer_type_pop(bd->pointer, bd, params); 2505 e_pointer_type_pop(e_comp_get(bd)->pointer, bd, params);
2508 } 2506 }
2509} 2507}
2510 2508
diff --git a/src/bin/e_border.c b/src/bin/e_border.c
index 9c90aee..cbf277f 100644
--- a/src/bin/e_border.c
+++ b/src/bin/e_border.c
@@ -3,18 +3,6 @@
3//#define INOUTDEBUG_MOUSE 1 3//#define INOUTDEBUG_MOUSE 1
4//#define INOUTDEBUG_FOCUS 1 4//#define INOUTDEBUG_FOCUS 1
5 5
6/* These are compatible with netwm */
7#define RESIZE_TL 0
8#define RESIZE_T 1
9#define RESIZE_TR 2
10#define RESIZE_R 3
11#define RESIZE_BR 4
12#define RESIZE_B 5
13#define RESIZE_BL 6
14#define RESIZE_L 7
15#define MOVE 8
16#define RESIZE_NONE 11
17
18/* local subsystem functions */ 6/* local subsystem functions */
19static void _e_border_pri_raise(E_Border *bd); 7static void _e_border_pri_raise(E_Border *bd);
20static void _e_border_pri_norm(E_Border *bd); 8static void _e_border_pri_norm(E_Border *bd);
@@ -29,6 +17,8 @@ static void _e_border_print(E_Border *bd,
29 const char *func); 17 const char *func);
30#endif 18#endif
31 19
20static void _e_border_shadow(E_Border *bd);
21
32/* FIXME: these likely belong in a separate icccm/client handler */ 22/* FIXME: these likely belong in a separate icccm/client handler */
33/* and the border needs to become a dumb object that just does what its */ 23/* and the border needs to become a dumb object that just does what its */
34/* told to do */ 24/* told to do */
@@ -101,24 +91,6 @@ static void _e_border_cb_signal_bind(void *data,
101 Evas_Object *obj, 91 Evas_Object *obj,
102 const char *emission, 92 const char *emission,
103 const char *source); 93 const char *source);
104static Eina_Bool _e_border_cb_mouse_in(void *data,
105 int type,
106 void *event);
107static Eina_Bool _e_border_cb_mouse_out(void *data,
108 int type,
109 void *event);
110static Eina_Bool _e_border_cb_mouse_wheel(void *data,
111 int type,
112 void *event);
113static Eina_Bool _e_border_cb_mouse_down(void *data,
114 int type,
115 void *event);
116static Eina_Bool _e_border_cb_mouse_up(void *data,
117 int type,
118 void *event);
119static Eina_Bool _e_border_cb_mouse_move(void *data,
120 int type,
121 void *event);
122static Eina_Bool _e_border_cb_grab_replay(void *data, 94static Eina_Bool _e_border_cb_grab_replay(void *data,
123 int type, 95 int type,
124 void *event); 96 void *event);
@@ -193,23 +165,22 @@ static void _e_border_move_update(E_Border *bd);
193static Eina_Bool _e_border_cb_ping_poller(void *data); 165static Eina_Bool _e_border_cb_ping_poller(void *data);
194static Eina_Bool _e_border_cb_kill_timer(void *data); 166static Eina_Bool _e_border_cb_kill_timer(void *data);
195 167
196static void _e_border_pointer_resize_begin(E_Border *bd);
197static void _e_border_pointer_resize_end(E_Border *bd);
198static void _e_border_pointer_move_begin(E_Border *bd);
199static void _e_border_pointer_move_end(E_Border *bd);
200
201static void _e_border_hook_call(E_Border_Hook_Point hookpoint, 168static void _e_border_hook_call(E_Border_Hook_Point hookpoint,
202 void *bd); 169 void *bd);
203 170
204static void _e_border_client_move_resize_send(E_Border *bd); 171static void _e_border_client_move_resize_send(E_Border *bd);
205 172
206static void _e_border_frame_replace(E_Border *bd,
207 Eina_Bool argb);
208
209static void _e_border_shape_input_rectangle_set(E_Border *bd); 173static void _e_border_shape_input_rectangle_set(E_Border *bd);
210static void _e_border_show(E_Border *bd); 174static void _e_border_show(E_Border *bd);
211static void _e_border_hide(E_Border *bd); 175static void _e_border_hide(E_Border *bd);
212 176
177static Eina_Bool _e_border_cb_mouse_x_wheel(void *d EINA_UNUSED, int t, Ecore_Event_Mouse_Wheel *ev);
178static Eina_Bool _e_border_cb_mouse_x_up(void *d EINA_UNUSED, int t, Ecore_Event_Mouse_Button *ev);
179static Eina_Bool _e_border_cb_mouse_x_down(void *d EINA_UNUSED, int t, Ecore_Event_Mouse_Button *ev);
180static Eina_Bool _e_border_cb_mouse_x_move(void *d, int t EINA_UNUSED, Ecore_Event_Mouse_Move *ev);
181static Eina_Bool _e_border_cb_mouse_x_in(void *d, int t EINA_UNUSED, Ecore_X_Event_Mouse_In *ev);
182static Eina_Bool _e_border_cb_mouse_x_out(void *d, int t EINA_UNUSED, Ecore_X_Event_Mouse_Out *ev);
183
213static void _e_border_move_lost_window_to_center(E_Border *bd); 184static void _e_border_move_lost_window_to_center(E_Border *bd);
214static void _e_border_reset_lost_window(E_Border *bd); 185static void _e_border_reset_lost_window(E_Border *bd);
215static Eina_Bool _e_border_pointer_warp_to_center_timer(void *data); 186static Eina_Bool _e_border_pointer_warp_to_center_timer(void *data);
@@ -269,8 +240,7 @@ EAPI int E_EVENT_BORDER_FULLSCREEN = 0;
269EAPI int E_EVENT_BORDER_UNFULLSCREEN = 0; 240EAPI int E_EVENT_BORDER_UNFULLSCREEN = 0;
270 241
271#define GRAV_SET(bd, grav) \ 242#define GRAV_SET(bd, grav) \
272 ecore_x_window_gravity_set(bd->bg_win, grav); \ 243 ecore_x_window_gravity_set(bd->win, grav); \
273 ecore_x_window_gravity_set(bd->client.shell_win, grav); \
274 if (bd->client.lock_win) ecore_x_window_gravity_set(bd->client.lock_win, grav); \ 244 if (bd->client.lock_win) ecore_x_window_gravity_set(bd->client.lock_win, grav); \
275 ecore_x_window_gravity_set(bd->client.win, grav); 245 ecore_x_window_gravity_set(bd->client.win, grav);
276 246
@@ -328,6 +298,18 @@ e_border_init(void)
328 _e_border_cb_desktop_change, NULL); 298 _e_border_cb_desktop_change, NULL);
329 E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_SYNC_ALARM, 299 E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_SYNC_ALARM,
330 _e_border_cb_sync_alarm, NULL); 300 _e_border_cb_sync_alarm, NULL);
301 E_LIST_HANDLER_APPEND(handlers, ECORE_EVENT_MOUSE_BUTTON_DOWN,
302 _e_border_cb_mouse_x_down, NULL);
303 E_LIST_HANDLER_APPEND(handlers, ECORE_EVENT_MOUSE_BUTTON_UP,
304 _e_border_cb_mouse_x_up, NULL);
305 E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_MOUSE_IN,
306 _e_border_cb_mouse_x_in, NULL);
307 E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_MOUSE_OUT,
308 _e_border_cb_mouse_x_out, NULL);
309 E_LIST_HANDLER_APPEND(handlers, ECORE_EVENT_MOUSE_WHEEL,
310 _e_border_cb_mouse_x_wheel, NULL);
311 E_LIST_HANDLER_APPEND(handlers, ECORE_EVENT_MOUSE_MOVE,
312 _e_border_cb_mouse_x_move, NULL);
331 313
332 ecore_x_passive_grab_replay_func_set(_e_border_cb_grab_replay, NULL); 314 ecore_x_passive_grab_replay_func_set(_e_border_cb_grab_replay, NULL);
333 315
@@ -421,6 +403,7 @@ e_border_new(E_Container *con,
421 bd->h = 1; 403 bd->h = 1;
422 /* FIXME: ewww - round trip */ 404 /* FIXME: ewww - round trip */
423 bd->client.argb = ecore_x_window_argb_get(win); 405 bd->client.argb = ecore_x_window_argb_get(win);
406 /* match bd parent argbness */
424 if (bd->client.argb) 407 if (bd->client.argb)
425 bd->win = ecore_x_window_manager_argb_new(con->win, 0, 0, bd->w, bd->h); 408 bd->win = ecore_x_window_manager_argb_new(con->win, 0, 0, bd->w, bd->h);
426 else 409 else
@@ -431,37 +414,27 @@ e_border_new(E_Container *con,
431 e_bindings_mouse_grab(E_BINDING_CONTEXT_WINDOW, bd->win); 414 e_bindings_mouse_grab(E_BINDING_CONTEXT_WINDOW, bd->win);
432 e_bindings_wheel_grab(E_BINDING_CONTEXT_WINDOW, bd->win); 415 e_bindings_wheel_grab(E_BINDING_CONTEXT_WINDOW, bd->win);
433 e_focus_setup(bd); 416 e_focus_setup(bd);
434 bd->bg_ecore_evas = e_canvas_new(bd->win,
435 0, 0, bd->w, bd->h, 1, 0,
436 &(bd->bg_win));
437 ecore_evas_ignore_events_set(bd->bg_ecore_evas, EINA_TRUE);
438 e_canvas_add(bd->bg_ecore_evas);
439 bd->event_win = ecore_x_window_input_new(bd->win, 0, 0, bd->w, bd->h);
440 bd->bg_evas = ecore_evas_get(bd->bg_ecore_evas);
441 ecore_x_window_shape_events_select(bd->bg_win, 1);
442 ecore_evas_name_class_set(bd->bg_ecore_evas, "E", "Frame_Window");
443 ecore_evas_title_set(bd->bg_ecore_evas, "Enlightenment Frame");
444 if (bd->client.argb)
445 bd->client.shell_win = ecore_x_window_manager_argb_new(bd->win, 0, 0, 1, 1);
446 else
447 bd->client.shell_win = ecore_x_window_override_new(bd->win, 0, 0, 1, 1);
448 ecore_x_window_container_manage(bd->client.shell_win);
449 if (!internal) ecore_x_window_client_manage(win);
450 /* FIXME: Round trip. XCB */ 417 /* FIXME: Round trip. XCB */
451 /* fetch needed to avoid grabbing the server as window may vanish */ 418 /* fetch needed to avoid grabbing the server as window may vanish */
452 att = &bd->client.initial_attributes; 419 att = &bd->client.initial_attributes;
453 if ((!ecore_x_window_attributes_get(win, att)) || (att->input_only)) 420 if ((!ecore_x_window_attributes_get(win, att)) || (att->input_only))
454 { 421 {
455 // printf("##- ATTR FETCH FAILED/INPUT ONLY FOR 0x%x - ABORT MANAGE\n", win); 422 // printf("##- ATTR FETCH FAILED/INPUT ONLY FOR 0x%x - ABORT MANAGE\n", win);
456 e_canvas_del(bd->bg_ecore_evas); 423 ecore_x_window_free(bd->win);
457 ecore_evas_free(bd->bg_ecore_evas);
458 ecore_x_window_free(bd->client.shell_win);
459 e_bindings_mouse_ungrab(E_BINDING_CONTEXT_WINDOW, bd->win); 424 e_bindings_mouse_ungrab(E_BINDING_CONTEXT_WINDOW, bd->win);
460 e_bindings_wheel_ungrab(E_BINDING_CONTEXT_WINDOW, bd->win); 425 e_bindings_wheel_ungrab(E_BINDING_CONTEXT_WINDOW, bd->win);
461 ecore_x_window_free(bd->win); 426 ecore_x_window_free(bd->win);
462 free(bd); 427 free(bd);
463 return NULL; 428 return NULL;
464 } 429 }
430 ecore_x_window_container_manage(bd->win);
431 if (!internal) ecore_x_window_client_manage(win);
432 ecore_x_window_configure(bd->win,
433 ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING |
434 ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE,
435 0, 0, 0, 0, 0,
436 win, ECORE_X_WINDOW_STACK_BELOW);
437 ecore_x_event_mask_set(bd->win, ECORE_X_EVENT_MASK_MOUSE_IN | ECORE_X_EVENT_MASK_MOUSE_OUT);
465 438
466 /* printf("##- ON MAP CLIENT 0x%x SIZE %ix%i %i:%i\n", 439 /* printf("##- ON MAP CLIENT 0x%x SIZE %ix%i %i:%i\n",
467 * bd->client.win, bd->client.w, bd->client.h, att->x, att->y); */ 440 * bd->client.win, bd->client.w, bd->client.h, att->x, att->y); */
@@ -485,19 +458,6 @@ e_border_new(E_Container *con,
485 458
486 _e_border_hook_call(E_BORDER_HOOK_NEW_BORDER, bd); 459 _e_border_hook_call(E_BORDER_HOOK_NEW_BORDER, bd);
487 460
488 E_LIST_HANDLER_APPEND(bd->handlers, ECORE_X_EVENT_MOUSE_IN,
489 _e_border_cb_mouse_in, bd);
490 E_LIST_HANDLER_APPEND(bd->handlers, ECORE_X_EVENT_MOUSE_OUT,
491 _e_border_cb_mouse_out, bd);
492 E_LIST_HANDLER_APPEND(bd->handlers, ECORE_EVENT_MOUSE_BUTTON_DOWN,
493 _e_border_cb_mouse_down, bd);
494 E_LIST_HANDLER_APPEND(bd->handlers, ECORE_EVENT_MOUSE_BUTTON_UP,
495 _e_border_cb_mouse_up, bd);
496 E_LIST_HANDLER_APPEND(bd->handlers, ECORE_EVENT_MOUSE_MOVE,
497 _e_border_cb_mouse_move, bd);
498 E_LIST_HANDLER_APPEND(bd->handlers, ECORE_EVENT_MOUSE_WHEEL,
499 _e_border_cb_mouse_wheel, bd);
500
501 bd->client.icccm.title = NULL; 461 bd->client.icccm.title = NULL;
502 bd->client.icccm.name = NULL; 462 bd->client.icccm.name = NULL;
503 bd->client.icccm.class = NULL; 463 bd->client.icccm.class = NULL;
@@ -700,7 +660,7 @@ e_border_new(E_Container *con,
700 bd->w = bd->client.w; 660 bd->w = bd->client.w;
701 bd->h = bd->client.h; 661 bd->h = bd->client.h;
702 662
703 bd->resize_mode = RESIZE_NONE; 663 bd->resize_mode = E_POINTER_RESIZE_NONE;
704 bd->layer = 100; 664 bd->layer = 100;
705 bd->saved.layer = bd->layer; 665 bd->saved.layer = bd->layer;
706 bd->changes.icon = 1; 666 bd->changes.icon = 1;
@@ -713,17 +673,15 @@ e_border_new(E_Container *con,
713 /* just to friggin make java happy - we're DELAYING the reparent until 673 /* just to friggin make java happy - we're DELAYING the reparent until
714 * eval time... 674 * eval time...
715 */ 675 */
716/* ecore_x_window_reparent(win, bd->client.shell_win, 0, 0); */ 676/* ecore_x_window_reparent(win, bd->win, 0, 0); */
717 bd->need_reparent = 1; 677 bd->need_reparent = 1;
718 678
719 ecore_x_window_border_width_set(win, 0); 679 ecore_x_window_border_width_set(win, 0);
720 ecore_x_window_show(bd->event_win);
721 ecore_x_window_show(bd->client.shell_win);
722 bd->shape = e_container_shape_add(con); 680 bd->shape = e_container_shape_add(con);
723 681
724 bd->take_focus = 1; 682 bd->take_focus = 1;
725 bd->new_client = 1; 683 bd->new_client = 1;
726 bd->changed = 1; 684 BD_CHANGED(bd);
727 685
728// bd->zone = e_zone_current_get(con); 686// bd->zone = e_zone_current_get(con);
729 bd->desk = e_desk_current_get(bd->zone); 687 bd->desk = e_desk_current_get(bd->zone);
@@ -748,11 +706,9 @@ e_border_new(E_Container *con,
748 bd2->client.win); 706 bd2->client.win);
749#endif 707#endif
750 eina_hash_del(borders_hash, e_util_winid_str_get(bd->client.win), bd2); 708 eina_hash_del(borders_hash, e_util_winid_str_get(bd->client.win), bd2);
751 eina_hash_del(borders_hash, e_util_winid_str_get(bd2->bg_win), bd2);
752 eina_hash_del(borders_hash, e_util_winid_str_get(bd2->win), bd2); 709 eina_hash_del(borders_hash, e_util_winid_str_get(bd2->win), bd2);
753 } 710 }
754 eina_hash_add(borders_hash, e_util_winid_str_get(bd->client.win), bd); 711 eina_hash_add(borders_hash, e_util_winid_str_get(bd->client.win), bd);
755 eina_hash_add(borders_hash, e_util_winid_str_get(bd->bg_win), bd);
756 eina_hash_add(borders_hash, e_util_winid_str_get(bd->win), bd); 712 eina_hash_add(borders_hash, e_util_winid_str_get(bd->win), bd);
757 managed = 1; 713 managed = 1;
758 ecore_x_window_prop_card32_set(win, E_ATOM_MANAGED, &managed, 1); 714 ecore_x_window_prop_card32_set(win, E_ATOM_MANAGED, &managed, 1);
@@ -774,7 +730,6 @@ e_border_new(E_Container *con,
774 730
775 focus_stack = eina_list_append(focus_stack, bd); 731 focus_stack = eina_list_append(focus_stack, bd);
776 732
777 bd->pointer = e_pointer_window_new(bd->win, 0);
778 return bd; 733 return bd;
779} 734}
780 735
@@ -1048,10 +1003,10 @@ e_border_hide(E_Border *bd,
1048 ecore_x_window_shadow_tree_flush(); 1003 ecore_x_window_shadow_tree_flush();
1049 if (bd->moving) 1004 if (bd->moving)
1050 _e_border_move_end(bd); 1005 _e_border_move_end(bd);
1051 if (bd->resize_mode != RESIZE_NONE) 1006 if (bd->resize_mode != E_POINTER_RESIZE_NONE)
1052 { 1007 {
1053 _e_border_pointer_resize_end(bd); 1008 e_pointer_mode_pop(bd, bd->resize_mode);
1054 bd->resize_mode = RESIZE_NONE; 1009 bd->resize_mode = E_POINTER_RESIZE_NONE;
1055 _e_border_resize_end(bd); 1010 _e_border_resize_end(bd);
1056 } 1011 }
1057 1012
@@ -1122,6 +1077,7 @@ send_event:
1122 1077
1123 ev = E_NEW(E_Event_Border_Hide, 1); 1078 ev = E_NEW(E_Event_Border_Hide, 1);
1124 ev->border = bd; 1079 ev->border = bd;
1080 ev->manage = manage;
1125 e_object_ref(E_OBJECT(bd)); 1081 e_object_ref(E_OBJECT(bd));
1126// e_object_breadcrumb_add(E_OBJECT(bd), "border_hide_event"); 1082// e_object_breadcrumb_add(E_OBJECT(bd), "border_hide_event");
1127 ecore_event_add(E_EVENT_BORDER_HIDE, ev, _e_border_event_border_hide_free, NULL); 1083 ecore_event_add(E_EVENT_BORDER_HIDE, ev, _e_border_event_border_hide_free, NULL);
@@ -1207,107 +1163,12 @@ _e_border_pri_norm(E_Border *bd)
1207} 1163}
1208 1164
1209static void 1165static void
1210_e_border_frame_replace(E_Border *bd, Eina_Bool argb)
1211{
1212 Ecore_X_Window win;
1213 Ecore_Evas *bg_ecore_evas;
1214 char buf[4096];
1215
1216 bd->argb = argb;
1217
1218 win = bd->win;
1219 bg_ecore_evas = bd->bg_ecore_evas;
1220
1221 /* unregister old frame window */
1222 eina_hash_del(borders_hash, e_util_winid_str_get(bd->bg_win), bd);
1223 eina_hash_del(borders_hash, e_util_winid_str_get(bd->win), bd);
1224
1225 e_focus_setdown(bd);
1226 e_bindings_mouse_ungrab(E_BINDING_CONTEXT_WINDOW, bd->win);
1227 e_bindings_wheel_ungrab(E_BINDING_CONTEXT_WINDOW, bd->win);
1228
1229 if (bd->icon_object)
1230 evas_object_del(bd->icon_object);
1231
1232 evas_object_del(bd->bg_object);
1233 e_canvas_del(bg_ecore_evas);
1234 ecore_evas_free(bg_ecore_evas);
1235
1236 if (bd->pointer)
1237 e_object_del(E_OBJECT(bd->pointer));
1238
1239 /* create new frame */
1240 if (argb)
1241 bd->win = ecore_x_window_manager_argb_new(bd->zone->container->win,
1242 bd->x, bd->y, bd->w, bd->h);
1243 else
1244 {
1245 bd->win = ecore_x_window_override_new(bd->zone->container->win,
1246 bd->x, bd->y, bd->w, bd->h);
1247 ecore_x_window_shape_events_select(bd->win, 1);
1248 }
1249
1250 ecore_x_window_configure(bd->win,
1251 ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING |
1252 ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE,
1253 0, 0, 0, 0, 0,
1254 win, ECORE_X_WINDOW_STACK_BELOW);
1255
1256 e_bindings_mouse_grab(E_BINDING_CONTEXT_WINDOW, bd->win);
1257 e_bindings_wheel_grab(E_BINDING_CONTEXT_WINDOW, bd->win);
1258 e_focus_setup(bd);
1259
1260 bd->bg_ecore_evas = e_canvas_new(bd->win,
1261 0, 0, bd->w, bd->h, 1, 0,
1262 &(bd->bg_win));
1263
1264 e_canvas_add(bd->bg_ecore_evas);
1265 ecore_x_window_reparent(bd->event_win, bd->win, 0, 0);
1266
1267 bd->bg_evas = ecore_evas_get(bd->bg_ecore_evas);
1268 ecore_evas_name_class_set(bd->bg_ecore_evas, "E", "Frame_Window");
1269 ecore_evas_title_set(bd->bg_ecore_evas, "Enlightenment Frame");
1270
1271 ecore_x_window_shape_events_select(bd->bg_win, 1);
1272
1273 /* move client with shell win over to new frame */
1274 ecore_x_window_reparent(bd->client.shell_win, bd->win,
1275 bd->client_inset.l, bd->client_inset.t);
1276
1277 bd->pointer = e_pointer_window_new(bd->win, 0);
1278
1279 eina_hash_add(borders_hash, e_util_winid_str_get(bd->bg_win), bd);
1280 eina_hash_add(borders_hash, e_util_winid_str_get(bd->win), bd);
1281
1282 if (bd->visible)
1283 {
1284 E_Border *tmp;
1285 Eina_List *l;
1286
1287 ecore_evas_show(bd->bg_ecore_evas);
1288 ecore_x_window_show(bd->win);
1289
1290 EINA_LIST_FOREACH(bd->client.e.state.video_child, l, tmp)
1291 ecore_x_window_show(tmp->win);
1292 }
1293
1294 bd->bg_object = edje_object_add(bd->bg_evas);
1295 snprintf(buf, sizeof(buf), "e/widgets/border/%s/border", bd->client.border.name);
1296 e_theme_edje_object_set(bd->bg_object, "base/theme/borders", buf);
1297
1298 bd->icon_object = e_border_icon_add(bd, bd->bg_evas);
1299
1300 /* cleanup old frame */
1301 ecore_x_window_free(win);
1302}
1303
1304static void
1305_e_border_client_move_resize_send(E_Border *bd) 1166_e_border_client_move_resize_send(E_Border *bd)
1306{ 1167{
1307 if (bd->internal_ecore_evas) 1168 if (bd->internal_ecore_evas)
1308 ecore_evas_managed_move(bd->internal_ecore_evas, 1169 ecore_evas_managed_move(bd->internal_ecore_evas,
1309 bd->x + bd->fx.x + bd->client_inset.l, 1170 bd->client_inset.l,
1310 bd->y + bd->fx.y + bd->client_inset.t); 1171 bd->client_inset.t);
1311 1172
1312 ecore_x_icccm_move_resize_send(bd->client.win, 1173 ecore_x_icccm_move_resize_send(bd->client.win,
1313 bd->x + bd->fx.x + bd->client_inset.l, 1174 bd->x + bd->fx.x + bd->client_inset.l,
@@ -1400,7 +1261,7 @@ _e_border_move_internal(E_Border *bd,
1400 bd->pre_res_change.valid = 0; 1261 bd->pre_res_change.valid = 0;
1401 bd->x = x; 1262 bd->x = x;
1402 bd->y = y; 1263 bd->y = y;
1403 bd->changed = 1; 1264 BD_CHANGED(bd);
1404 bd->changes.pos = 1; 1265 bd->changes.pos = 1;
1405#if 0 1266#if 0
1406 if (bd->client.netwm.sync.request) 1267 if (bd->client.netwm.sync.request)
@@ -1596,7 +1457,7 @@ _e_border_move_resize_internal(E_Border *bd,
1596 bd->client.w = bd->w - (bd->client_inset.l + bd->client_inset.r); 1457 bd->client.w = bd->w - (bd->client_inset.l + bd->client_inset.r);
1597 bd->client.h = bd->h - (bd->client_inset.t + bd->client_inset.b); 1458 bd->client.h = bd->h - (bd->client_inset.t + bd->client_inset.b);
1598 1459
1599 if ((bd->shaped) || (bd->client.shaped)) 1460 if (bd->client.shaped)
1600 { 1461 {
1601 bd->need_shape_merge = 1; 1462 bd->need_shape_merge = 1;
1602 bd->need_shape_export = 1; 1463 bd->need_shape_export = 1;
@@ -1608,7 +1469,7 @@ _e_border_move_resize_internal(E_Border *bd,
1608 1469
1609 if (bd->internal_ecore_evas) 1470 if (bd->internal_ecore_evas)
1610 { 1471 {
1611 bd->changed = 1; 1472 BD_CHANGED(bd);
1612 bd->changes.size = 1; 1473 bd->changes.size = 1;
1613 } 1474 }
1614 else 1475 else
@@ -1626,7 +1487,7 @@ _e_border_move_resize_internal(E_Border *bd,
1626 } 1487 }
1627 else 1488 else
1628 { 1489 {
1629 bd->changed = 1; 1490 BD_CHANGED(bd);
1630 bd->changes.size = 1; 1491 bd->changes.size = 1;
1631 } 1492 }
1632 } 1493 }
@@ -2230,7 +2091,7 @@ e_border_focus_set(E_Border *bd,
2230 if (bd->visible && bd->changes.visible) 2091 if (bd->visible && bd->changes.visible)
2231 { 2092 {
2232 bd->want_focus = 1; 2093 bd->want_focus = 1;
2233 bd->changed = 1; 2094 BD_CHANGED(bd);
2234 } 2095 }
2235 else if ((!bd->focused) || 2096 else if ((!bd->focused) ||
2236 (focus_next && (bd != eina_list_data_get(focus_next)))) 2097 (focus_next && (bd != eina_list_data_get(focus_next))))
@@ -2455,7 +2316,7 @@ e_border_shade(E_Border *bd,
2455 bd->shade.start = ecore_loop_time_get(); 2316 bd->shade.start = ecore_loop_time_get();
2456 bd->shading = 1; 2317 bd->shading = 1;
2457 bd->changes.shading = 1; 2318 bd->changes.shading = 1;
2458 bd->changed = 1; 2319 BD_CHANGED(bd);
2459 2320
2460 if (bd->shade.dir == E_DIRECTION_UP || 2321 if (bd->shade.dir == E_DIRECTION_UP ||
2461 bd->shade.dir == E_DIRECTION_LEFT) 2322 bd->shade.dir == E_DIRECTION_LEFT)
@@ -2495,7 +2356,7 @@ e_border_shade(E_Border *bd,
2495 bd->changes.pos = 1; 2356 bd->changes.pos = 1;
2496 } 2357 }
2497 2358
2498 if ((bd->shaped) || (bd->client.shaped)) 2359 if (bd->client.shaped)
2499 { 2360 {
2500 bd->need_shape_merge = 1; 2361 bd->need_shape_merge = 1;
2501 bd->need_shape_export = 1; 2362 bd->need_shape_export = 1;
@@ -2508,7 +2369,7 @@ e_border_shade(E_Border *bd,
2508 bd->changes.size = 1; 2369 bd->changes.size = 1;
2509 bd->shaded = 1; 2370 bd->shaded = 1;
2510 bd->changes.shaded = 1; 2371 bd->changes.shaded = 1;
2511 bd->changed = 1; 2372 BD_CHANGED(bd);
2512 edje_object_signal_emit(bd->bg_object, "e,state,shaded", "e"); 2373 edje_object_signal_emit(bd->bg_object, "e,state,shaded", "e");
2513 e_border_frame_recalc(bd); 2374 e_border_frame_recalc(bd);
2514 ev = E_NEW(E_Event_Border_Resize, 1); 2375 ev = E_NEW(E_Event_Border_Resize, 1);
@@ -2562,7 +2423,7 @@ e_border_unshade(E_Border *bd,
2562 bd->shade.start = ecore_loop_time_get(); 2423 bd->shade.start = ecore_loop_time_get();
2563 bd->shading = 1; 2424 bd->shading = 1;
2564 bd->changes.shading = 1; 2425 bd->changes.shading = 1;
2565 bd->changed = 1; 2426 BD_CHANGED(bd);
2566 2427
2567 if (bd->shade.dir == E_DIRECTION_UP) 2428 if (bd->shade.dir == E_DIRECTION_UP)
2568 { 2429 {
@@ -2585,14 +2446,14 @@ e_border_unshade(E_Border *bd,
2585 ecore_x_window_gravity_set(bd->client.win, ECORE_X_GRAVITY_SW); 2446 ecore_x_window_gravity_set(bd->client.win, ECORE_X_GRAVITY_SW);
2586 ecore_x_window_move_resize(bd->client.win, 2447 ecore_x_window_move_resize(bd->client.win,
2587 bd->w - (bd->client_inset.l + bd->client_inset.r) - 2448 bd->w - (bd->client_inset.l + bd->client_inset.r) -
2588 bd->client.h, 2449 bd->client.w,
2589 0, bd->client.w, bd->client.h); 2450 0, bd->client.w, bd->client.h);
2590 if (bd->client.lock_win) 2451 if (bd->client.lock_win)
2591 { 2452 {
2592 ecore_x_window_gravity_set(bd->client.lock_win, ECORE_X_GRAVITY_SW); 2453 ecore_x_window_gravity_set(bd->client.lock_win, ECORE_X_GRAVITY_SW);
2593 ecore_x_window_move_resize(bd->client.lock_win, 2454 ecore_x_window_move_resize(bd->client.lock_win,
2594 bd->w - (bd->client_inset.l + bd->client_inset.r) - 2455 bd->w - (bd->client_inset.l + bd->client_inset.r) -
2595 bd->client.h, 2456 bd->client.w,
2596 0, bd->client.w, bd->client.h); 2457 0, bd->client.w, bd->client.h);
2597 } 2458 }
2598 } 2459 }
@@ -2627,7 +2488,7 @@ e_border_unshade(E_Border *bd,
2627 bd->x = bd->x - bd->client.w; 2488 bd->x = bd->x - bd->client.w;
2628 bd->changes.pos = 1; 2489 bd->changes.pos = 1;
2629 } 2490 }
2630 if ((bd->shaped) || (bd->client.shaped)) 2491 if (bd->client.shaped)
2631 { 2492 {
2632 bd->need_shape_merge = 1; 2493 bd->need_shape_merge = 1;
2633 bd->need_shape_export = 1; 2494 bd->need_shape_export = 1;
@@ -2640,7 +2501,7 @@ e_border_unshade(E_Border *bd,
2640 bd->changes.size = 1; 2501 bd->changes.size = 1;
2641 bd->shaded = 0; 2502 bd->shaded = 0;
2642 bd->changes.shaded = 1; 2503 bd->changes.shaded = 1;
2643 bd->changed = 1; 2504 BD_CHANGED(bd);
2644 edje_object_signal_emit(bd->bg_object, "e,state,unshaded", "e"); 2505 edje_object_signal_emit(bd->bg_object, "e,state,unshaded", "e");
2645 e_border_frame_recalc(bd); 2506 e_border_frame_recalc(bd);
2646 ev = E_NEW(E_Event_Border_Resize, 1); 2507 ev = E_NEW(E_Event_Border_Resize, 1);
@@ -2658,18 +2519,25 @@ e_border_unshade(E_Border *bd,
2658static void 2519static void
2659_e_border_client_inset_calc(E_Border *bd) 2520_e_border_client_inset_calc(E_Border *bd)
2660{ 2521{
2661 int cx, cy, cw, ch; 2522 int w, h, cx, cy, cw, ch;
2662 2523
2663 if (bd->bg_object) 2524 if (bd->bg_object)
2664 { 2525 {
2665 evas_object_resize(bd->bg_object, MAX(bd->w, 500), MAX(bd->h, 500)); 2526 Evas_Object *layout;
2527
2528 layout = e_comp_get(bd)->layout;
2529 if (layout) e_layout_freeze(layout);
2530 evas_object_geometry_get(bd->bg_object, NULL, NULL, &w, &h);
2531 evas_object_resize(bd->bg_object, MAX(w, 50), MAX(h, 50));
2666 edje_object_message_signal_process(bd->bg_object); 2532 edje_object_message_signal_process(bd->bg_object);
2667 edje_object_calc_force(bd->bg_object); 2533 edje_object_calc_force(bd->bg_object);
2668 edje_object_part_geometry_get(bd->bg_object, "e.swallow.client", &cx, &cy, &cw, &ch); 2534 edje_object_part_geometry_get(bd->bg_object, "e.swallow.client", &cx, &cy, &cw, &ch);
2669 bd->client_inset.l = cx; 2535 bd->client_inset.l = cx;
2670 bd->client_inset.r = MAX(bd->w, 500) - (cx + cw); 2536 bd->client_inset.r = MAX(w, 50) - (cx + cw);
2671 bd->client_inset.t = cy; 2537 bd->client_inset.t = cy;
2672 bd->client_inset.b = MAX(bd->h, 500) - (cy + ch); 2538 bd->client_inset.b = MAX(h, 50) - (cy + ch);
2539 evas_object_resize(bd->bg_object, w, h);
2540 if (layout) e_layout_thaw(layout);
2673 } 2541 }
2674 else 2542 else
2675 { 2543 {
@@ -2685,6 +2553,7 @@ _e_border_client_inset_calc(E_Border *bd)
2685 ecore_x_e_frame_size_set(bd->client.win, 2553 ecore_x_e_frame_size_set(bd->client.win,
2686 bd->client_inset.l, bd->client_inset.r, 2554 bd->client_inset.l, bd->client_inset.r,
2687 bd->client_inset.t, bd->client_inset.b); 2555 bd->client_inset.t, bd->client_inset.b);
2556 bd->client_inset.calc = 1;
2688} 2557}
2689 2558
2690static void 2559static void
@@ -3131,9 +3000,10 @@ e_border_fullscreen(E_Border *bd,
3131 e_hints_window_fullscreen_set(bd, 1); 3000 e_hints_window_fullscreen_set(bd, 1);
3132 e_hints_window_size_unset(bd); 3001 e_hints_window_size_unset(bd);
3133 bd->client.border.changed = 1; 3002 bd->client.border.changed = 1;
3134 bd->changed = 1; 3003 BD_CHANGED(bd);
3135 } 3004 }
3136 bd->fullscreen_policy = policy; 3005 bd->fullscreen_policy = policy;
3006 _e_border_shadow(bd);
3137 3007
3138 ev = E_NEW(E_Event_Border_Fullscreen, 1); 3008 ev = E_NEW(E_Event_Border_Fullscreen, 1);
3139 ev->border = bd; 3009 ev->border = bd;
@@ -3180,9 +3050,10 @@ e_border_unfullscreen(E_Border *bd)
3180 3050
3181 e_hints_window_fullscreen_set(bd, 0); 3051 e_hints_window_fullscreen_set(bd, 0);
3182 bd->client.border.changed = 1; 3052 bd->client.border.changed = 1;
3183 bd->changed = 1; 3053 BD_CHANGED(bd);
3184 } 3054 }
3185 bd->fullscreen_policy = 0; 3055 bd->fullscreen_policy = 0;
3056 _e_border_shadow(bd);
3186 3057
3187 ev = E_NEW(E_Event_Border_Unfullscreen, 1); 3058 ev = E_NEW(E_Event_Border_Unfullscreen, 1);
3188 ev->border = bd; 3059 ev->border = bd;
@@ -3359,7 +3230,7 @@ e_border_pinned_set(E_Border *bd,
3359 e_border_layer_set(bd, layer); 3230 e_border_layer_set(bd, layer);
3360 3231
3361 bd->client.border.changed = 1; 3232 bd->client.border.changed = 1;
3362 bd->changed = 1; 3233 BD_CHANGED(bd);
3363 } 3234 }
3364} 3235}
3365 3236
@@ -3387,18 +3258,6 @@ e_border_find_all_by_client_window(Ecore_X_Window win)
3387} 3258}
3388 3259
3389EAPI E_Border * 3260EAPI E_Border *
3390e_border_find_by_frame_window(Ecore_X_Window win)
3391{
3392 E_Border *bd;
3393
3394 bd = eina_hash_find(borders_hash, e_util_winid_str_get(win));
3395 if ((bd) && (!e_object_is_del(E_OBJECT(bd))) &&
3396 (bd->bg_win == win))
3397 return bd;
3398 return NULL;
3399}
3400
3401EAPI E_Border *
3402e_border_find_by_window(Ecore_X_Window win) 3261e_border_find_by_window(Ecore_X_Window win)
3403{ 3262{
3404 E_Border *bd; 3263 E_Border *bd;
@@ -3648,8 +3507,6 @@ _e_border_show(E_Border *bd)
3648 Eina_List *l; 3507 Eina_List *l;
3649 E_Border *tmp; 3508 E_Border *tmp;
3650 3509
3651 ecore_evas_show(bd->bg_ecore_evas);
3652
3653 if (bd->post_job) 3510 if (bd->post_job)
3654 { 3511 {
3655 bd->post_show = 1; 3512 bd->post_show = 1;
@@ -3679,7 +3536,6 @@ _e_border_hide(E_Border *bd)
3679 if (!e_comp_evas_exists(bd)) 3536 if (!e_comp_evas_exists(bd))
3680 { 3537 {
3681 ecore_x_window_hide(bd->win); 3538 ecore_x_window_hide(bd->win);
3682 ecore_evas_hide(bd->bg_ecore_evas);
3683 3539
3684 EINA_LIST_FOREACH(bd->client.e.state.video_child, l, tmp) 3540 EINA_LIST_FOREACH(bd->client.e.state.video_child, l, tmp)
3685 ecore_x_window_hide(tmp->win); 3541 ecore_x_window_hide(tmp->win);
@@ -3698,7 +3554,6 @@ _e_border_action_input_win_del(void)
3698 return 0; 3554 return 0;
3699 3555
3700 e_grabinput_release(action_input_win, action_input_win); 3556 e_grabinput_release(action_input_win, action_input_win);
3701 ecore_x_window_free(action_input_win);
3702 action_input_win = 0; 3557 action_input_win = 0;
3703 return 1; 3558 return 1;
3704} 3559}
@@ -3707,14 +3562,8 @@ static int
3707_e_border_action_input_win_new(E_Border *bd) 3562_e_border_action_input_win_new(E_Border *bd)
3708{ 3563{
3709 if (!action_input_win) 3564 if (!action_input_win)
3710 { 3565 action_input_win = e_comp_get(bd)->ee_win;
3711 Ecore_X_Window parent = bd->zone->container->win;
3712 action_input_win = ecore_x_window_input_new(parent, 0, 0, 1, 1);
3713 if (!action_input_win)
3714 return 0;
3715 }
3716 3566
3717 ecore_x_window_show(action_input_win);
3718 if (e_grabinput_get(action_input_win, 0, action_input_win)) 3567 if (e_grabinput_get(action_input_win, 0, action_input_win))
3719 return 1; 3568 return 1;
3720 3569
@@ -4029,13 +3878,19 @@ e_border_act_move_begin(E_Border *bd,
4029{ 3878{
4030 E_OBJECT_CHECK(bd); 3879 E_OBJECT_CHECK(bd);
4031 E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE); 3880 E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE);
4032 if ((bd->resize_mode != RESIZE_NONE) || (bd->moving)) return; 3881 if ((bd->resize_mode != E_POINTER_RESIZE_NONE) || (bd->moving)) return;
4033 if (!_e_border_move_begin(bd)) 3882 if (!_e_border_move_begin(bd))
4034 return; 3883 return;
4035 3884
3885 if (!_e_border_action_input_win_new(bd))
3886 {
3887 _e_border_move_end(bd);
3888 return;
3889 }
3890 _e_border_action_init(bd);
4036 e_zone_edge_disable(); 3891 e_zone_edge_disable();
4037 bd->moving = 1; 3892 bd->moving = 1;
4038 _e_border_pointer_move_begin(bd); 3893 e_pointer_mode_push(bd, E_POINTER_MOVE);
4039 if (ev) 3894 if (ev)
4040 { 3895 {
4041 char source[256]; 3896 char source[256];
@@ -4053,10 +3908,11 @@ e_border_act_move_end(E_Border *bd,
4053 E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE); 3908 E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE);
4054 if (!bd->moving) return; 3909 if (!bd->moving) return;
4055 bd->moving = 0; 3910 bd->moving = 0;
4056 _e_border_pointer_move_end(bd); 3911 e_pointer_mode_pop(bd, E_POINTER_MOVE);
4057 e_zone_edge_enable(); 3912 e_zone_edge_enable();
4058 _e_border_move_end(bd); 3913 _e_border_move_end(bd);
4059 e_zone_flip_coords_handle(bd->zone, -1, -1); 3914 e_zone_flip_coords_handle(bd->zone, -1, -1);
3915 _e_border_action_finish();
4060} 3916}
4061 3917
4062EAPI void 3918EAPI void
@@ -4066,19 +3922,25 @@ e_border_act_resize_begin(E_Border *bd,
4066 E_OBJECT_CHECK(bd); 3922 E_OBJECT_CHECK(bd);
4067 E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE); 3923 E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE);
4068 if (bd->lock_user_size) return; 3924 if (bd->lock_user_size) return;
4069 if ((bd->resize_mode != RESIZE_NONE) || (bd->moving)) return; 3925 if ((bd->resize_mode != E_POINTER_RESIZE_NONE) || (bd->moving)) return;
4070 if (!_e_border_resize_begin(bd)) 3926 if (!_e_border_resize_begin(bd))
4071 return; 3927 return;
3928 if (!_e_border_action_input_win_new(bd))
3929 {
3930 _e_border_resize_end(bd);
3931 return;
3932 }
3933 _e_border_action_init(bd);
4072 if (bd->mouse.current.mx < (bd->x + bd->w / 2)) 3934 if (bd->mouse.current.mx < (bd->x + bd->w / 2))
4073 { 3935 {
4074 if (bd->mouse.current.my < (bd->y + bd->h / 2)) 3936 if (bd->mouse.current.my < (bd->y + bd->h / 2))
4075 { 3937 {
4076 bd->resize_mode = RESIZE_TL; 3938 bd->resize_mode = E_POINTER_RESIZE_TL;
4077 GRAV_SET(bd, ECORE_X_GRAVITY_SE); 3939 GRAV_SET(bd, ECORE_X_GRAVITY_SE);
4078 } 3940 }
4079 else 3941 else
4080 { 3942 {
4081 bd->resize_mode = RESIZE_BL; 3943 bd->resize_mode = E_POINTER_RESIZE_BL;
4082 GRAV_SET(bd, ECORE_X_GRAVITY_NE); 3944 GRAV_SET(bd, ECORE_X_GRAVITY_NE);
4083 } 3945 }
4084 } 3946 }
@@ -4086,16 +3948,16 @@ e_border_act_resize_begin(E_Border *bd,
4086 { 3948 {
4087 if (bd->mouse.current.my < (bd->y + bd->h / 2)) 3949 if (bd->mouse.current.my < (bd->y + bd->h / 2))
4088 { 3950 {
4089 bd->resize_mode = RESIZE_TR; 3951 bd->resize_mode = E_POINTER_RESIZE_TR;
4090 GRAV_SET(bd, ECORE_X_GRAVITY_SW); 3952 GRAV_SET(bd, ECORE_X_GRAVITY_SW);
4091 } 3953 }
4092 else 3954 else
4093 { 3955 {
4094 bd->resize_mode = RESIZE_BR; 3956 bd->resize_mode = E_POINTER_RESIZE_BR;
4095 GRAV_SET(bd, ECORE_X_GRAVITY_NW); 3957 GRAV_SET(bd, ECORE_X_GRAVITY_NW);
4096 } 3958 }
4097 } 3959 }
4098 _e_border_pointer_resize_begin(bd); 3960 e_pointer_mode_push(bd, bd->resize_mode);
4099 if (ev) 3961 if (ev)
4100 { 3962 {
4101 char source[256]; 3963 char source[256];
@@ -4111,14 +3973,15 @@ e_border_act_resize_end(E_Border *bd,
4111{ 3973{
4112 E_OBJECT_CHECK(bd); 3974 E_OBJECT_CHECK(bd);
4113 E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE); 3975 E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE);
4114 if (bd->resize_mode != RESIZE_NONE) 3976 if (bd->resize_mode != E_POINTER_RESIZE_NONE)
4115 { 3977 {
4116 _e_border_pointer_resize_end(bd); 3978 e_pointer_mode_pop(bd, bd->resize_mode);
4117 bd->resize_mode = RESIZE_NONE; 3979 bd->resize_mode = E_POINTER_RESIZE_NONE;
4118 _e_border_resize_end(bd); 3980 _e_border_resize_end(bd);
4119 bd->changes.reset_gravity = 1; 3981 bd->changes.reset_gravity = 1;
4120 bd->changed = 1; 3982 BD_CHANGED(bd);
4121 } 3983 }
3984 _e_border_action_finish();
4122} 3985}
4123 3986
4124EAPI void 3987EAPI void
@@ -4333,38 +4196,6 @@ e_border_lost_windows_get(E_Zone *zone)
4333 { 4196 {
4334 list = eina_list_append(list, bd); 4197 list = eina_list_append(list, bd);
4335 } 4198 }
4336 else if ((!E_CONTAINS(bd->zone->x, bd->zone->y,
4337 bd->zone->w, bd->zone->h,
4338 bd->x, bd->y, bd->w, bd->h)) &&
4339 (bd->shaped))
4340 {
4341 Ecore_X_Rectangle *rect;
4342 int i, num;
4343
4344 rect = ecore_x_window_shape_rectangles_get(bd->win, &num);
4345 if (rect)
4346 {
4347 int ok;
4348
4349 ok = 0;
4350 for (i = 0; i < num; i++)
4351 {
4352 if (E_INTERSECTS(bd->zone->x + loss_overlap,
4353 bd->zone->y + loss_overlap,
4354 bd->zone->w - (2 * loss_overlap),
4355 bd->zone->h - (2 * loss_overlap),
4356 rect[i].x, rect[i].y,
4357 (int)rect[i].width, (int)rect[i].height))
4358 {
4359 ok = 1;
4360 break;
4361 }
4362 }
4363 free(rect);
4364 if (!ok)
4365 list = eina_list_append(list, bd);
4366 }
4367 }
4368 } 4199 }
4369 return list; 4200 return list;
4370} 4201}
@@ -4561,7 +4392,7 @@ e_border_resize_cancel(void)
4561 } 4392 }
4562 else 4393 else
4563 { 4394 {
4564 bdresize->resize_mode = RESIZE_NONE; 4395 bdresize->resize_mode = E_POINTER_RESIZE_NONE;
4565 _e_border_resize_end(bdresize); 4396 _e_border_resize_end(bdresize);
4566 } 4397 }
4567 } 4398 }
@@ -4580,9 +4411,9 @@ e_border_frame_recalc(E_Border *bd)
4580 bd->w += (bd->client_inset.l + bd->client_inset.r); 4411 bd->w += (bd->client_inset.l + bd->client_inset.r);
4581 bd->h += (bd->client_inset.t + bd->client_inset.b); 4412 bd->h += (bd->client_inset.t + bd->client_inset.b);
4582 4413
4583 bd->changed = 1; 4414 BD_CHANGED(bd);
4584 bd->changes.size = 1; 4415 bd->changes.size = 1;
4585 if ((bd->shaped) || (bd->client.shaped)) 4416 if (bd->client.shaped)
4586 { 4417 {
4587 bd->need_shape_merge = 1; 4418 bd->need_shape_merge = 1;
4588 bd->need_shape_export = 1; 4419 bd->need_shape_export = 1;
@@ -4628,10 +4459,10 @@ e_border_signal_move_begin(E_Border *bd,
4628 E_OBJECT_CHECK(bd); 4459 E_OBJECT_CHECK(bd);
4629 E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE); 4460 E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE);
4630 4461
4631 if ((bd->resize_mode != RESIZE_NONE) || (bd->moving)) return; 4462 if ((bd->resize_mode != E_POINTER_RESIZE_NONE) || (bd->moving)) return;
4632 if (!_e_border_move_begin(bd)) return; 4463 if (!_e_border_move_begin(bd)) return;
4633 bd->moving = 1; 4464 bd->moving = 1;
4634 _e_border_pointer_move_begin(bd); 4465 e_pointer_mode_push(bd, E_POINTER_MOVE);
4635 e_zone_edge_disable(); 4466 e_zone_edge_disable();
4636 _e_border_moveinfo_gather(bd, sig); 4467 _e_border_moveinfo_gather(bd, sig);
4637 if (bd->cur_mouse_action) 4468 if (bd->cur_mouse_action)
@@ -4656,7 +4487,7 @@ e_border_signal_move_end(E_Border *bd,
4656 E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE); 4487 E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE);
4657 if (!bd->moving) return; 4488 if (!bd->moving) return;
4658 bd->moving = 0; 4489 bd->moving = 0;
4659 _e_border_pointer_move_end(bd); 4490 e_pointer_mode_pop(bd, E_POINTER_MOVE);
4660 e_zone_edge_enable(); 4491 e_zone_edge_enable();
4661 _e_border_move_end(bd); 4492 _e_border_move_end(bd);
4662 e_zone_flip_coords_handle(bd->zone, -1, -1); 4493 e_zone_flip_coords_handle(bd->zone, -1, -1);
@@ -4667,7 +4498,7 @@ e_border_resizing_get(E_Border *bd)
4667{ 4498{
4668 E_OBJECT_CHECK_RETURN(bd, 0); 4499 E_OBJECT_CHECK_RETURN(bd, 0);
4669 E_OBJECT_TYPE_CHECK_RETURN(bd, E_BORDER_TYPE, 0); 4500 E_OBJECT_TYPE_CHECK_RETURN(bd, E_BORDER_TYPE, 0);
4670 if (bd->resize_mode == RESIZE_NONE) return 0; 4501 if (bd->resize_mode == E_POINTER_RESIZE_NONE) return 0;
4671 return 1; 4502 return 1;
4672} 4503}
4673 4504
@@ -4678,56 +4509,56 @@ e_border_signal_resize_begin(E_Border *bd,
4678 const char *src __UNUSED__) 4509 const char *src __UNUSED__)
4679{ 4510{
4680 Ecore_X_Gravity grav = ECORE_X_GRAVITY_NW; 4511 Ecore_X_Gravity grav = ECORE_X_GRAVITY_NW;
4681 int resize_mode = RESIZE_BR; 4512 int resize_mode = E_POINTER_RESIZE_BR;
4682 4513
4683 E_OBJECT_CHECK(bd); 4514 E_OBJECT_CHECK(bd);
4684 E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE); 4515 E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE);
4685 4516
4686 if ((bd->resize_mode != RESIZE_NONE) || (bd->moving)) return; 4517 if ((bd->resize_mode != E_POINTER_RESIZE_NONE) || (bd->moving)) return;
4687 if (!_e_border_resize_begin(bd)) 4518 if (!_e_border_resize_begin(bd))
4688 return; 4519 return;
4689 if (!strcmp(dir, "tl")) 4520 if (!strcmp(dir, "tl"))
4690 { 4521 {
4691 resize_mode = RESIZE_TL; 4522 resize_mode = E_POINTER_RESIZE_TL;
4692 grav = ECORE_X_GRAVITY_SE; 4523 grav = ECORE_X_GRAVITY_SE;
4693 } 4524 }
4694 else if (!strcmp(dir, "t")) 4525 else if (!strcmp(dir, "t"))
4695 { 4526 {
4696 resize_mode = RESIZE_T; 4527 resize_mode = E_POINTER_RESIZE_T;
4697 grav = ECORE_X_GRAVITY_S; 4528 grav = ECORE_X_GRAVITY_S;
4698 } 4529 }
4699 else if (!strcmp(dir, "tr")) 4530 else if (!strcmp(dir, "tr"))
4700 { 4531 {
4701 resize_mode = RESIZE_TR; 4532 resize_mode = E_POINTER_RESIZE_TR;
4702 grav = ECORE_X_GRAVITY_SW; 4533 grav = ECORE_X_GRAVITY_SW;
4703 } 4534 }
4704 else if (!strcmp(dir, "r")) 4535 else if (!strcmp(dir, "r"))
4705 { 4536 {
4706 resize_mode = RESIZE_R; 4537 resize_mode = E_POINTER_RESIZE_R;
4707 grav = ECORE_X_GRAVITY_W; 4538 grav = ECORE_X_GRAVITY_W;
4708 } 4539 }
4709 else if (!strcmp(dir, "br")) 4540 else if (!strcmp(dir, "br"))
4710 { 4541 {
4711 resize_mode = RESIZE_BR; 4542 resize_mode = E_POINTER_RESIZE_BR;
4712 grav = ECORE_X_GRAVITY_NW; 4543 grav = ECORE_X_GRAVITY_NW;
4713 } 4544 }
4714 else if (!strcmp(dir, "b")) 4545 else if (!strcmp(dir, "b"))
4715 { 4546 {
4716 resize_mode = RESIZE_B; 4547 resize_mode = E_POINTER_RESIZE_B;
4717 grav = ECORE_X_GRAVITY_N; 4548 grav = ECORE_X_GRAVITY_N;
4718 } 4549 }
4719 else if (!strcmp(dir, "bl")) 4550 else if (!strcmp(dir, "bl"))
4720 { 4551 {
4721 resize_mode = RESIZE_BL; 4552 resize_mode = E_POINTER_RESIZE_BL;
4722 grav = ECORE_X_GRAVITY_NE; 4553 grav = ECORE_X_GRAVITY_NE;
4723 } 4554 }
4724 else if (!strcmp(dir, "l")) 4555 else if (!strcmp(dir, "l"))
4725 { 4556 {
4726 resize_mode = RESIZE_L; 4557 resize_mode = E_POINTER_RESIZE_L;
4727 grav = ECORE_X_GRAVITY_E; 4558 grav = ECORE_X_GRAVITY_E;
4728 } 4559 }
4729 bd->resize_mode = resize_mode; 4560 bd->resize_mode = resize_mode;
4730 _e_border_pointer_resize_begin(bd); 4561 e_pointer_mode_push(bd, bd->resize_mode);
4731 _e_border_moveinfo_gather(bd, sig); 4562 _e_border_moveinfo_gather(bd, sig);
4732 GRAV_SET(bd, grav); 4563 GRAV_SET(bd, grav);
4733 if (bd->cur_mouse_action) 4564 if (bd->cur_mouse_action)
@@ -4751,13 +4582,13 @@ e_border_signal_resize_end(E_Border *bd,
4751{ 4582{
4752 E_OBJECT_CHECK(bd); 4583 E_OBJECT_CHECK(bd);
4753 E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE); 4584 E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE);
4754 if (bd->resize_mode == RESIZE_NONE) return; 4585 if (bd->resize_mode == E_POINTER_RESIZE_NONE) return;
4755 _e_border_resize_handle(bd); 4586 _e_border_resize_handle(bd);
4756 _e_border_pointer_resize_end(bd); 4587 e_pointer_mode_pop(bd, bd->resize_mode);
4757 bd->resize_mode = RESIZE_NONE; 4588 bd->resize_mode = E_POINTER_RESIZE_NONE;
4758 _e_border_resize_end(bd); 4589 _e_border_resize_end(bd);
4759 bd->changes.reset_gravity = 1; 4590 bd->changes.reset_gravity = 1;
4760 bd->changed = 1; 4591 BD_CHANGED(bd);
4761} 4592}
4762 4593
4763EAPI void 4594EAPI void
@@ -4859,12 +4690,6 @@ e_border_resize_limit(E_Border *bd,
4859static void 4690static void
4860_e_border_free(E_Border *bd) 4691_e_border_free(E_Border *bd)
4861{ 4692{
4862 if (warp_timer_border == bd)
4863 {
4864 if (warp_timer) ecore_timer_del(warp_timer);
4865 warp_timer = NULL;
4866 warp_timer_border = NULL;
4867 }
4868#if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8) 4693#if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8)
4869 if (bd->client.e.state.profile.use) 4694 if (bd->client.e.state.profile.use)
4870 { 4695 {
@@ -4911,6 +4736,12 @@ _e_border_free(E_Border *bd)
4911 tmp->client.e.state.video_parent_border = NULL; 4736 tmp->client.e.state.video_parent_border = NULL;
4912 } 4737 }
4913 } 4738 }
4739 if (bd->internal_ecore_evas)
4740 {
4741 e_canvas_del(bd->internal_ecore_evas);
4742 ecore_evas_free(bd->internal_ecore_evas);
4743 bd->internal_ecore_evas = NULL;
4744 }
4914 if (bd->desktop) 4745 if (bd->desktop)
4915 { 4746 {
4916 efreet_desktop_free(bd->desktop); 4747 efreet_desktop_free(bd->desktop);
@@ -4921,11 +4752,7 @@ _e_border_free(E_Border *bd)
4921 ecore_idle_enterer_del(bd->post_job); 4752 ecore_idle_enterer_del(bd->post_job);
4922 bd->post_job = NULL; 4753 bd->post_job = NULL;
4923 } 4754 }
4924 if (bd->pointer) 4755
4925 {
4926 e_object_del(E_OBJECT(bd->pointer));
4927 bd->pointer = NULL;
4928 }
4929 if (bdresize == bd) 4756 if (bdresize == bd)
4930 _e_border_resize_end(bd); 4757 _e_border_resize_end(bd);
4931 if (bdmove == bd) 4758 if (bdmove == bd)
@@ -5002,7 +4829,6 @@ _e_border_free(E_Border *bd)
5002 4829
5003 focused = NULL; 4830 focused = NULL;
5004 } 4831 }
5005 E_FREE_LIST(bd->handlers, ecore_event_handler_del);
5006 if (bd->remember) 4832 if (bd->remember)
5007 { 4833 {
5008 E_Remember *rem; 4834 E_Remember *rem;
@@ -5079,7 +4905,7 @@ _e_border_free(E_Border *bd)
5079 if (bd->client.netwm.icon_name) 4905 if (bd->client.netwm.icon_name)
5080 eina_stringshare_del(bd->client.netwm.icon_name); 4906 eina_stringshare_del(bd->client.netwm.icon_name);
5081 bd->client.netwm.icon_name = NULL; 4907 bd->client.netwm.icon_name = NULL;
5082 e_object_del(E_OBJECT(bd->shape)); 4908 if (bd->shape) e_object_del(E_OBJECT(bd->shape));
5083 bd->shape = NULL; 4909 bd->shape = NULL;
5084 if (bd->internal_icon) eina_stringshare_del(bd->internal_icon); 4910 if (bd->internal_icon) eina_stringshare_del(bd->internal_icon);
5085 bd->internal_icon = NULL; 4911 bd->internal_icon = NULL;
@@ -5089,16 +4915,10 @@ _e_border_free(E_Border *bd)
5089 bd->icon_object = NULL; 4915 bd->icon_object = NULL;
5090 evas_object_del(bd->bg_object); 4916 evas_object_del(bd->bg_object);
5091 bd->bg_object = NULL; 4917 bd->bg_object = NULL;
5092 e_canvas_del(bd->bg_ecore_evas);
5093 ecore_evas_free(bd->bg_ecore_evas);
5094 bd->bg_ecore_evas = NULL;
5095 ecore_x_window_free(bd->client.shell_win);
5096 bd->client.shell_win = 0;
5097 e_focus_setdown(bd); 4918 e_focus_setdown(bd);
5098 e_bindings_mouse_ungrab(E_BINDING_CONTEXT_WINDOW, bd->win); 4919 e_bindings_mouse_ungrab(E_BINDING_CONTEXT_WINDOW, bd->win);
5099 e_bindings_wheel_ungrab(E_BINDING_CONTEXT_WINDOW, bd->win); 4920 e_bindings_wheel_ungrab(E_BINDING_CONTEXT_WINDOW, bd->win);
5100 eina_hash_del(borders_hash, e_util_winid_str_get(bd->client.win), bd); 4921 eina_hash_del(borders_hash, e_util_winid_str_get(bd->client.win), bd);
5101 eina_hash_del(borders_hash, e_util_winid_str_get(bd->bg_win), bd);
5102 eina_hash_del(borders_hash, e_util_winid_str_get(bd->win), bd); 4922 eina_hash_del(borders_hash, e_util_winid_str_get(bd->win), bd);
5103 ecore_x_window_free(bd->win); 4923 ecore_x_window_free(bd->win);
5104 bd->win = 0; 4924 bd->win = 0;
@@ -5130,6 +4950,22 @@ _e_border_free(E_Border *bd)
5130 */ 4950 */
5131 4951
5132static void 4952static void
4953_e_border_shadow(E_Border *bd)
4954{
4955 Eina_Bool on = EINA_FALSE;
4956 if (!bd->bg_object) return;
4957 on = !bd->client.e.state.video;
4958 if (on)
4959 on = !bd->fullscreen;
4960 if (on)
4961 on = !!e_util_strcmp(bd->client.border.name, "borderless");
4962 if (on)
4963 edje_object_signal_emit(bd->bg_object, "e,state,shadow,on", "e");
4964 else
4965 edje_object_signal_emit(bd->bg_object, "e,state,shadow,off", "e");
4966}
4967
4968static void
5133_e_border_del(E_Border *bd) 4969_e_border_del(E_Border *bd)
5134{ 4970{
5135 E_Event_Border_Remove *ev; 4971 E_Event_Border_Remove *ev;
@@ -5144,9 +4980,17 @@ _e_border_del(E_Border *bd)
5144 focusing = NULL; 4980 focusing = NULL;
5145 4981
5146 focus_next = eina_list_remove(focus_next, bd); 4982 focus_next = eina_list_remove(focus_next, bd);
4983 bd->changed = 0;
5147 4984
5148 if (bd->fullscreen) bd->desk->fullscreen_borders--; 4985 if (bd->fullscreen) bd->desk->fullscreen_borders--;
5149 4986
4987 if (warp_timer_border == bd)
4988 {
4989 if (warp_timer) ecore_timer_del(warp_timer);
4990 warp_timer = NULL;
4991 warp_timer_border = NULL;
4992 }
4993
5150 if ((drag_border) && (drag_border->data == bd)) 4994 if ((drag_border) && (drag_border->data == bd))
5151 { 4995 {
5152 e_object_del(E_OBJECT(drag_border)); 4996 e_object_del(E_OBJECT(drag_border));
@@ -5370,8 +5214,8 @@ _e_border_cb_window_reparent(void *data __UNUSED__,
5370 e = ev; 5214 e = ev;
5371 bd = e_border_find_by_client_window(e->win); 5215 bd = e_border_find_by_client_window(e->win);
5372 if (!bd) return 1; 5216 if (!bd) return 1;
5373 if (e->parent == bd->client.shell_win) return 1; 5217 if (e->parent == bd->win) return 1;
5374 if (ecore_x_window_parent_get(e->win) == bd->client.shell_win) 5218 if (ecore_x_window_parent_get(e->win) == bd->win)
5375 { 5219 {
5376 return 1; 5220 return 1;
5377 } 5221 }
@@ -5767,18 +5611,18 @@ _e_border_cb_window_property(void *data __UNUSED__,
5767 (!bd->client.netwm.fetch.name)) 5611 (!bd->client.netwm.fetch.name))
5768 { 5612 {
5769 bd->client.icccm.fetch.title = 1; 5613 bd->client.icccm.fetch.title = 1;
5770 bd->changed = 1; 5614 BD_CHANGED(bd);
5771 } 5615 }
5772 } 5616 }
5773 else if (e->atom == ECORE_X_ATOM_NET_WM_NAME) 5617 else if (e->atom == ECORE_X_ATOM_NET_WM_NAME)
5774 { 5618 {
5775 bd->client.netwm.fetch.name = 1; 5619 bd->client.netwm.fetch.name = 1;
5776 bd->changed = 1; 5620 BD_CHANGED(bd);
5777 } 5621 }
5778 else if (e->atom == ECORE_X_ATOM_WM_CLASS) 5622 else if (e->atom == ECORE_X_ATOM_WM_CLASS)
5779 { 5623 {
5780 bd->client.icccm.fetch.name_class = 1; 5624 bd->client.icccm.fetch.name_class = 1;
5781 bd->changed = 1; 5625 BD_CHANGED(bd);
5782 } 5626 }
5783 else if (e->atom == ECORE_X_ATOM_WM_ICON_NAME) 5627 else if (e->atom == ECORE_X_ATOM_WM_ICON_NAME)
5784 { 5628 {
@@ -5786,33 +5630,33 @@ _e_border_cb_window_property(void *data __UNUSED__,
5786 (!bd->client.netwm.fetch.icon_name)) 5630 (!bd->client.netwm.fetch.icon_name))
5787 { 5631 {
5788 bd->client.icccm.fetch.icon_name = 1; 5632 bd->client.icccm.fetch.icon_name = 1;
5789 bd->changed = 1; 5633 BD_CHANGED(bd);
5790 } 5634 }
5791 } 5635 }
5792 else if (e->atom == ECORE_X_ATOM_NET_WM_ICON_NAME) 5636 else if (e->atom == ECORE_X_ATOM_NET_WM_ICON_NAME)
5793 { 5637 {
5794 bd->client.netwm.fetch.icon_name = 1; 5638 bd->client.netwm.fetch.icon_name = 1;
5795 bd->changed = 1; 5639 BD_CHANGED(bd);
5796 } 5640 }
5797 else if (e->atom == ECORE_X_ATOM_WM_CLIENT_MACHINE) 5641 else if (e->atom == ECORE_X_ATOM_WM_CLIENT_MACHINE)
5798 { 5642 {
5799 bd->client.icccm.fetch.machine = 1; 5643 bd->client.icccm.fetch.machine = 1;
5800 bd->changed = 1; 5644 BD_CHANGED(bd);
5801 } 5645 }
5802 else if (e->atom == ECORE_X_ATOM_WM_PROTOCOLS) 5646 else if (e->atom == ECORE_X_ATOM_WM_PROTOCOLS)
5803 { 5647 {
5804 bd->client.icccm.fetch.protocol = 1; 5648 bd->client.icccm.fetch.protocol = 1;
5805 bd->changed = 1; 5649 BD_CHANGED(bd);
5806 } 5650 }
5807 else if (e->atom == ECORE_X_ATOM_WM_HINTS) 5651 else if (e->atom == ECORE_X_ATOM_WM_HINTS)
5808 { 5652 {
5809 bd->client.icccm.fetch.hints = 1; 5653 bd->client.icccm.fetch.hints = 1;
5810 bd->changed = 1; 5654 BD_CHANGED(bd);
5811 } 5655 }
5812 else if (e->atom == ECORE_X_ATOM_WM_NORMAL_HINTS) 5656 else if (e->atom == ECORE_X_ATOM_WM_NORMAL_HINTS)
5813 { 5657 {
5814 bd->client.icccm.fetch.size_pos_hints = 1; 5658 bd->client.icccm.fetch.size_pos_hints = 1;
5815 bd->changed = 1; 5659 BD_CHANGED(bd);
5816 } 5660 }
5817 else if (e->atom == ECORE_X_ATOM_MOTIF_WM_HINTS) 5661 else if (e->atom == ECORE_X_ATOM_MOTIF_WM_HINTS)
5818 { 5662 {
@@ -5822,7 +5666,7 @@ _e_border_cb_window_property(void *data __UNUSED__,
5822 { 5666 {
5823 */ 5667 */
5824 bd->client.mwm.fetch.hints = 1; 5668 bd->client.mwm.fetch.hints = 1;
5825 bd->changed = 1; 5669 BD_CHANGED(bd);
5826 /* 5670 /*
5827 } 5671 }
5828 */ 5672 */
@@ -5830,103 +5674,103 @@ _e_border_cb_window_property(void *data __UNUSED__,
5830 else if (e->atom == ECORE_X_ATOM_WM_TRANSIENT_FOR) 5674 else if (e->atom == ECORE_X_ATOM_WM_TRANSIENT_FOR)
5831 { 5675 {
5832 bd->client.icccm.fetch.transient_for = 1; 5676 bd->client.icccm.fetch.transient_for = 1;
5833 bd->changed = 1; 5677 BD_CHANGED(bd);
5834 } 5678 }
5835 else if (e->atom == ECORE_X_ATOM_WM_CLIENT_LEADER) 5679 else if (e->atom == ECORE_X_ATOM_WM_CLIENT_LEADER)
5836 { 5680 {
5837 bd->client.icccm.fetch.client_leader = 1; 5681 bd->client.icccm.fetch.client_leader = 1;
5838 bd->changed = 1; 5682 BD_CHANGED(bd);
5839 } 5683 }
5840 else if (e->atom == ECORE_X_ATOM_WM_WINDOW_ROLE) 5684 else if (e->atom == ECORE_X_ATOM_WM_WINDOW_ROLE)
5841 { 5685 {
5842 bd->client.icccm.fetch.window_role = 1; 5686 bd->client.icccm.fetch.window_role = 1;
5843 bd->changed = 1; 5687 BD_CHANGED(bd);
5844 } 5688 }
5845 else if (e->atom == ECORE_X_ATOM_NET_WM_ICON) 5689 else if (e->atom == ECORE_X_ATOM_NET_WM_ICON)
5846 { 5690 {
5847 bd->client.netwm.fetch.icon = 1; 5691 bd->client.netwm.fetch.icon = 1;
5848 bd->changed = 1; 5692 BD_CHANGED(bd);
5849 } 5693 }
5850 else if (e->atom == ATM__QTOPIA_SOFT_MENU) 5694 else if (e->atom == ATM__QTOPIA_SOFT_MENU)
5851 { 5695 {
5852 bd->client.qtopia.fetch.soft_menu = 1; 5696 bd->client.qtopia.fetch.soft_menu = 1;
5853 bd->changed = 1; 5697 BD_CHANGED(bd);
5854 } 5698 }
5855 else if (e->atom == ATM__QTOPIA_SOFT_MENUS) 5699 else if (e->atom == ATM__QTOPIA_SOFT_MENUS)
5856 { 5700 {
5857 bd->client.qtopia.fetch.soft_menus = 1; 5701 bd->client.qtopia.fetch.soft_menus = 1;
5858 bd->changed = 1; 5702 BD_CHANGED(bd);
5859 } 5703 }
5860 else if (e->atom == ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_STATE) 5704 else if (e->atom == ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_STATE)
5861 { 5705 {
5862 bd->client.vkbd.fetch.state = 1; 5706 bd->client.vkbd.fetch.state = 1;
5863 bd->changed = 1; 5707 BD_CHANGED(bd);
5864 } 5708 }
5865 else if (e->atom == ECORE_X_ATOM_E_VIRTUAL_KEYBOARD) 5709 else if (e->atom == ECORE_X_ATOM_E_VIRTUAL_KEYBOARD)
5866 { 5710 {
5867 bd->client.vkbd.fetch.vkbd = 1; 5711 bd->client.vkbd.fetch.vkbd = 1;
5868 bd->changed = 1; 5712 BD_CHANGED(bd);
5869 } 5713 }
5870 else if (e->atom == ECORE_X_ATOM_E_ILLUME_CONFORMANT) 5714 else if (e->atom == ECORE_X_ATOM_E_ILLUME_CONFORMANT)
5871 { 5715 {
5872 bd->client.illume.conformant.fetch.conformant = 1; 5716 bd->client.illume.conformant.fetch.conformant = 1;
5873 bd->changed = 1; 5717 BD_CHANGED(bd);
5874 } 5718 }
5875 else if (e->atom == ECORE_X_ATOM_E_ILLUME_QUICKPANEL_STATE) 5719 else if (e->atom == ECORE_X_ATOM_E_ILLUME_QUICKPANEL_STATE)
5876 { 5720 {
5877 bd->client.illume.quickpanel.fetch.state = 1; 5721 bd->client.illume.quickpanel.fetch.state = 1;
5878 bd->changed = 1; 5722 BD_CHANGED(bd);
5879 } 5723 }
5880 else if (e->atom == ECORE_X_ATOM_E_ILLUME_QUICKPANEL) 5724 else if (e->atom == ECORE_X_ATOM_E_ILLUME_QUICKPANEL)
5881 { 5725 {
5882 bd->client.illume.quickpanel.fetch.quickpanel = 1; 5726 bd->client.illume.quickpanel.fetch.quickpanel = 1;
5883 bd->changed = 1; 5727 BD_CHANGED(bd);
5884 } 5728 }
5885 else if (e->atom == ECORE_X_ATOM_E_ILLUME_QUICKPANEL_PRIORITY_MAJOR) 5729 else if (e->atom == ECORE_X_ATOM_E_ILLUME_QUICKPANEL_PRIORITY_MAJOR)
5886 { 5730 {
5887 bd->client.illume.quickpanel.fetch.priority.major = 1; 5731 bd->client.illume.quickpanel.fetch.priority.major = 1;
5888 bd->changed = 1; 5732 BD_CHANGED(bd);
5889 } 5733 }
5890 else if (e->atom == ECORE_X_ATOM_E_ILLUME_QUICKPANEL_PRIORITY_MINOR) 5734 else if (e->atom == ECORE_X_ATOM_E_ILLUME_QUICKPANEL_PRIORITY_MINOR)
5891 { 5735 {
5892 bd->client.illume.quickpanel.fetch.priority.minor = 1; 5736 bd->client.illume.quickpanel.fetch.priority.minor = 1;
5893 bd->changed = 1; 5737 BD_CHANGED(bd);
5894 } 5738 }
5895 else if (e->atom == ECORE_X_ATOM_E_ILLUME_QUICKPANEL_ZONE) 5739 else if (e->atom == ECORE_X_ATOM_E_ILLUME_QUICKPANEL_ZONE)
5896 { 5740 {
5897 bd->client.illume.quickpanel.fetch.zone = 1; 5741 bd->client.illume.quickpanel.fetch.zone = 1;
5898 bd->changed = 1; 5742 BD_CHANGED(bd);
5899 } 5743 }
5900 else if (e->atom == ECORE_X_ATOM_E_ILLUME_DRAG_LOCKED) 5744 else if (e->atom == ECORE_X_ATOM_E_ILLUME_DRAG_LOCKED)
5901 { 5745 {
5902 bd->client.illume.drag.fetch.locked = 1; 5746 bd->client.illume.drag.fetch.locked = 1;
5903 bd->changed = 1; 5747 BD_CHANGED(bd);
5904 } 5748 }
5905 else if (e->atom == ECORE_X_ATOM_E_ILLUME_DRAG) 5749 else if (e->atom == ECORE_X_ATOM_E_ILLUME_DRAG)
5906 { 5750 {
5907 bd->client.illume.drag.fetch.drag = 1; 5751 bd->client.illume.drag.fetch.drag = 1;
5908 bd->changed = 1; 5752 BD_CHANGED(bd);
5909 } 5753 }
5910 else if (e->atom == ECORE_X_ATOM_E_ILLUME_WINDOW_STATE) 5754 else if (e->atom == ECORE_X_ATOM_E_ILLUME_WINDOW_STATE)
5911 { 5755 {
5912 bd->client.illume.win_state.fetch.state = 1; 5756 bd->client.illume.win_state.fetch.state = 1;
5913 bd->changed = 1; 5757 BD_CHANGED(bd);
5914 } 5758 }
5915 /* 5759 /*
5916 else if (e->atom == ECORE_X_ATOM_NET_WM_USER_TIME) 5760 else if (e->atom == ECORE_X_ATOM_NET_WM_USER_TIME)
5917 { 5761 {
5918 bd->client.netwm.fetch.user_time = 1; 5762 bd->client.netwm.fetch.user_time = 1;
5919 bd->changed = 1; 5763 BD_CHANGED(bd);
5920 } 5764 }
5921 else if (e->atom == ECORE_X_ATOM_NET_WM_STRUT) 5765 else if (e->atom == ECORE_X_ATOM_NET_WM_STRUT)
5922 { 5766 {
5923 bd->client.netwm.fetch.strut = 1; 5767 bd->client.netwm.fetch.strut = 1;
5924 bd->changed = 1; 5768 BD_CHANGED(bd);
5925 } 5769 }
5926 else if (e->atom == ECORE_X_ATOM_NET_WM_STRUT_PARTIAL) 5770 else if (e->atom == ECORE_X_ATOM_NET_WM_STRUT_PARTIAL)
5927 { 5771 {
5928 bd->client.netwm.fetch.strut = 1; 5772 bd->client.netwm.fetch.strut = 1;
5929 bd->changed = 1; 5773 BD_CHANGED(bd);
5930 } 5774 }
5931 */ 5775 */
5932 else if (e->atom == ECORE_X_ATOM_NET_WM_SYNC_REQUEST_COUNTER) 5776 else if (e->atom == ECORE_X_ATOM_NET_WM_SYNC_REQUEST_COUNTER)
@@ -5936,17 +5780,17 @@ _e_border_cb_window_property(void *data __UNUSED__,
5936 else if (e->atom == ECORE_X_ATOM_E_VIDEO_POSITION) 5780 else if (e->atom == ECORE_X_ATOM_E_VIDEO_POSITION)
5937 { 5781 {
5938 bd->client.e.fetch.video_position = 1; 5782 bd->client.e.fetch.video_position = 1;
5939 bd->changed = 1; 5783 BD_CHANGED(bd);
5940 } 5784 }
5941 else if (e->atom == ECORE_X_ATOM_E_VIDEO_PARENT) 5785 else if (e->atom == ECORE_X_ATOM_E_VIDEO_PARENT)
5942 { 5786 {
5943 bd->client.e.fetch.video_parent = 1; 5787 bd->client.e.fetch.video_parent = 1;
5944 bd->changed = 1; 5788 BD_CHANGED(bd);
5945 } 5789 }
5946 else if (e->atom == ECORE_X_ATOM_NET_WM_STATE) 5790 else if (e->atom == ECORE_X_ATOM_NET_WM_STATE)
5947 { 5791 {
5948 bd->client.netwm.fetch.state = 1; 5792 bd->client.netwm.fetch.state = 1;
5949 bd->changed = 1; 5793 BD_CHANGED(bd);
5950 } 5794 }
5951 else if (e->atom == ECORE_X_ATOM_NET_WM_WINDOW_OPACITY) 5795 else if (e->atom == ECORE_X_ATOM_NET_WM_WINDOW_OPACITY)
5952 { 5796 {
@@ -5955,19 +5799,19 @@ _e_border_cb_window_property(void *data __UNUSED__,
5955 else 5799 else
5956 { 5800 {
5957 bd->client.netwm.fetch.opacity = 1; 5801 bd->client.netwm.fetch.opacity = 1;
5958 bd->changed = 1; 5802 BD_CHANGED(bd);
5959 } 5803 }
5960 } 5804 }
5961#if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8) 5805#if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8)
5962 else if (e->atom == ECORE_X_ATOM_E_WINDOW_PROFILE_SUPPORTED) 5806 else if (e->atom == ECORE_X_ATOM_E_WINDOW_PROFILE_SUPPORTED)
5963 { 5807 {
5964 bd->client.e.fetch.profile = 1; 5808 bd->client.e.fetch.profile = 1;
5965 bd->changed = 1; 5809 BD_CHANGED(bd);
5966 } 5810 }
5967 else if (e->atom == ECORE_X_ATOM_E_WINDOW_PROFILE_AVAILABLE_LIST) 5811 else if (e->atom == ECORE_X_ATOM_E_WINDOW_PROFILE_AVAILABLE_LIST)
5968 { 5812 {
5969 bd->client.e.fetch.profile = 1; 5813 bd->client.e.fetch.profile = 1;
5970 bd->changed = 1; 5814 BD_CHANGED(bd);
5971 } 5815 }
5972#endif 5816#endif
5973 return ECORE_CALLBACK_PASS_ON; 5817 return ECORE_CALLBACK_PASS_ON;
@@ -6005,7 +5849,7 @@ _e_border_cb_window_shape(void *data __UNUSED__,
6005 bd->need_shape_merge = 1; 5849 bd->need_shape_merge = 1;
6006// YYY bd->shaped_input = 1; 5850// YYY bd->shaped_input = 1;
6007 bd->changes.shape_input = 1; 5851 bd->changes.shape_input = 1;
6008 bd->changed = 1; 5852 BD_CHANGED(bd);
6009 } 5853 }
6010 5854
6011 return ECORE_CALLBACK_PASS_ON; 5855 return ECORE_CALLBACK_PASS_ON;
@@ -6014,21 +5858,14 @@ _e_border_cb_window_shape(void *data __UNUSED__,
6014 if (bd) 5858 if (bd)
6015 { 5859 {
6016 bd->changes.shape = 1; 5860 bd->changes.shape = 1;
6017 bd->changed = 1; 5861 BD_CHANGED(bd);
6018 return ECORE_CALLBACK_PASS_ON; 5862 return ECORE_CALLBACK_PASS_ON;
6019 } 5863 }
6020 bd = e_border_find_by_window(e->win); 5864 bd = e_border_find_by_window(e->win);
6021 if (bd) 5865 if (bd)
6022 { 5866 {
6023 bd->need_shape_export = 1; 5867 bd->need_shape_export = 1;
6024 bd->changed = 1; 5868 BD_CHANGED(bd);
6025 return ECORE_CALLBACK_PASS_ON;
6026 }
6027 bd = e_border_find_by_frame_window(e->win);
6028 if (bd)
6029 {
6030 bd->need_shape_merge = 1;
6031 bd->changed = 1;
6032 return ECORE_CALLBACK_PASS_ON; 5869 return ECORE_CALLBACK_PASS_ON;
6033 } 5870 }
6034 return ECORE_CALLBACK_PASS_ON; 5871 return ECORE_CALLBACK_PASS_ON;
@@ -6205,7 +6042,7 @@ _e_border_cb_client_message(void *data __UNUSED__, int ev_type __UNUSED__, void
6205 if (e->message_type == ECORE_X_ATOM_NET_WM_WINDOW_OPACITY) 6042 if (e->message_type == ECORE_X_ATOM_NET_WM_WINDOW_OPACITY)
6206 { 6043 {
6207 bd->client.netwm.fetch.opacity = 1; 6044 bd->client.netwm.fetch.opacity = 1;
6208 bd->changed = 1; 6045 BD_CHANGED(bd);
6209 } 6046 }
6210#if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8) 6047#if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8)
6211 else if (e->message_type == ECORE_X_ATOM_E_WINDOW_PROFILE_CHANGE) 6048 else if (e->message_type == ECORE_X_ATOM_E_WINDOW_PROFILE_CHANGE)
@@ -6279,7 +6116,7 @@ _e_border_cb_window_move_resize_request(void *data __UNUSED__,
6279 6116
6280 if ((bd->shaded) || (bd->shading) || 6117 if ((bd->shaded) || (bd->shading) ||
6281 (bd->fullscreen) || (bd->moving) || 6118 (bd->fullscreen) || (bd->moving) ||
6282 (bd->resize_mode != RESIZE_NONE)) 6119 (bd->resize_mode != E_POINTER_RESIZE_NONE))
6283 return ECORE_CALLBACK_PASS_ON; 6120 return ECORE_CALLBACK_PASS_ON;
6284 6121
6285 if ((e->button >= 1) && (e->button <= 3)) 6122 if ((e->button >= 1) && (e->button <= 3))
@@ -6308,7 +6145,7 @@ _e_border_cb_window_move_resize_request(void *data __UNUSED__,
6308 if (!bd->lock_user_stacking) 6145 if (!bd->lock_user_stacking)
6309 e_border_raise(bd); 6146 e_border_raise(bd);
6310 6147
6311 if (e->direction == MOVE) 6148 if (e->direction == E_POINTER_MOVE)
6312 { 6149 {
6313 bd->cur_mouse_action = e_action_find("window_move"); 6150 bd->cur_mouse_action = e_action_find("window_move");
6314 if (bd->cur_mouse_action) 6151 if (bd->cur_mouse_action)
@@ -6330,43 +6167,43 @@ _e_border_cb_window_move_resize_request(void *data __UNUSED__,
6330 6167
6331 switch (e->direction) 6168 switch (e->direction)
6332 { 6169 {
6333 case RESIZE_TL: 6170 case E_POINTER_RESIZE_TL:
6334 bd->resize_mode = RESIZE_TL; 6171 bd->resize_mode = E_POINTER_RESIZE_TL;
6335 GRAV_SET(bd, ECORE_X_GRAVITY_SE); 6172 GRAV_SET(bd, ECORE_X_GRAVITY_SE);
6336 break; 6173 break;
6337 6174
6338 case RESIZE_T: 6175 case E_POINTER_RESIZE_T:
6339 bd->resize_mode = RESIZE_T; 6176 bd->resize_mode = E_POINTER_RESIZE_T;
6340 GRAV_SET(bd, ECORE_X_GRAVITY_S); 6177 GRAV_SET(bd, ECORE_X_GRAVITY_S);
6341 break; 6178 break;
6342 6179
6343 case RESIZE_TR: 6180 case E_POINTER_RESIZE_TR:
6344 bd->resize_mode = RESIZE_TR; 6181 bd->resize_mode = E_POINTER_RESIZE_TR;
6345 GRAV_SET(bd, ECORE_X_GRAVITY_SW); 6182 GRAV_SET(bd, ECORE_X_GRAVITY_SW);
6346 break; 6183 break;
6347 6184
6348 case RESIZE_R: 6185 case E_POINTER_RESIZE_R:
6349 bd->resize_mode = RESIZE_R; 6186 bd->resize_mode = E_POINTER_RESIZE_R;
6350 GRAV_SET(bd, ECORE_X_GRAVITY_W); 6187 GRAV_SET(bd, ECORE_X_GRAVITY_W);
6351 break; 6188 break;
6352 6189
6353 case RESIZE_BR: 6190 case E_POINTER_RESIZE_BR:
6354 bd->resize_mode = RESIZE_BR; 6191 bd->resize_mode = E_POINTER_RESIZE_BR;
6355 GRAV_SET(bd, ECORE_X_GRAVITY_NW); 6192 GRAV_SET(bd, ECORE_X_GRAVITY_NW);
6356 break; 6193 break;
6357 6194
6358 case RESIZE_B: 6195 case E_POINTER_RESIZE_B:
6359 bd->resize_mode = RESIZE_B; 6196 bd->resize_mode = E_POINTER_RESIZE_B;
6360 GRAV_SET(bd, ECORE_X_GRAVITY_N); 6197 GRAV_SET(bd, ECORE_X_GRAVITY_N);
6361 break; 6198 break;
6362 6199
6363 case RESIZE_BL: 6200 case E_POINTER_RESIZE_BL:
6364 bd->resize_mode = RESIZE_BL; 6201 bd->resize_mode = E_POINTER_RESIZE_BL;
6365 GRAV_SET(bd, ECORE_X_GRAVITY_NE); 6202 GRAV_SET(bd, ECORE_X_GRAVITY_NE);
6366 break; 6203 break;
6367 6204
6368 case RESIZE_L: 6205 case E_POINTER_RESIZE_L:
6369 bd->resize_mode = RESIZE_L; 6206 bd->resize_mode = E_POINTER_RESIZE_L;
6370 GRAV_SET(bd, ECORE_X_GRAVITY_E); 6207 GRAV_SET(bd, ECORE_X_GRAVITY_E);
6371 break; 6208 break;
6372 6209
@@ -6465,7 +6302,6 @@ _e_border_cb_sync_alarm(void *data __UNUSED__,
6465 bd->changes.pos = 1; 6302 bd->changes.pos = 1;
6466 6303
6467 _e_border_eval(bd); 6304 _e_border_eval(bd);
6468 evas_render(bd->bg_evas);
6469 6305
6470 ecore_x_pointer_xy_get(e_manager_current_get()->root, 6306 ecore_x_pointer_xy_get(e_manager_current_get()->root,
6471 &bd->mouse.current.mx, 6307 &bd->mouse.current.mx,
@@ -6494,7 +6330,7 @@ _e_border_cb_efreet_cache_update(void *data __UNUSED__,
6494 bd->desktop = NULL; 6330 bd->desktop = NULL;
6495 } 6331 }
6496 bd->changes.icon = 1; 6332 bd->changes.icon = 1;
6497 bd->changed = 1; 6333 BD_CHANGED(bd);
6498 } 6334 }
6499 /* 6335 /*
6500 e_init_status_set(_("Desktop files scan done")); 6336 e_init_status_set(_("Desktop files scan done"));
@@ -6515,7 +6351,7 @@ _e_border_cb_config_icon_theme(void *data __UNUSED__,
6515 EINA_LIST_FOREACH(borders, l, bd) 6351 EINA_LIST_FOREACH(borders, l, bd)
6516 { 6352 {
6517 bd->changes.icon = 1; 6353 bd->changes.icon = 1;
6518 bd->changed = 1; 6354 BD_CHANGED(bd);
6519 } 6355 }
6520 return ECORE_CALLBACK_PASS_ON; 6356 return ECORE_CALLBACK_PASS_ON;
6521} 6357}
@@ -6583,253 +6419,175 @@ _e_border_cb_signal_bind(void *data,
6583 emission, source); 6419 emission, source);
6584} 6420}
6585 6421
6422static void
6423_e_border_cb_mouse_in(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
6424{
6425 Evas_Event_Mouse_In *ev = event_info;
6426 E_Border *bd = data;
6427
6428 if (grabbed) return;
6429 if ((bd == focused) || (bd == focusing)) return;
6430 if (focus_locked && (bd != warp_timer_border)) return;
6431 if (e_object_is_del(E_OBJECT(bd))) return;
6432 if (!bd->iconic)
6433 e_focus_event_mouse_in(bd);
6434 bd->mouse.current.mx = ev->output.x;
6435 bd->mouse.current.my = ev->output.y;
6436 return;
6437}
6438
6586static Eina_Bool 6439static Eina_Bool
6587_e_border_cb_mouse_in(void *data, 6440_e_border_cb_mouse_x_in(void *data EINA_UNUSED, int t EINA_UNUSED, Ecore_X_Event_Mouse_In *ev)
6588 int type __UNUSED__,
6589 void *event)
6590{ 6441{
6591 Ecore_X_Event_Mouse_In *ev;
6592 E_Border *bd; 6442 E_Border *bd;
6593 6443
6594 ev = event; 6444 if (grabbed) return ECORE_CALLBACK_RENEW;
6595 bd = data; 6445 bd = e_border_find_by_window(ev->event_win);
6596#ifdef INOUTDEBUG_MOUSE 6446 if (!bd) return ECORE_CALLBACK_RENEW;
6597 { 6447 if ((bd == focused) || (bd == focusing)) return ECORE_CALLBACK_RENEW;
6598 time_t t; 6448 if (focus_locked && (bd != warp_timer_border)) return ECORE_CALLBACK_RENEW;
6599 char *ct; 6449 if (e_object_is_del(E_OBJECT(bd))) return ECORE_CALLBACK_RENEW;
6600 6450 if (!bd->iconic)
6601 const char *modes[] = { 6451 e_focus_event_mouse_in(bd);
6602 "MODE_NORMAL",
6603 "MODE_WHILE_GRABBED",
6604 "MODE_GRAB",
6605 "MODE_UNGRAB"
6606 };
6607 const char *details[] = {
6608 "DETAIL_ANCESTOR",
6609 "DETAIL_VIRTUAL",
6610 "DETAIL_INFERIOR",
6611 "DETAIL_NON_LINEAR",
6612 "DETAIL_NON_LINEAR_VIRTUAL",
6613 "DETAIL_POINTER",
6614 "DETAIL_POINTER_ROOT",
6615 "DETAIL_DETAIL_NONE"
6616 };
6617 t = time(NULL);
6618 ct = ctime(&t);
6619 ct[strlen(ct) - 1] = 0;
6620 DBG("@@ ->IN 0x%x 0x%x %s md=%s dt=%s",
6621 ev->win, ev->event_win,
6622 ct,
6623 modes[ev->mode],
6624 details[ev->detail]);
6625 }
6626#endif
6627 if (grabbed) return ECORE_CALLBACK_PASS_ON;
6628 if (focus_locked) return ECORE_CALLBACK_RENEW;
6629 if (ev->event_win == bd->win)
6630 {
6631 if (focus_locked && (bd != warp_timer_border)) return ECORE_CALLBACK_RENEW;
6632 if (!bd->iconic)
6633 e_focus_event_mouse_in(bd);
6634 }
6635 else if (focus_locked)
6636 return ECORE_CALLBACK_RENEW;
6637#if 0
6638 if ((ev->win != bd->win) &&
6639 (ev->win != bd->event_win) &&
6640 (ev->event_win != bd->win) &&
6641 (ev->event_win != bd->event_win))
6642 return ECORE_CALLBACK_PASS_ON;
6643#else
6644 if (ev->win != bd->event_win) return ECORE_CALLBACK_PASS_ON;
6645#endif
6646 bd->mouse.current.mx = ev->root.x; 6452 bd->mouse.current.mx = ev->root.x;
6647 bd->mouse.current.my = ev->root.y; 6453 bd->mouse.current.my = ev->root.y;
6648 if (!bd->bg_evas_in) 6454 return ECORE_CALLBACK_RENEW;
6649 { 6455}
6650 evas_event_feed_mouse_in(bd->bg_evas, ev->time, NULL); 6456
6651 bd->bg_evas_in = EINA_TRUE; 6457static void
6652 } 6458_e_border_cb_mouse_out(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
6653 return ECORE_CALLBACK_PASS_ON; 6459{
6460 Evas_Event_Mouse_Out *ev = event_info;
6461 E_Border *bd = data;
6462
6463 if (grabbed) return;
6464 if (bd->fullscreen) return;
6465 if ((bd != focused) && (bd == focusing)) return;
6466 if (e_object_is_del(E_OBJECT(bd))) return;
6467 if (E_INSIDE(ev->output.x, ev->output.y, bd->x, bd->y, bd->w, bd->h)) return;
6468 if (!bd->iconic)
6469 e_focus_event_mouse_out(bd);
6470 bd->mouse.current.mx = ev->output.x;
6471 bd->mouse.current.my = ev->output.y;
6654} 6472}
6655 6473
6656static Eina_Bool 6474static Eina_Bool
6657_e_border_cb_mouse_out(void *data, 6475_e_border_cb_mouse_x_out(void *data EINA_UNUSED, int t EINA_UNUSED, Ecore_X_Event_Mouse_Out *ev)
6658 int type __UNUSED__,
6659 void *event)
6660{ 6476{
6661 Ecore_X_Event_Mouse_Out *ev;
6662 E_Border *bd; 6477 E_Border *bd;
6663 6478
6664 ev = event; 6479 if (grabbed) return ECORE_CALLBACK_RENEW;
6665 bd = data; 6480 bd = e_border_find_by_window(ev->event_win);
6666#ifdef INOUTDEBUG_MOUSE 6481 if (!bd) return ECORE_CALLBACK_RENEW;
6667 { 6482 if (bd->fullscreen) return ECORE_CALLBACK_RENEW;
6668 time_t t; 6483 if ((bd != focused) && (bd == focusing)) return ECORE_CALLBACK_RENEW;
6669 char *ct; 6484 if (e_object_is_del(E_OBJECT(bd))) return ECORE_CALLBACK_RENEW;
6485 if (E_INSIDE(ev->root.x, ev->root.y, bd->x, bd->y, bd->w, bd->h)) return ECORE_CALLBACK_RENEW;
6670 6486
6671 const char *modes[] = { 6487 if ((ev->mode == ECORE_X_EVENT_MODE_UNGRAB) &&
6672 "MODE_NORMAL", 6488 (ev->detail == ECORE_X_EVENT_DETAIL_INFERIOR))
6673 "MODE_WHILE_GRABBED",
6674 "MODE_GRAB",
6675 "MODE_UNGRAB"
6676 };
6677 const char *details[] = {
6678 "DETAIL_ANCESTOR",
6679 "DETAIL_VIRTUAL",
6680 "DETAIL_INFERIOR",
6681 "DETAIL_NON_LINEAR",
6682 "DETAIL_NON_LINEAR_VIRTUAL",
6683 "DETAIL_POINTER",
6684 "DETAIL_POINTER_ROOT",
6685 "DETAIL_DETAIL_NONE"
6686 };
6687 t = time(NULL);
6688 ct = ctime(&t);
6689 ct[strlen(ct) - 1] = 0;
6690 DBG("@@ <-OUT 0x%x 0x%x %s md=%s dt=%s",
6691 ev->win, ev->event_win,
6692 ct,
6693 modes[ev->mode],
6694 details[ev->detail]);
6695 }
6696#endif
6697 if (grabbed) return ECORE_CALLBACK_PASS_ON;
6698 if (ev->event_win == bd->win)
6699 {
6700 if (bd->fullscreen)
6701 return ECORE_CALLBACK_PASS_ON;
6702 if ((ev->mode == ECORE_X_EVENT_MODE_UNGRAB) &&
6703 (ev->detail == ECORE_X_EVENT_DETAIL_INFERIOR))
6704 return ECORE_CALLBACK_PASS_ON;
6705 if (ev->mode == ECORE_X_EVENT_MODE_GRAB)
6706 return ECORE_CALLBACK_PASS_ON;
6707 if ((ev->mode == ECORE_X_EVENT_MODE_NORMAL) &&
6708 (ev->detail == ECORE_X_EVENT_DETAIL_INFERIOR))
6709 return ECORE_CALLBACK_PASS_ON;
6710 if (!bd->iconic)
6711 e_focus_event_mouse_out(bd);
6712 }
6713#if 0
6714 if ((ev->win != bd->win) &&
6715 (ev->win != bd->event_win) &&
6716 (ev->event_win != bd->win) &&
6717 (ev->event_win != bd->event_win))
6718 return ECORE_CALLBACK_PASS_ON; 6489 return ECORE_CALLBACK_PASS_ON;
6719#else 6490 if (ev->mode == ECORE_X_EVENT_MODE_GRAB)
6720 if (ev->win != bd->event_win) return ECORE_CALLBACK_PASS_ON; 6491 return ECORE_CALLBACK_PASS_ON;
6721#endif 6492 if ((ev->mode == ECORE_X_EVENT_MODE_NORMAL) &&
6493 (ev->detail == ECORE_X_EVENT_DETAIL_INFERIOR))
6494 return ECORE_CALLBACK_PASS_ON;
6495 if (!bd->iconic)
6496 e_focus_event_mouse_out(bd);
6722 bd->mouse.current.mx = ev->root.x; 6497 bd->mouse.current.mx = ev->root.x;
6723 bd->mouse.current.my = ev->root.y; 6498 bd->mouse.current.my = ev->root.y;
6724 if (bd->bg_evas_in) 6499 return ECORE_CALLBACK_RENEW;
6500}
6501
6502static void
6503_e_border_cb_mouse_wheel_helper(E_Border *bd, Evas_Point *output, E_Binding_Event_Wheel *ev)
6504{
6505 bd->mouse.current.mx = output->x;
6506 bd->mouse.current.my = output->y;
6507 if (!bd->cur_mouse_action)
6725 { 6508 {
6726 if (!((evas_event_down_count_get(bd->bg_evas) > 0) && 6509 e_bindings_wheel_event_handle(E_BINDING_CONTEXT_WINDOW,
6727 (!((ev->mode == ECORE_X_EVENT_MODE_GRAB) && 6510 E_OBJECT(bd), ev);
6728 (ev->detail == ECORE_X_EVENT_DETAIL_NON_LINEAR)))))
6729 {
6730 if (ev->mode == ECORE_X_EVENT_MODE_GRAB)
6731 evas_event_feed_mouse_cancel(bd->bg_evas, ev->time, NULL);
6732 evas_event_feed_mouse_out(bd->bg_evas, ev->time, NULL);
6733 bd->bg_evas_in = EINA_FALSE;
6734 }
6735 } 6511 }
6736 return ECORE_CALLBACK_PASS_ON;
6737} 6512}
6738 6513
6739static Eina_Bool 6514static Eina_Bool
6740_e_border_cb_mouse_wheel(void *data, 6515_e_border_cb_mouse_x_wheel(void *d EINA_UNUSED, int t EINA_UNUSED, Ecore_Event_Mouse_Wheel *ev)
6741 int type __UNUSED__,
6742 void *event)
6743{ 6516{
6744 Ecore_Event_Mouse_Wheel *ev;
6745 E_Border *bd; 6517 E_Border *bd;
6518 E_Binding_Event_Wheel ev2;
6746 6519
6747 ev = event; 6520 if (action_input_win)
6748 bd = data; 6521 bd = action_border;
6749 if ((ev->event_window == bd->win) || 6522 else
6750 (ev->event_window == bd->event_win))
6751 { 6523 {
6752 bd->mouse.current.mx = ev->root.x; 6524 bd = e_border_find_by_client_window(ev->window);
6753 bd->mouse.current.my = ev->root.y; 6525 if (!bd) return ECORE_CALLBACK_RENEW;
6754 if (!bd->cur_mouse_action) 6526 /* event_window here should be bd->win if it isn't the same as window, not sure if this can NOT happen */
6755 { 6527 if ((ev->window != ev->event_window) && (bd->win != ev->event_window))
6756 E_Binding_Event_Wheel ev2; 6528 return ECORE_CALLBACK_RENEW;
6757
6758 e_bindings_ecore_event_mouse_wheel_convert(ev, &ev2);
6759 e_bindings_wheel_event_handle(E_BINDING_CONTEXT_WINDOW,
6760 E_OBJECT(bd), &ev2);
6761 }
6762 } 6529 }
6763 evas_event_feed_mouse_wheel(bd->bg_evas, ev->direction, ev->z, ev->timestamp, NULL); 6530 e_bindings_ecore_event_mouse_wheel_convert(ev, &ev2);
6764 return ECORE_CALLBACK_PASS_ON; 6531 _e_border_cb_mouse_wheel_helper(bd, (Evas_Point*)&ev->root, &ev2);
6532 return ECORE_CALLBACK_RENEW;
6765} 6533}
6766 6534
6767static Eina_Bool 6535static void
6768_e_border_cb_mouse_down(void *data, 6536_e_border_cb_mouse_wheel(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
6769 int type __UNUSED__,
6770 void *event)
6771{ 6537{
6772 Ecore_Event_Mouse_Button *ev; 6538 Evas_Event_Mouse_Wheel *ev = event_info;
6773 E_Border *bd; 6539 E_Border *bd = data;
6540 E_Binding_Event_Wheel ev2;
6774 6541
6775 ev = event; 6542 if (action_border) return; // already existing border doing something
6776 bd = data; 6543 e_bindings_evas_event_mouse_wheel_convert(ev, &ev2);
6777 if ((ev->event_window == bd->win) || 6544 _e_border_cb_mouse_wheel_helper(bd, &ev->output, &ev2);
6778 (ev->event_window == bd->event_win)) 6545}
6779 {
6780 if ((ev->buttons >= 1) && (ev->buttons <= 3))
6781 {
6782 bd->mouse.last_down[ev->buttons - 1].mx = ev->root.x;
6783 bd->mouse.last_down[ev->buttons - 1].my = ev->root.y;
6784 bd->mouse.last_down[ev->buttons - 1].x = bd->x + bd->fx.x;
6785 bd->mouse.last_down[ev->buttons - 1].y = bd->y + bd->fx.y;
6786 bd->mouse.last_down[ev->buttons - 1].w = bd->w;
6787 bd->mouse.last_down[ev->buttons - 1].h = bd->h;
6788 }
6789 else
6790 {
6791 bd->moveinfo.down.x = bd->x + bd->fx.x;
6792 bd->moveinfo.down.y = bd->y + bd->fx.y;
6793 bd->moveinfo.down.w = bd->w;
6794 bd->moveinfo.down.h = bd->h;
6795 }
6796 bd->mouse.current.mx = ev->root.x;
6797 bd->mouse.current.my = ev->root.y;
6798 if (!bd->cur_mouse_action)
6799 {
6800 E_Binding_Event_Mouse_Button ev2;
6801 6546
6802 e_bindings_ecore_event_mouse_button_convert(ev, &ev2); 6547static void
6803 bd->cur_mouse_action = 6548_e_border_cb_mouse_down_helper(E_Border *bd, int button, Evas_Point *output, E_Binding_Event_Mouse_Button *ev)
6804 e_bindings_mouse_down_event_handle(E_BINDING_CONTEXT_WINDOW, 6549{
6805 E_OBJECT(bd), &ev2); 6550 if ((button >= 1) && (button <= 3))
6806 if (bd->cur_mouse_action) 6551 {
6807 { 6552 bd->mouse.last_down[button - 1].mx = output->x;
6808 if ((!bd->cur_mouse_action->func.end_mouse) && 6553 bd->mouse.last_down[button - 1].my = output->y;
6809 (!bd->cur_mouse_action->func.end)) 6554 bd->mouse.last_down[button - 1].x = bd->x + bd->fx.x;
6810 bd->cur_mouse_action = NULL; 6555 bd->mouse.last_down[button - 1].y = bd->y + bd->fx.y;
6811 if (bd->cur_mouse_action) 6556 bd->mouse.last_down[button - 1].w = bd->w;
6812 e_object_ref(E_OBJECT(bd->cur_mouse_action)); 6557 bd->mouse.last_down[button - 1].h = bd->h;
6813 }
6814 }
6815 e_focus_event_mouse_down(bd);
6816 } 6558 }
6817 if (ev->window != ev->event_window) 6559 else
6818 { 6560 {
6819 return 1; 6561 bd->moveinfo.down.x = bd->x + bd->fx.x;
6562 bd->moveinfo.down.y = bd->y + bd->fx.y;
6563 bd->moveinfo.down.w = bd->w;
6564 bd->moveinfo.down.h = bd->h;
6820 } 6565 }
6821 if ((ev->window != bd->event_win) && (ev->event_window != bd->win)) 6566 bd->mouse.current.mx = output->x;
6567 bd->mouse.current.my = output->y;
6568 if (!bd->cur_mouse_action)
6822 { 6569 {
6823 return 1; 6570 bd->cur_mouse_action =
6571 e_bindings_mouse_down_event_handle(E_BINDING_CONTEXT_WINDOW,
6572 E_OBJECT(bd), ev);
6573 if (bd->cur_mouse_action)
6574 {
6575 if ((!bd->cur_mouse_action->func.end_mouse) &&
6576 (!bd->cur_mouse_action->func.end))
6577 bd->cur_mouse_action = NULL;
6578 if (bd->cur_mouse_action)
6579 e_object_ref(E_OBJECT(bd->cur_mouse_action));
6580 }
6824 } 6581 }
6825 if ((ev->buttons >= 1) && (ev->buttons <= 3)) 6582 e_focus_event_mouse_down(bd);
6583 if ((button >= 1) && (button <= 3))
6826 { 6584 {
6827 bd->mouse.last_down[ev->buttons - 1].mx = ev->root.x; 6585 bd->mouse.last_down[button - 1].mx = output->x;
6828 bd->mouse.last_down[ev->buttons - 1].my = ev->root.y; 6586 bd->mouse.last_down[button - 1].my = output->y;
6829 bd->mouse.last_down[ev->buttons - 1].x = bd->x + bd->fx.x; 6587 bd->mouse.last_down[button - 1].x = bd->x + bd->fx.x;
6830 bd->mouse.last_down[ev->buttons - 1].y = bd->y + bd->fx.y; 6588 bd->mouse.last_down[button - 1].y = bd->y + bd->fx.y;
6831 bd->mouse.last_down[ev->buttons - 1].w = bd->w; 6589 bd->mouse.last_down[button - 1].w = bd->w;
6832 bd->mouse.last_down[ev->buttons - 1].h = bd->h; 6590 bd->mouse.last_down[button - 1].h = bd->h;
6833 } 6591 }
6834 else 6592 else
6835 { 6593 {
@@ -6838,87 +6596,122 @@ _e_border_cb_mouse_down(void *data,
6838 bd->moveinfo.down.w = bd->w; 6596 bd->moveinfo.down.w = bd->w;
6839 bd->moveinfo.down.h = bd->h; 6597 bd->moveinfo.down.h = bd->h;
6840 } 6598 }
6841 bd->mouse.current.mx = ev->root.x; 6599 bd->mouse.current.mx = output->x;
6842 bd->mouse.current.my = ev->root.y; 6600 bd->mouse.current.my = output->y;
6843/* 6601/*
6844 if (bd->moving) 6602 if (bd->moving)
6845 { 6603 {
6846 } 6604 }
6847 else if (bd->resize_mode != RESIZE_NONE) 6605 else if (bd->resize_mode != E_POINTER_RESIZE_NONE)
6848 { 6606 {
6849 } 6607 }
6850 else 6608 else
6851 */ 6609 */
6852 {
6853 Evas_Button_Flags flags = EVAS_BUTTON_NONE;
6854
6855 if (ev->double_click) flags |= EVAS_BUTTON_DOUBLE_CLICK;
6856 if (ev->triple_click) flags |= EVAS_BUTTON_TRIPLE_CLICK;
6857 evas_event_feed_mouse_down(bd->bg_evas, ev->buttons, flags, ev->timestamp, NULL);
6858 }
6859 return ECORE_CALLBACK_PASS_ON;
6860} 6610}
6861 6611
6862static Eina_Bool 6612static Eina_Bool
6863_e_border_cb_mouse_up(void *data, 6613_e_border_cb_mouse_x_down(void *d EINA_UNUSED, int t EINA_UNUSED, Ecore_Event_Mouse_Button *ev)
6864 int type __UNUSED__,
6865 void *event)
6866{ 6614{
6867 Ecore_Event_Mouse_Button *ev;
6868 E_Border *bd; 6615 E_Border *bd;
6616 E_Binding_Event_Mouse_Button ev2;
6869 6617
6870 ev = event; 6618 if (action_input_win)
6871 bd = data; 6619 bd = action_border;
6872 if ((ev->event_window == bd->win) || 6620 else
6873 (ev->event_window == bd->event_win))
6874 { 6621 {
6875 if ((ev->buttons >= 1) && (ev->buttons <= 3)) 6622 bd = e_border_find_by_client_window(ev->window);
6876 { 6623 if (!bd) return ECORE_CALLBACK_RENEW;
6877 bd->mouse.last_up[ev->buttons - 1].mx = ev->root.x; 6624 /* event_window here should be bd->win if it isn't the same as window, not sure if this can NOT happen */
6878 bd->mouse.last_up[ev->buttons - 1].my = ev->root.y; 6625 if ((ev->window != ev->event_window) && (bd->win != ev->event_window))
6879 bd->mouse.last_up[ev->buttons - 1].x = bd->x + bd->fx.x; 6626 return ECORE_CALLBACK_RENEW;
6880 bd->mouse.last_up[ev->buttons - 1].y = bd->y + bd->fx.y; 6627 }
6881 } 6628 e_bindings_ecore_event_mouse_button_convert(ev, &ev2);
6882 bd->mouse.current.mx = ev->root.x; 6629 _e_border_cb_mouse_down_helper(bd, ev->buttons, (Evas_Point*)&ev->root, &ev2);
6883 bd->mouse.current.my = ev->root.y; 6630 return ECORE_CALLBACK_RENEW;
6884 /* also we dont pass the same params that went in - then again that */ 6631}
6885 /* should be ok as we are just ending the action if it has an end */
6886 if (bd->cur_mouse_action)
6887 {
6888 E_Binding_Event_Mouse_Button ev2;
6889 6632
6890 e_bindings_ecore_event_mouse_button_convert(ev, &ev2); 6633static void
6891 if (bd->cur_mouse_action->func.end_mouse) 6634_e_border_cb_mouse_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
6892 bd->cur_mouse_action->func.end_mouse(E_OBJECT(bd), "", &ev2); 6635{
6893 else if (bd->cur_mouse_action->func.end) 6636 Evas_Event_Mouse_Down *ev = event_info;
6894 bd->cur_mouse_action->func.end(E_OBJECT(bd), ""); 6637 E_Border *bd = data;
6895 e_object_unref(E_OBJECT(bd->cur_mouse_action)); 6638 E_Binding_Event_Mouse_Button ev2;
6896 bd->cur_mouse_action = NULL;
6897 }
6898 else
6899 {
6900 E_Binding_Event_Mouse_Button ev2;
6901 6639
6902 e_bindings_ecore_event_mouse_button_convert(ev, &ev2); 6640 if (action_border) return; // already existing border doing something
6903 if (!e_bindings_mouse_up_event_handle(E_BINDING_CONTEXT_WINDOW, E_OBJECT(bd), &ev2)) 6641 e_bindings_evas_event_mouse_button_convert(ev, &ev2);
6904 e_focus_event_mouse_up(bd); 6642 _e_border_cb_mouse_down_helper(bd, ev->button, &ev->output, &ev2);
6905 } 6643}
6644
6645static void
6646_e_border_cb_mouse_up_helper(E_Border *bd, int button, Evas_Point *output, E_Binding_Event_Mouse_Button* ev)
6647{
6648 if ((button >= 1) && (button <= 3))
6649 {
6650 bd->mouse.last_up[button - 1].mx = output->x;
6651 bd->mouse.last_up[button - 1].my = output->y;
6652 bd->mouse.last_up[button - 1].x = bd->x + bd->fx.x;
6653 bd->mouse.last_up[button - 1].y = bd->y + bd->fx.y;
6906 } 6654 }
6907 if (ev->window != bd->event_win) return ECORE_CALLBACK_PASS_ON; 6655 bd->mouse.current.mx = output->x;
6908 if ((ev->buttons >= 1) && (ev->buttons <= 3)) 6656 bd->mouse.current.my = output->y;
6657 /* also we dont pass the same params that went in - then again that */
6658 /* should be ok as we are just ending the action if it has an end */
6659 if (bd->cur_mouse_action)
6909 { 6660 {
6910 bd->mouse.last_up[ev->buttons - 1].mx = ev->root.x; 6661 if (bd->cur_mouse_action->func.end_mouse)
6911 bd->mouse.last_up[ev->buttons - 1].my = ev->root.y; 6662 bd->cur_mouse_action->func.end_mouse(E_OBJECT(bd), "", ev);
6912 bd->mouse.last_up[ev->buttons - 1].x = bd->x + bd->fx.x; 6663 else if (bd->cur_mouse_action->func.end)
6913 bd->mouse.last_up[ev->buttons - 1].y = bd->y + bd->fx.y; 6664 bd->cur_mouse_action->func.end(E_OBJECT(bd), "");
6665 e_object_unref(E_OBJECT(bd->cur_mouse_action));
6666 bd->cur_mouse_action = NULL;
6667 }
6668 else
6669 {
6670 if (!e_bindings_mouse_up_event_handle(E_BINDING_CONTEXT_WINDOW, E_OBJECT(bd), ev))
6671 e_focus_event_mouse_up(bd);
6672 }
6673 if ((button >= 1) && (button <= 3))
6674 {
6675 bd->mouse.last_up[button - 1].mx = output->x;
6676 bd->mouse.last_up[button - 1].my = output->y;
6677 bd->mouse.last_up[button - 1].x = bd->x + bd->fx.x;
6678 bd->mouse.last_up[button - 1].y = bd->y + bd->fx.y;
6914 } 6679 }
6915 bd->mouse.current.mx = ev->root.x;
6916 bd->mouse.current.my = ev->root.y;
6917 6680
6918 bd->drag.start = 0; 6681 bd->drag.start = 0;
6682}
6919 6683
6920 evas_event_feed_mouse_up(bd->bg_evas, ev->buttons, EVAS_BUTTON_NONE, ev->timestamp, NULL); 6684static Eina_Bool
6921 return ECORE_CALLBACK_PASS_ON; 6685_e_border_cb_mouse_x_up(void *d EINA_UNUSED, int t EINA_UNUSED, Ecore_Event_Mouse_Button *ev)
6686{
6687 E_Border *bd;
6688 E_Binding_Event_Mouse_Button ev2;
6689
6690 if (action_input_win)
6691 bd = action_border;
6692 else
6693 {
6694 bd = e_border_find_by_client_window(ev->window);
6695 if (!bd) return ECORE_CALLBACK_RENEW;
6696 /* event_window here should be bd->win if it isn't the same as window, not sure if this can NOT happen */
6697 if ((ev->window != ev->event_window) && (bd->win != ev->event_window))
6698 return ECORE_CALLBACK_RENEW;
6699 }
6700 e_bindings_ecore_event_mouse_button_convert(ev, &ev2);
6701 _e_border_cb_mouse_up_helper(bd, ev->buttons, (Evas_Point*)&ev->root, &ev2);
6702 return ECORE_CALLBACK_RENEW;
6703}
6704
6705static void
6706_e_border_cb_mouse_up(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
6707{
6708 Evas_Event_Mouse_Down *ev = event_info;
6709 E_Border *bd = data;
6710 E_Binding_Event_Mouse_Button ev2;
6711
6712 if (action_border) return; // already existing border doing something
6713 e_bindings_evas_event_mouse_button_convert(ev, &ev2);
6714 _e_border_cb_mouse_up_helper(bd, ev->button, &ev->output, &ev2);
6922} 6715}
6923 6716
6924static void 6717static void
@@ -6973,20 +6766,12 @@ _e_border_stay_within_container(E_Border *bd, int x, int y, int *new_x, int *new
6973 } 6766 }
6974} 6767}
6975 6768
6976static Eina_Bool 6769static void
6977_e_border_cb_mouse_move(void *data, 6770_e_border_cb_mouse_move_helper(E_Border *bd, Evas_Point *output)
6978 int type __UNUSED__,
6979 void *event)
6980{ 6771{
6981 Ecore_Event_Mouse_Move *ev;
6982 E_Border *bd;
6983 6772
6984 ev = event; 6773 bd->mouse.current.mx = output->x;
6985 bd = data; 6774 bd->mouse.current.my = output->y;
6986 if ((ev->window != bd->event_win) &&
6987 (ev->event_window != bd->win)) return ECORE_CALLBACK_PASS_ON;
6988 bd->mouse.current.mx = ev->root.x;
6989 bd->mouse.current.my = ev->root.y;
6990 if (bd->moving) 6775 if (bd->moving)
6991 { 6776 {
6992 int x, y, new_x, new_y; 6777 int x, y, new_x, new_y;
@@ -6998,7 +6783,7 @@ _e_border_cb_mouse_move(void *data,
6998 bd->client.netwm.sync.wait = 0; 6783 bd->client.netwm.sync.wait = 0;
6999 if ((bd->client.netwm.sync.request) && 6784 if ((bd->client.netwm.sync.request) &&
7000 (bd->client.netwm.sync.alarm) && 6785 (bd->client.netwm.sync.alarm) &&
7001 (bd->client.netwm.sync.wait > 1)) return ECORE_CALLBACK_PASS_ON; 6786 (bd->client.netwm.sync.wait > 1)) return;
7002#endif 6787#endif
7003 if ((bd->moveinfo.down.button >= 1) && (bd->moveinfo.down.button <= 3)) 6788 if ((bd->moveinfo.down.button >= 1) && (bd->moveinfo.down.button <= 3))
7004 { 6789 {
@@ -7031,9 +6816,9 @@ _e_border_cb_mouse_move(void *data,
7031 bd->shelf_fix.y = 0; 6816 bd->shelf_fix.y = 0;
7032 bd->shelf_fix.modified = 0; 6817 bd->shelf_fix.modified = 0;
7033 e_border_move(bd, new_x, new_y); 6818 e_border_move(bd, new_x, new_y);
7034 e_zone_flip_coords_handle(bd->zone, ev->root.x, ev->root.y); 6819 e_zone_flip_coords_handle(bd->zone, output->x, output->y);
7035 } 6820 }
7036 else if (bd->resize_mode != RESIZE_NONE) 6821 else if (bd->resize_mode != E_POINTER_RESIZE_NONE)
7037 { 6822 {
7038 if ((bd->client.netwm.sync.request) && 6823 if ((bd->client.netwm.sync.request) &&
7039 (bd->client.netwm.sync.alarm)) 6824 (bd->client.netwm.sync.alarm))
@@ -7046,7 +6831,7 @@ _e_border_cb_mouse_move(void *data,
7046 { 6831 {
7047 bd->changes.pos = 1; 6832 bd->changes.pos = 1;
7048 bd->changes.size = 1; 6833 bd->changes.size = 1;
7049 bd->changed = 1; 6834 BD_CHANGED(bd);
7050 _e_border_client_move_resize_send(bd); 6835 _e_border_client_move_resize_send(bd);
7051 } 6836 }
7052 EINA_LIST_FREE(bd->pending_move_resize, pnd) 6837 EINA_LIST_FREE(bd->pending_move_resize, pnd)
@@ -7065,59 +6850,71 @@ _e_border_cb_mouse_move(void *data,
7065 else 6850 else
7066 _e_border_resize_handle(bd); 6851 _e_border_resize_handle(bd);
7067 } 6852 }
7068 else 6853 else if (bd->drag.start)
7069 { 6854 {
7070 if (bd->drag.start) 6855 if ((bd->drag.x == -1) && (bd->drag.y == -1))
7071 { 6856 {
7072 if ((bd->drag.x == -1) && (bd->drag.y == -1)) 6857 bd->drag.x = output->x;
7073 { 6858 bd->drag.y = output->y;
7074 bd->drag.x = ev->root.x; 6859 }
7075 bd->drag.y = ev->root.y; 6860 else
7076 } 6861 {
7077 else 6862 int dx, dy;
7078 {
7079 int dx, dy;
7080 6863
7081 dx = bd->drag.x - ev->root.x; 6864 dx = bd->drag.x - output->x;
7082 dy = bd->drag.y - ev->root.y; 6865 dy = bd->drag.y - output->y;
7083 if (((dx * dx) + (dy * dy)) > 6866 if (((dx * dx) + (dy * dy)) >
7084 (e_config->drag_resist * e_config->drag_resist)) 6867 (e_config->drag_resist * e_config->drag_resist))
6868 {
6869 /* start drag! */
6870 if (bd->icon_object)
7085 { 6871 {
7086 /* start drag! */ 6872 Evas_Object *o = NULL;
7087 if (bd->icon_object) 6873 Evas_Coord x, y, w, h;
6874 const char *drag_types[] = { "enlightenment/border" };
6875
6876 e_object_ref(E_OBJECT(bd));
6877 evas_object_geometry_get(bd->icon_object,
6878 &x, &y, &w, &h);
6879 drag_border = e_drag_new(bd->zone->container,
6880 x, y,
6881 drag_types, 1, bd, -1,
6882 NULL,
6883 _e_border_cb_drag_finished);
6884 o = e_border_icon_add(bd, drag_border->evas);
6885 if (!o)
7088 { 6886 {
7089 Evas_Object *o = NULL; 6887 /* FIXME: fallback icon for drag */
7090 Evas_Coord x, y, w, h; 6888 o = evas_object_rectangle_add(drag_border->evas);
7091 const char *drag_types[] = { "enlightenment/border" }; 6889 evas_object_color_set(o, 255, 255, 255, 255);
7092
7093 e_object_ref(E_OBJECT(bd));
7094 evas_object_geometry_get(bd->icon_object,
7095 &x, &y, &w, &h);
7096 drag_border = e_drag_new(bd->zone->container,
7097 bd->x + bd->fx.x + x,
7098 bd->y + bd->fx.y + y,
7099 drag_types, 1, bd, -1,
7100 NULL,
7101 _e_border_cb_drag_finished);
7102 o = e_border_icon_add(bd, drag_border->evas);
7103 if (!o)
7104 {
7105 /* FIXME: fallback icon for drag */
7106 o = evas_object_rectangle_add(drag_border->evas);
7107 evas_object_color_set(o, 255, 255, 255, 255);
7108 }
7109 e_drag_object_set(drag_border, o);
7110
7111 e_drag_resize(drag_border, w, h);
7112 e_drag_start(drag_border, bd->drag.x, bd->drag.y);
7113 } 6890 }
7114 bd->drag.start = 0; 6891 e_drag_object_set(drag_border, o);
6892
6893 e_drag_resize(drag_border, w, h);
6894 e_drag_start(drag_border, bd->drag.x, bd->drag.y);
7115 } 6895 }
6896 bd->drag.start = 0;
7116 } 6897 }
7117 } 6898 }
7118 evas_event_feed_mouse_move(bd->bg_evas, ev->x, ev->y, ev->timestamp, NULL);
7119 } 6899 }
7120 return ECORE_CALLBACK_PASS_ON; 6900}
6901
6902static Eina_Bool
6903_e_border_cb_mouse_x_move(void *d EINA_UNUSED, int t EINA_UNUSED, Ecore_Event_Mouse_Move *ev)
6904{
6905 if (!action_input_win) return ECORE_CALLBACK_RENEW;
6906 _e_border_cb_mouse_move_helper(action_border, (Evas_Point*)&ev->root);
6907 return ECORE_CALLBACK_RENEW;
6908}
6909
6910static void
6911_e_border_cb_mouse_move(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
6912{
6913 Evas_Event_Mouse_Move *ev = event_info;
6914 E_Border *bd = data;
6915
6916 if (action_border) return; // already existing border doing something
6917 _e_border_cb_mouse_move_helper(bd, &ev->cur.output);
7121} 6918}
7122 6919
7123static Eina_Bool 6920static Eina_Bool
@@ -7181,7 +6978,7 @@ _e_border_cb_desk_window_profile_change(void *data __UNUSED__,
7181 if (!e_object_is_del(E_OBJECT(bd))) 6978 if (!e_object_is_del(E_OBJECT(bd)))
7182 { 6979 {
7183 bd->client.e.fetch.profile = 1; 6980 bd->client.e.fetch.profile = 1;
7184 bd->changed = 1; 6981 BD_CHANGED(bd);
7185 } 6982 }
7186 } 6983 }
7187 return ECORE_CALLBACK_PASS_ON; 6984 return ECORE_CALLBACK_PASS_ON;
@@ -7228,17 +7025,20 @@ _e_border_post_move_resize_job(void *data)
7228 else if ((bd->post_move) && (bd->post_resize)) 7025 else if ((bd->post_move) && (bd->post_resize))
7229 { 7026 {
7230 ecore_x_window_move_resize(bd->win, 7027 ecore_x_window_move_resize(bd->win,
7231 bd->x + bd->fx.x, 7028 bd->x + bd->fx.x + bd->client_inset.l,
7232 bd->y + bd->fx.y, 7029 bd->y + bd->fx.y + bd->client_inset.t,
7233 bd->w, bd->h); 7030 bd->w - (bd->client_inset.l + bd->client_inset.r),
7031 bd->h - (bd->client_inset.t + bd->client_inset.b));
7234 } 7032 }
7235 else if (bd->post_move) 7033 else if (bd->post_move)
7236 { 7034 {
7237 ecore_x_window_move(bd->win, bd->x + bd->fx.x, bd->y + bd->fx.y); 7035 ecore_x_window_move(bd->win, bd->x + bd->fx.x + bd->client_inset.l, bd->y + bd->fx.y + bd->client_inset.t);
7238 } 7036 }
7239 else if (bd->post_resize) 7037 else if (bd->post_resize)
7240 { 7038 {
7241 ecore_x_window_resize(bd->win, bd->w, bd->h); 7039 ecore_x_window_resize(bd->win,
7040 bd->w - (bd->client_inset.l + bd->client_inset.r),
7041 bd->h - (bd->client_inset.t + bd->client_inset.b));
7242 } 7042 }
7243 7043
7244 if (bd->client.e.state.video) 7044 if (bd->client.e.state.video)
@@ -7598,7 +7398,7 @@ _e_border_eval0(E_Border *bd)
7598 // if (bd->client.icccm.step_w < 1) bd->client.icccm.step_w = 1; 7398 // if (bd->client.icccm.step_w < 1) bd->client.icccm.step_w = 1;
7599 // if (bd->client.icccm.step_h < 1) bd->client.icccm.step_h = 1; 7399 // if (bd->client.icccm.step_h < 1) bd->client.icccm.step_h = 1;
7600 // if doing a resize, fix it up 7400 // if doing a resize, fix it up
7601 if (bd->resize_mode != RESIZE_NONE) 7401 if (bd->resize_mode != E_POINTER_RESIZE_NONE)
7602 { 7402 {
7603 int x, y, w, h, new_w, new_h; 7403 int x, y, w, h, new_w, new_h;
7604 7404
@@ -7609,13 +7409,13 @@ _e_border_eval0(E_Border *bd)
7609 new_w = w; 7409 new_w = w;
7610 new_h = h; 7410 new_h = h;
7611 e_border_resize_limit(bd, &new_w, &new_h); 7411 e_border_resize_limit(bd, &new_w, &new_h);
7612 if ((bd->resize_mode == RESIZE_TL) || 7412 if ((bd->resize_mode == E_POINTER_RESIZE_TL) ||
7613 (bd->resize_mode == RESIZE_L) || 7413 (bd->resize_mode == E_POINTER_RESIZE_L) ||
7614 (bd->resize_mode == RESIZE_BL)) 7414 (bd->resize_mode == E_POINTER_RESIZE_BL))
7615 x += (w - new_w); 7415 x += (w - new_w);
7616 if ((bd->resize_mode == RESIZE_TL) || 7416 if ((bd->resize_mode == E_POINTER_RESIZE_TL) ||
7617 (bd->resize_mode == RESIZE_T) || 7417 (bd->resize_mode == E_POINTER_RESIZE_T) ||
7618 (bd->resize_mode == RESIZE_TR)) 7418 (bd->resize_mode == E_POINTER_RESIZE_TR))
7619 y += (h - new_h); 7419 y += (h - new_h);
7620 e_border_move_resize(bd, x, y, new_w, new_h); 7420 e_border_move_resize(bd, x, y, new_w, new_h);
7621 } 7421 }
@@ -7692,7 +7492,7 @@ _e_border_eval0(E_Border *bd)
7692 bd->parent->lock_close = 1; 7492 bd->parent->lock_close = 1;
7693 if (!bd->parent->client.lock_win) 7493 if (!bd->parent->client.lock_win)
7694 { 7494 {
7695 bd->parent->client.lock_win = ecore_x_window_input_new(bd->parent->client.shell_win, 0, 0, bd->parent->client.w, bd->parent->client.h); 7495 bd->parent->client.lock_win = ecore_x_window_input_new(bd->parent->win, 0, 0, bd->parent->client.w, bd->parent->client.h);
7696 ecore_x_window_show(bd->parent->client.lock_win); 7496 ecore_x_window_show(bd->parent->client.lock_win);
7697 } 7497 }
7698 } 7498 }
@@ -8273,7 +8073,7 @@ _e_border_eval0(E_Border *bd)
8273 { 8073 {
8274 if (!bd->internal) 8074 if (!bd->internal)
8275 ecore_x_window_save_set_add(bd->client.win); 8075 ecore_x_window_save_set_add(bd->client.win);
8276 ecore_x_window_reparent(bd->client.win, bd->client.shell_win, 0, 0); 8076 ecore_x_window_reparent(bd->client.win, bd->win, bd->client_inset.l, bd->client_inset.t);
8277 if (bd->visible) 8077 if (bd->visible)
8278 { 8078 {
8279 if ((bd->new_client) && (bd->internal) && 8079 if ((bd->new_client) && (bd->internal) &&
@@ -8329,7 +8129,7 @@ _e_border_eval0(E_Border *bd)
8329 8129
8330 if ((!bd->client.border.name) || (strcmp(bd->client.border.name, bordername))) 8130 if ((!bd->client.border.name) || (strcmp(bd->client.border.name, bordername)))
8331 { 8131 {
8332 Evas_Object *o; 8132 Evas_Object *o, *pbg = bd->bg_object;
8333 char buf[4096]; 8133 char buf[4096];
8334 int ok; 8134 int ok;
8335 8135
@@ -8338,12 +8138,15 @@ _e_border_eval0(E_Border *bd)
8338 8138
8339 if (bd->bg_object) 8139 if (bd->bg_object)
8340 { 8140 {
8141 int w, h;
8142
8143 w = bd->w, h = bd->h;
8341 bd->w -= (bd->client_inset.l + bd->client_inset.r); 8144 bd->w -= (bd->client_inset.l + bd->client_inset.r);
8342 bd->h -= (bd->client_inset.t + bd->client_inset.b); 8145 bd->h -= (bd->client_inset.t + bd->client_inset.b);
8343 bd->changes.size = 1; 8146 if ((bd->w != w) || (h != bd->h)) bd->changes.size = 1;
8344 evas_object_del(bd->bg_object); 8147 evas_object_del(bd->bg_object);
8345 } 8148 }
8346 o = edje_object_add(bd->bg_evas); 8149 o = edje_object_add(e_comp_get(bd)->evas);
8347 snprintf(buf, sizeof(buf), "e/widgets/border/%s/border", bd->client.border.name); 8150 snprintf(buf, sizeof(buf), "e/widgets/border/%s/border", bd->client.border.name);
8348 ok = e_theme_edje_object_set(o, "base/theme/borders", buf); 8151 ok = e_theme_edje_object_set(o, "base/theme/borders", buf);
8349 if ((!ok) && (strcmp(bd->client.border.name, "borderless"))) 8152 if ((!ok) && (strcmp(bd->client.border.name, "borderless")))
@@ -8366,67 +8169,76 @@ _e_border_eval0(E_Border *bd)
8366 } 8169 }
8367 } 8170 }
8368 8171
8369 bd->shaped = 0;
8370 if (ok) 8172 if (ok)
8371 { 8173 {
8372 const char *shape_option, *argb_option;
8373 int use_argb = 0;
8374
8375 bd->bg_object = o; 8174 bd->bg_object = o;
8376 8175
8377 if ((!e_config->use_shaped_win) && (!bd->client.argb))
8378 {
8379 argb_option = edje_object_data_get(o, "argb");
8380 if ((argb_option) && (!strcmp(argb_option, "1")))
8381 use_argb = 1;
8382
8383 o = bd->bg_object;
8384 if (use_argb != bd->argb)
8385 _e_border_frame_replace(bd, use_argb);
8386
8387 if (bd->icon_object != o)
8388 {
8389 if (bd->bg_object)
8390 {
8391 evas_object_show(bd->icon_object);
8392 edje_object_part_swallow(bd->bg_object, "e.swallow.icon", bd->icon_object);
8393 }
8394 else
8395 evas_object_hide(bd->icon_object);
8396 }
8397 o = bd->bg_object;
8398 }
8399
8400 if (!bd->argb)
8401 {
8402 shape_option = edje_object_data_get(o, "shaped");
8403 if ((shape_option) && (!strcmp(shape_option, "1")))
8404 bd->shaped = 1;
8405 }
8406
8407 if (bd->client.netwm.name) 8176 if (bd->client.netwm.name)
8408 edje_object_part_text_set(o, "e.text.title", 8177 edje_object_part_text_set(o, "e.text.title",
8409 bd->client.netwm.name); 8178 bd->client.netwm.name);
8410 else if (bd->client.icccm.title) 8179 else if (bd->client.icccm.title)
8411 edje_object_part_text_set(o, "e.text.title", 8180 edje_object_part_text_set(o, "e.text.title",
8412 bd->client.icccm.title); 8181 bd->client.icccm.title);
8182 bd->theme_shadow = !!edje_object_data_get(o, "shadow");
8183 _e_border_shadow(bd);
8413 } 8184 }
8414 else 8185 else
8415 { 8186 {
8187 if (strcmp(bordername, "borderless"))
8188 /* it should never happen that a theme fails to set the edje
8189 * unless it's using borderless
8190 */
8191 CRI("USER IS USING A SHITTY THEME! ABORT!!!!");
8416 evas_object_del(o); 8192 evas_object_del(o);
8417 bd->bg_object = NULL; 8193 bd->bg_object = NULL;
8194 E_FREE_FUNC(bd->icon_object, evas_object_del);
8195 o = bd->cw ? bd->cw->obj : NULL;
8196 }
8197 if (bd->cw) e_comp_win_reshadow(bd->cw);
8198 /* FIXME: it's theoretically possible that o is NULL here if first border eval occurs for a fullscreen
8199 * borderless window before its comp win has been set up;
8200 * E19 material imo
8201 */
8202 if (o)
8203 {
8204 if (bd->cw && (o == bd->cw->obj))
8205 {
8206 /* TODO: set these on cw->effect_obj...always. */
8207 evas_object_event_callback_del_full(o, EVAS_CALLBACK_MOUSE_IN, _e_border_cb_mouse_in, bd);
8208 evas_object_event_callback_del_full(o, EVAS_CALLBACK_MOUSE_MOVE, _e_border_cb_mouse_move, bd);
8209 evas_object_event_callback_del_full(o, EVAS_CALLBACK_MOUSE_OUT, _e_border_cb_mouse_out, bd);
8210 evas_object_event_callback_del_full(o, EVAS_CALLBACK_MOUSE_DOWN, _e_border_cb_mouse_down, bd);
8211 evas_object_event_callback_del_full(o, EVAS_CALLBACK_MOUSE_UP, _e_border_cb_mouse_up, bd);
8212 evas_object_event_callback_del_full(o, EVAS_CALLBACK_MOUSE_WHEEL, _e_border_cb_mouse_wheel, bd);
8213 }
8214 evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_IN, _e_border_cb_mouse_in, bd);
8215 evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_MOVE, _e_border_cb_mouse_move, bd);
8216 evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_OUT, _e_border_cb_mouse_out, bd);
8217 evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN, _e_border_cb_mouse_down, bd);
8218 evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_UP, _e_border_cb_mouse_up, bd);
8219 evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_WHEEL, _e_border_cb_mouse_wheel, bd);
8418 } 8220 }
8419 8221
8420 _e_border_client_inset_calc(bd); 8222 {
8223 // previously calculated
8224 Eina_Bool calc = bd->client_inset.calc;
8225 // previously was borderless
8226 Eina_Bool inset, pinset = !!(bd->client_inset.l + bd->client_inset.r + bd->client_inset.t + bd->client_inset.b);
8227
8228 _e_border_client_inset_calc(bd);
8229 inset = !!(bd->client_inset.l + bd->client_inset.r + bd->client_inset.t + bd->client_inset.b);
8230 if (calc && (inset != pinset) && (pbg || (!bd->bg_object)))
8231 {
8232 if (inset)
8233 bd->x -= bd->client_inset.l, bd->y -= bd->client_inset.t;
8234 else
8235 bd->x += bd->client_inset.l, bd->y += bd->client_inset.t;
8236 }
8237 }
8421 8238
8422 bd->w += (bd->client_inset.l + bd->client_inset.r); 8239 bd->w += (bd->client_inset.l + bd->client_inset.r);
8423 bd->h += (bd->client_inset.t + bd->client_inset.b); 8240 bd->h += (bd->client_inset.t + bd->client_inset.b);
8424 ecore_evas_shaped_set(bd->bg_ecore_evas, bd->shaped);
8425 bd->changes.size = 1; 8241 bd->changes.size = 1;
8426 /* really needed ? */
8427 ecore_x_window_move(bd->client.shell_win,
8428 bd->client_inset.l,
8429 bd->client_inset.t);
8430 8242
8431 if (bd->maximized != E_MAXIMIZE_NONE) 8243 if (bd->maximized != E_MAXIMIZE_NONE)
8432 { 8244 {
@@ -8462,10 +8274,6 @@ _e_border_eval0(E_Border *bd)
8462 // FIXME: in eval -do differently 8274 // FIXME: in eval -do differently
8463 // edje_object_message_signal_process(bd->bg_object); 8275 // edje_object_message_signal_process(bd->bg_object);
8464 // e_border_frame_recalc(bd); 8276 // e_border_frame_recalc(bd);
8465
8466 evas_object_move(bd->bg_object, 0, 0);
8467 evas_object_resize(bd->bg_object, bd->w, bd->h);
8468 evas_object_show(bd->bg_object);
8469 } 8277 }
8470 } 8278 }
8471 bd->client.border.changed = 0; 8279 bd->client.border.changed = 0;
@@ -8808,45 +8616,45 @@ _e_border_eval(E_Border *bd)
8808 if ((bd->changes.shading)) 8616 if ((bd->changes.shading))
8809 { 8617 {
8810 /* show at start of unshade (but don't hide until end of shade) */ 8618 /* show at start of unshade (but don't hide until end of shade) */
8811 if (bd->shaded) 8619 //if (bd->shaded)
8812 ecore_x_window_raise(bd->client.shell_win); 8620 //ecore_x_window_raise(bd->win);
8813 bd->changes.shading = 0; 8621 bd->changes.shading = 0;
8814 rem_change = 1; 8622 rem_change = 1;
8815 } 8623 }
8816 if ((bd->changes.shaded) && (bd->changes.pos) && (bd->changes.size)) 8624 if ((bd->changes.shaded) && (bd->changes.pos) && (bd->changes.size))
8817 { 8625 {
8818 if (bd->shaded) 8626 //if (bd->shaded)
8819 ecore_x_window_lower(bd->client.shell_win); 8627 //ecore_x_window_lower(bd->win);
8820 else 8628 //else
8821 ecore_x_window_raise(bd->client.shell_win); 8629 //ecore_x_window_raise(bd->win);
8822 bd->changes.shaded = 0; 8630 bd->changes.shaded = 0;
8823 rem_change = 1; 8631 rem_change = 1;
8824 } 8632 }
8825 else if ((bd->changes.shaded) && (bd->changes.pos)) 8633 else if ((bd->changes.shaded) && (bd->changes.pos))
8826 { 8634 {
8827 if (bd->shaded) 8635 //if (bd->shaded)
8828 ecore_x_window_lower(bd->client.shell_win); 8636 //ecore_x_window_lower(bd->win);
8829 else 8637 //else
8830 ecore_x_window_raise(bd->client.shell_win); 8638 //ecore_x_window_raise(bd->win);
8831 bd->changes.size = 1; 8639 bd->changes.size = 1;
8832 bd->changes.shaded = 0; 8640 bd->changes.shaded = 0;
8833 rem_change = 1; 8641 rem_change = 1;
8834 } 8642 }
8835 else if ((bd->changes.shaded) && (bd->changes.size)) 8643 else if ((bd->changes.shaded) && (bd->changes.size))
8836 { 8644 {
8837 if (bd->shaded) 8645 //if (bd->shaded)
8838 ecore_x_window_lower(bd->client.shell_win); 8646 //ecore_x_window_lower(bd->win);
8839 else 8647 //else
8840 ecore_x_window_raise(bd->client.shell_win); 8648 //ecore_x_window_raise(bd->win);
8841 bd->changes.shaded = 0; 8649 bd->changes.shaded = 0;
8842 rem_change = 1; 8650 rem_change = 1;
8843 } 8651 }
8844 else if (bd->changes.shaded) 8652 else if (bd->changes.shaded)
8845 { 8653 {
8846 if (bd->shaded) 8654 //if (bd->shaded)
8847 ecore_x_window_lower(bd->client.shell_win); 8655 //ecore_x_window_lower(bd->win);
8848 else 8656 //else
8849 ecore_x_window_raise(bd->client.shell_win); 8657 //ecore_x_window_raise(bd->win);
8850 bd->changes.size = 1; 8658 bd->changes.size = 1;
8851 bd->changes.shaded = 0; 8659 bd->changes.shaded = 0;
8852 rem_change = 1; 8660 rem_change = 1;
@@ -8854,30 +8662,24 @@ _e_border_eval(E_Border *bd)
8854 8662
8855 if (bd->changes.size) 8663 if (bd->changes.size)
8856 { 8664 {
8857 int x = 0, y = 0, xx = 0, yy = 0; 8665 int x, y, w = 0, h = 0;
8858 8666
8859 if ((bd->shaded) && (!bd->shading)) 8667 x = bd->x + bd->client_inset.l;
8860 { 8668 y = bd->y + bd->client_inset.t;
8861 evas_obscured_clear(bd->bg_evas); 8669 if ((!bd->shaded) || (bd->shading))
8862 }
8863 else
8864 { 8670 {
8865 xx = bd->w - (bd->client_inset.l + bd->client_inset.r); 8671 w = bd->w - (bd->client_inset.l + bd->client_inset.r);
8866 yy = bd->h - (bd->client_inset.t + bd->client_inset.b); 8672 h = bd->h - (bd->client_inset.t + bd->client_inset.b);
8867
8868 evas_obscured_clear(bd->bg_evas);
8869 evas_obscured_rectangle_add(bd->bg_evas,
8870 bd->client_inset.l, bd->client_inset.t, xx, yy);
8871 8673
8872 if (bd->shading) 8674 if (bd->shading)
8873 { 8675 {
8874 if (bd->shade.dir == E_DIRECTION_UP) 8676 if (bd->shade.dir == E_DIRECTION_UP)
8875 { 8677 {
8876 y = yy - bd->client.h; 8678 y = h - bd->client.h;
8877 } 8679 }
8878 else if (bd->shade.dir == E_DIRECTION_LEFT) 8680 else if (bd->shade.dir == E_DIRECTION_LEFT)
8879 { 8681 {
8880 x = xx - bd->client.w; 8682 x = w - bd->client.w;
8881 } 8683 }
8882 } 8684 }
8883 } 8685 }
@@ -8909,36 +8711,26 @@ _e_border_eval(E_Border *bd)
8909 E_Border *tmp; 8711 E_Border *tmp;
8910 Eina_List *l; 8712 Eina_List *l;
8911 8713
8912 ecore_x_window_move_resize(bd->win,
8913 bd->x + bd->fx.x,
8914 bd->y + bd->fx.y,
8915 bd->w, bd->h);
8916
8917 EINA_LIST_FOREACH(bd->client.e.state.video_child, l, tmp) 8714 EINA_LIST_FOREACH(bd->client.e.state.video_child, l, tmp)
8918 ecore_x_window_move(tmp->win, 8715 ecore_x_window_move(tmp->win,
8919 bd->x + bd->fx.x + bd->client_inset.l + tmp->client.e.state.video_position.x, 8716 bd->x + bd->fx.x + bd->client_inset.l + tmp->client.e.state.video_position.x,
8920 bd->y + bd->fx.y + bd->client_inset.t + tmp->client.e.state.video_position.y); 8717 bd->y + bd->fx.y + bd->client_inset.t + tmp->client.e.state.video_position.y);
8921 } 8718 }
8922 8719
8923 ecore_x_window_move_resize(bd->event_win, 0, 0, bd->w, bd->h);
8924
8925 if ((!bd->shaded) || (bd->shading)) 8720 if ((!bd->shaded) || (bd->shading))
8926 ecore_x_window_move_resize(bd->client.shell_win, 8721 ecore_x_window_move_resize(bd->win, x, y, w, h);
8927 bd->client_inset.l, bd->client_inset.t, xx, yy);
8928 8722
8929 if (bd->internal_ecore_evas) 8723 if (bd->internal_ecore_evas)
8930 ecore_evas_move_resize(bd->internal_ecore_evas, x, y, bd->client.w, bd->client.h); 8724 ecore_evas_move_resize(bd->internal_ecore_evas, 0, 0, w, h);
8931 else if (!bd->client.e.state.video) 8725 else if (!bd->client.e.state.video)
8932 { 8726 {
8933 ecore_x_window_move_resize(bd->client.win, x, y, bd->client.w, bd->client.h); 8727 ecore_x_window_move_resize(bd->client.win, 0, 0, bd->client.w, bd->client.h);
8934 ecore_x_window_move_resize(bd->client.lock_win, x, y, bd->client.w, bd->client.h); 8728 ecore_x_window_move_resize(bd->client.lock_win, 0, 0, bd->client.w, bd->client.h);
8935 } 8729 }
8936 8730
8937 ecore_evas_move_resize(bd->bg_ecore_evas, 0, 0, bd->w, bd->h); 8731 e_container_shape_resize(bd->shape, w, h);
8938 evas_object_resize(bd->bg_object, bd->w, bd->h);
8939 e_container_shape_resize(bd->shape, bd->w, bd->h);
8940 if (bd->changes.pos) 8732 if (bd->changes.pos)
8941 e_container_shape_move(bd->shape, bd->x + bd->fx.x, bd->y + bd->fx.y); 8733 e_container_shape_move(bd->shape, x, y);
8942 8734
8943 _e_border_client_move_resize_send(bd); 8735 _e_border_client_move_resize_send(bd);
8944 8736
@@ -8952,7 +8744,7 @@ _e_border_eval(E_Border *bd)
8952 bd->post_job = ecore_idle_enterer_add(_e_border_post_move_resize_job, bd); 8744 bd->post_job = ecore_idle_enterer_add(_e_border_post_move_resize_job, bd);
8953 bd->post_move = 1; 8745 bd->post_move = 1;
8954 8746
8955 e_container_shape_move(bd->shape, bd->x + bd->fx.x, bd->y + bd->fx.y); 8747 e_container_shape_move(bd->shape, bd->x + bd->fx.x + bd->client_inset.l, bd->y + bd->fx.y + bd->client_inset.t);
8956 8748
8957 _e_border_client_move_resize_send(bd); 8749 _e_border_client_move_resize_send(bd);
8958 8750
@@ -8970,37 +8762,33 @@ _e_border_eval(E_Border *bd)
8970 if (bd->need_shape_merge) 8762 if (bd->need_shape_merge)
8971 { 8763 {
8972 _e_border_shape_input_rectangle_set(bd); 8764 _e_border_shape_input_rectangle_set(bd);
8973 if ((bd->shaped) || (bd->client.shaped)) 8765 if (bd->client.shaped)
8974 { 8766 {
8975 Ecore_X_Window twin, twin2; 8767 Ecore_X_Window twin, twin2;
8976 int x, y; 8768 int x, y;
8769 Ecore_X_Rectangle rects[4];
8977 8770
8978 twin = ecore_x_window_override_new 8771 twin = ecore_x_window_override_new
8979 (bd->zone->container->scratch_win, 0, 0, bd->w, bd->h); 8772 (bd->zone->container->scratch_win, 0, 0, bd->w, bd->h);
8980 if (bd->shaped) 8773
8981 ecore_x_window_shape_window_set(twin, bd->bg_win); 8774
8982 else 8775 rects[0].x = 0;
8983 { 8776 rects[0].y = 0;
8984 Ecore_X_Rectangle rects[4]; 8777 rects[0].width = bd->w;
8985 8778 rects[0].height = bd->client_inset.t;
8986 rects[0].x = 0; 8779 rects[1].x = 0;
8987 rects[0].y = 0; 8780 rects[1].y = bd->client_inset.t;
8988 rects[0].width = bd->w; 8781 rects[1].width = bd->client_inset.l;
8989 rects[0].height = bd->client_inset.t; 8782 rects[1].height = bd->h - bd->client_inset.t - bd->client_inset.b;
8990 rects[1].x = 0; 8783 rects[2].x = bd->w - bd->client_inset.r;
8991 rects[1].y = bd->client_inset.t; 8784 rects[2].y = bd->client_inset.t;
8992 rects[1].width = bd->client_inset.l; 8785 rects[2].width = bd->client_inset.r;
8993 rects[1].height = bd->h - bd->client_inset.t - bd->client_inset.b; 8786 rects[2].height = bd->h - bd->client_inset.t - bd->client_inset.b;
8994 rects[2].x = bd->w - bd->client_inset.r; 8787 rects[3].x = 0;
8995 rects[2].y = bd->client_inset.t; 8788 rects[3].y = bd->h - bd->client_inset.b;
8996 rects[2].width = bd->client_inset.r; 8789 rects[3].width = bd->w;
8997 rects[2].height = bd->h - bd->client_inset.t - bd->client_inset.b; 8790 rects[3].height = bd->client_inset.b;
8998 rects[3].x = 0; 8791 ecore_x_window_shape_rectangles_set(twin, rects, 4);
8999 rects[3].y = bd->h - bd->client_inset.b;
9000 rects[3].width = bd->w;
9001 rects[3].height = bd->client_inset.b;
9002 ecore_x_window_shape_rectangles_set(twin, rects, 4);
9003 }
9004 twin2 = ecore_x_window_override_new 8792 twin2 = ecore_x_window_override_new
9005 (bd->zone->container->scratch_win, 0, 0, 8793 (bd->zone->container->scratch_win, 0, 0,
9006 bd->w - bd->client_inset.l - bd->client_inset.r, 8794 bd->w - bd->client_inset.l - bd->client_inset.r,
@@ -9123,7 +8911,7 @@ _e_border_eval(E_Border *bd)
9123 { 8911 {
9124 bd->x = x - (bd->w >> 1); 8912 bd->x = x - (bd->w >> 1);
9125 bd->y = y - (bd->client_inset.t >> 1); 8913 bd->y = y - (bd->client_inset.t >> 1);
9126 bd->changed = 1; 8914 BD_CHANGED(bd);
9127 bd->changes.pos = 1; 8915 bd->changes.pos = 1;
9128 8916
9129 _e_border_client_move_resize_send(bd); 8917 _e_border_client_move_resize_send(bd);
@@ -9220,7 +9008,7 @@ _e_border_eval(E_Border *bd)
9220 bd->desktop->orig_path); 9008 bd->desktop->orig_path);
9221 } 9009 }
9222 9010
9223 bd->icon_object = e_border_icon_add(bd, bd->bg_evas); 9011 bd->icon_object = e_border_icon_add(bd, e_comp_get(bd)->evas);
9224 if ((bd->focused) && (bd->icon_object)) 9012 if ((bd->focused) && (bd->icon_object))
9225 edje_object_signal_emit(bd->icon_object, "e,state,focused", "e"); 9013 edje_object_signal_emit(bd->icon_object, "e,state,focused", "e");
9226 if (bd->bg_object) 9014 if (bd->bg_object)
@@ -9349,9 +9137,9 @@ _e_border_resize_handle(E_Border *bd)
9349 w = bd->w; 9137 w = bd->w;
9350 h = bd->h; 9138 h = bd->h;
9351 9139
9352 if ((bd->resize_mode == RESIZE_TR) || 9140 if ((bd->resize_mode == E_POINTER_RESIZE_TR) ||
9353 (bd->resize_mode == RESIZE_R) || 9141 (bd->resize_mode == E_POINTER_RESIZE_R) ||
9354 (bd->resize_mode == RESIZE_BR)) 9142 (bd->resize_mode == E_POINTER_RESIZE_BR))
9355 { 9143 {
9356 if ((bd->moveinfo.down.button >= 1) && 9144 if ((bd->moveinfo.down.button >= 1) &&
9357 (bd->moveinfo.down.button <= 3)) 9145 (bd->moveinfo.down.button <= 3))
@@ -9360,9 +9148,9 @@ _e_border_resize_handle(E_Border *bd)
9360 else 9148 else
9361 w = bd->moveinfo.down.w + (bd->mouse.current.mx - bd->moveinfo.down.mx); 9149 w = bd->moveinfo.down.w + (bd->mouse.current.mx - bd->moveinfo.down.mx);
9362 } 9150 }
9363 else if ((bd->resize_mode == RESIZE_TL) || 9151 else if ((bd->resize_mode == E_POINTER_RESIZE_TL) ||
9364 (bd->resize_mode == RESIZE_L) || 9152 (bd->resize_mode == E_POINTER_RESIZE_L) ||
9365 (bd->resize_mode == RESIZE_BL)) 9153 (bd->resize_mode == E_POINTER_RESIZE_BL))
9366 { 9154 {
9367 if ((bd->moveinfo.down.button >= 1) && 9155 if ((bd->moveinfo.down.button >= 1) &&
9368 (bd->moveinfo.down.button <= 3)) 9156 (bd->moveinfo.down.button <= 3))
@@ -9372,9 +9160,9 @@ _e_border_resize_handle(E_Border *bd)
9372 w = bd->moveinfo.down.w - (bd->mouse.current.mx - bd->moveinfo.down.mx); 9160 w = bd->moveinfo.down.w - (bd->mouse.current.mx - bd->moveinfo.down.mx);
9373 } 9161 }
9374 9162
9375 if ((bd->resize_mode == RESIZE_TL) || 9163 if ((bd->resize_mode == E_POINTER_RESIZE_TL) ||
9376 (bd->resize_mode == RESIZE_T) || 9164 (bd->resize_mode == E_POINTER_RESIZE_T) ||
9377 (bd->resize_mode == RESIZE_TR)) 9165 (bd->resize_mode == E_POINTER_RESIZE_TR))
9378 { 9166 {
9379 if ((bd->moveinfo.down.button >= 1) && 9167 if ((bd->moveinfo.down.button >= 1) &&
9380 (bd->moveinfo.down.button <= 3)) 9168 (bd->moveinfo.down.button <= 3))
@@ -9383,9 +9171,9 @@ _e_border_resize_handle(E_Border *bd)
9383 else 9171 else
9384 h = bd->moveinfo.down.h - (bd->mouse.current.my - bd->moveinfo.down.my); 9172 h = bd->moveinfo.down.h - (bd->mouse.current.my - bd->moveinfo.down.my);
9385 } 9173 }
9386 else if ((bd->resize_mode == RESIZE_BL) || 9174 else if ((bd->resize_mode == E_POINTER_RESIZE_BL) ||
9387 (bd->resize_mode == RESIZE_B) || 9175 (bd->resize_mode == E_POINTER_RESIZE_B) ||
9388 (bd->resize_mode == RESIZE_BR)) 9176 (bd->resize_mode == E_POINTER_RESIZE_BR))
9389 { 9177 {
9390 if ((bd->moveinfo.down.button >= 1) && 9178 if ((bd->moveinfo.down.button >= 1) &&
9391 (bd->moveinfo.down.button <= 3)) 9179 (bd->moveinfo.down.button <= 3))
@@ -9398,13 +9186,13 @@ _e_border_resize_handle(E_Border *bd)
9398 tw = bd->w; 9186 tw = bd->w;
9399 th = bd->h; 9187 th = bd->h;
9400 9188
9401 if ((bd->resize_mode == RESIZE_TL) || 9189 if ((bd->resize_mode == E_POINTER_RESIZE_TL) ||
9402 (bd->resize_mode == RESIZE_L) || 9190 (bd->resize_mode == E_POINTER_RESIZE_L) ||
9403 (bd->resize_mode == RESIZE_BL)) 9191 (bd->resize_mode == E_POINTER_RESIZE_BL))
9404 x += (tw - w); 9192 x += (tw - w);
9405 if ((bd->resize_mode == RESIZE_TL) || 9193 if ((bd->resize_mode == E_POINTER_RESIZE_TL) ||
9406 (bd->resize_mode == RESIZE_T) || 9194 (bd->resize_mode == E_POINTER_RESIZE_T) ||
9407 (bd->resize_mode == RESIZE_TR)) 9195 (bd->resize_mode == E_POINTER_RESIZE_TR))
9408 y += (th - h); 9196 y += (th - h);
9409 9197
9410 skiplist = eina_list_append(skiplist, bd); 9198 skiplist = eina_list_append(skiplist, bd);
@@ -9417,13 +9205,13 @@ _e_border_resize_handle(E_Border *bd)
9417 w = new_w; 9205 w = new_w;
9418 h = new_h; 9206 h = new_h;
9419 e_border_resize_limit(bd, &new_w, &new_h); 9207 e_border_resize_limit(bd, &new_w, &new_h);
9420 if ((bd->resize_mode == RESIZE_TL) || 9208 if ((bd->resize_mode == E_POINTER_RESIZE_TL) ||
9421 (bd->resize_mode == RESIZE_L) || 9209 (bd->resize_mode == E_POINTER_RESIZE_L) ||
9422 (bd->resize_mode == RESIZE_BL)) 9210 (bd->resize_mode == E_POINTER_RESIZE_BL))
9423 new_x += (w - new_w); 9211 new_x += (w - new_w);
9424 if ((bd->resize_mode == RESIZE_TL) || 9212 if ((bd->resize_mode == E_POINTER_RESIZE_TL) ||
9425 (bd->resize_mode == RESIZE_T) || 9213 (bd->resize_mode == E_POINTER_RESIZE_T) ||
9426 (bd->resize_mode == RESIZE_TR)) 9214 (bd->resize_mode == E_POINTER_RESIZE_TR))
9427 new_y += (h - new_h); 9215 new_y += (h - new_h);
9428 9216
9429 e_border_move_resize(bd, new_x, new_y, new_w, new_h); 9217 e_border_move_resize(bd, new_x, new_y, new_w, new_h);
@@ -9526,7 +9314,7 @@ _e_border_shade_animator(void *data)
9526 bd->changes.pos = 1; 9314 bd->changes.pos = 1;
9527 } 9315 }
9528 9316
9529 if ((bd->shaped) || (bd->client.shaped)) 9317 if (bd->client.shaped)
9530 { 9318 {
9531 bd->need_shape_merge = 1; 9319 bd->need_shape_merge = 1;
9532 bd->need_shape_export = 1; 9320 bd->need_shape_export = 1;
@@ -9536,7 +9324,7 @@ _e_border_shade_animator(void *data)
9536 bd->need_shape_merge = 1; 9324 bd->need_shape_merge = 1;
9537 } 9325 }
9538 bd->changes.size = 1; 9326 bd->changes.size = 1;
9539 bd->changed = 1; 9327 BD_CHANGED(bd);
9540 9328
9541 /* we're done */ 9329 /* we're done */
9542 if (val == 1) 9330 if (val == 1)
@@ -9548,7 +9336,7 @@ _e_border_shade_animator(void *data)
9548 bd->changes.size = 1; 9336 bd->changes.size = 1;
9549 bd->changes.shaded = 1; 9337 bd->changes.shaded = 1;
9550 bd->changes.shading = 1; 9338 bd->changes.shading = 1;
9551 bd->changed = 1; 9339 BD_CHANGED(bd);
9552 bd->shade.anim = NULL; 9340 bd->shade.anim = NULL;
9553 9341
9554 if (bd->shaded) 9342 if (bd->shaded)
@@ -9886,7 +9674,7 @@ _e_border_resize_end(E_Border *bd)
9886 /* resize to last geometry if sync alarm for it was not yet handled */ 9674 /* resize to last geometry if sync alarm for it was not yet handled */
9887 if (bd->pending_move_resize) 9675 if (bd->pending_move_resize)
9888 { 9676 {
9889 bd->changed = 1; 9677 BD_CHANGED(bd);
9890 bd->changes.pos = 1; 9678 bd->changes.pos = 1;
9891 bd->changes.size = 1; 9679 bd->changes.size = 1;
9892 _e_border_client_move_resize_send(bd); 9680 _e_border_client_move_resize_send(bd);
@@ -10033,96 +9821,6 @@ _e_border_cb_kill_timer(void *data)
10033 return ECORE_CALLBACK_CANCEL; 9821 return ECORE_CALLBACK_CANCEL;
10034} 9822}
10035 9823
10036static void
10037_e_border_pointer_resize_begin(E_Border *bd)
10038{
10039 switch (bd->resize_mode)
10040 {
10041 case RESIZE_TL:
10042 e_pointer_type_push(bd->pointer, bd, "resize_tl");
10043 break;
10044
10045 case RESIZE_T:
10046 e_pointer_type_push(bd->pointer, bd, "resize_t");
10047 break;
10048
10049 case RESIZE_TR:
10050 e_pointer_type_push(bd->pointer, bd, "resize_tr");
10051 break;
10052
10053 case RESIZE_R:
10054 e_pointer_type_push(bd->pointer, bd, "resize_r");
10055 break;
10056
10057 case RESIZE_BR:
10058 e_pointer_type_push(bd->pointer, bd, "resize_br");
10059 break;
10060
10061 case RESIZE_B:
10062 e_pointer_type_push(bd->pointer, bd, "resize_b");
10063 break;
10064
10065 case RESIZE_BL:
10066 e_pointer_type_push(bd->pointer, bd, "resize_bl");
10067 break;
10068
10069 case RESIZE_L:
10070 e_pointer_type_push(bd->pointer, bd, "resize_l");
10071 break;
10072 }
10073}
10074
10075static void
10076_e_border_pointer_resize_end(E_Border *bd)
10077{
10078 switch (bd->resize_mode)
10079 {
10080 case RESIZE_TL:
10081 e_pointer_type_pop(bd->pointer, bd, "resize_tl");
10082 break;
10083
10084 case RESIZE_T:
10085 e_pointer_type_pop(bd->pointer, bd, "resize_t");
10086 break;
10087
10088 case RESIZE_TR:
10089 e_pointer_type_pop(bd->pointer, bd, "resize_tr");
10090 break;
10091
10092 case RESIZE_R:
10093 e_pointer_type_pop(bd->pointer, bd, "resize_r");
10094 break;
10095
10096 case RESIZE_BR:
10097 e_pointer_type_pop(bd->pointer, bd, "resize_br");
10098 break;
10099
10100 case RESIZE_B:
10101 e_pointer_type_pop(bd->pointer, bd, "resize_b");
10102 break;
10103
10104 case RESIZE_BL:
10105 e_pointer_type_pop(bd->pointer, bd, "resize_bl");
10106 break;
10107
10108 case RESIZE_L:
10109 e_pointer_type_pop(bd->pointer, bd, "resize_l");
10110 break;
10111 }
10112}
10113
10114static void
10115_e_border_pointer_move_begin(E_Border *bd)
10116{
10117 e_pointer_type_push(bd->pointer, bd, "move");
10118}
10119
10120static void
10121_e_border_pointer_move_end(E_Border *bd)
10122{
10123 e_pointer_type_pop(bd->pointer, bd, "move");
10124}
10125
10126static Eina_List *_e_border_hooks = NULL; 9824static Eina_List *_e_border_hooks = NULL;
10127static int _e_border_hooks_delete = 0; 9825static int _e_border_hooks_delete = 0;
10128static int _e_border_hooks_walking = 0; 9826static int _e_border_hooks_walking = 0;
diff --git a/src/bin/e_border.h b/src/bin/e_border.h
index 19a4358..fd4dac4 100644
--- a/src/bin/e_border.h
+++ b/src/bin/e_border.h
@@ -125,7 +125,7 @@ typedef struct _E_Event_Border_Simple E_Event_Border_Move;
125typedef struct _E_Event_Border_Simple E_Event_Border_Add; 125typedef struct _E_Event_Border_Simple E_Event_Border_Add;
126typedef struct _E_Event_Border_Simple E_Event_Border_Remove; 126typedef struct _E_Event_Border_Simple E_Event_Border_Remove;
127typedef struct _E_Event_Border_Simple E_Event_Border_Show; 127typedef struct _E_Event_Border_Simple E_Event_Border_Show;
128typedef struct _E_Event_Border_Simple E_Event_Border_Hide; 128typedef struct _E_Event_Border_Hide E_Event_Border_Hide;
129typedef struct _E_Event_Border_Simple E_Event_Border_Iconify; 129typedef struct _E_Event_Border_Simple E_Event_Border_Iconify;
130typedef struct _E_Event_Border_Simple E_Event_Border_Uniconify; 130typedef struct _E_Event_Border_Simple E_Event_Border_Uniconify;
131typedef struct _E_Event_Border_Simple E_Event_Border_Stick; 131typedef struct _E_Event_Border_Simple E_Event_Border_Stick;
@@ -170,12 +170,10 @@ struct _E_Border
170 } down; 170 } down;
171 } moveinfo; 171 } moveinfo;
172 172
173 Ecore_X_Window win;
174 int x, y, w, h; 173 int x, y, w, h;
175 int ref; 174 int ref;
176 E_Zone *zone; 175 E_Zone *zone;
177 E_Desk *desk; 176 E_Desk *desk;
178 Eina_List *handlers;
179 177
180 struct 178 struct
181 { 179 {
@@ -190,26 +188,22 @@ struct _E_Border
190 struct 188 struct
191 { 189 {
192 int l, r, t, b; 190 int l, r, t, b;
191 Eina_Bool calc : 1; // inset has been calculated
193 } client_inset; 192 } client_inset;
194 193
195 E_Comp_Win *cw; 194 E_Comp_Win *cw;
196 Ecore_Evas *bg_ecore_evas; 195 Ecore_X_Window win;
197 Evas *bg_evas;
198 Ecore_X_Window bg_win;
199 Evas_Object *bg_object; 196 Evas_Object *bg_object;
200 Evas_Object *icon_object; 197 Evas_Object *icon_object;
201 Ecore_X_Window event_win;
202 Eina_Stringshare *internal_icon; 198 Eina_Stringshare *internal_icon;
203 Eina_Stringshare *internal_icon_key; 199 Eina_Stringshare *internal_icon_key;
204 Eina_Bool bg_evas_in : 1;
205 200
206 struct 201 struct
207 { 202 {
208 Ecore_X_Window shell_win;
209 Ecore_X_Window lock_win; 203 Ecore_X_Window lock_win;
210 Ecore_X_Window win; 204 Ecore_X_Window win;
211 205
212 int x, y, w, h; 206 int w, h;
213 207
214 struct 208 struct
215 { 209 {
@@ -516,7 +510,6 @@ struct _E_Border
516 unsigned int iconic : 1; 510 unsigned int iconic : 1;
517 unsigned int deskshow : 1; 511 unsigned int deskshow : 1;
518 unsigned int sticky : 1; 512 unsigned int sticky : 1;
519 unsigned int shaped : 1;
520 unsigned int shaped_input : 1; 513 unsigned int shaped_input : 1;
521 unsigned int need_shape_merge : 1; 514 unsigned int need_shape_merge : 1;
522 unsigned int need_shape_export : 1; 515 unsigned int need_shape_export : 1;
@@ -566,6 +559,7 @@ struct _E_Border
566 unsigned int internal_no_remember : 1; 559 unsigned int internal_no_remember : 1;
567 unsigned int internal_no_reopen : 1; 560 unsigned int internal_no_reopen : 1;
568 unsigned int stolen : 1; 561 unsigned int stolen : 1;
562 Eina_Bool theme_shadow : 1;
569 563
570 Ecore_Evas *internal_ecore_evas; 564 Ecore_Evas *internal_ecore_evas;
571 565
@@ -659,7 +653,6 @@ struct _E_Border
659 Eina_List *transients; 653 Eina_List *transients;
660 654
661 Efreet_Desktop *desktop; 655 Efreet_Desktop *desktop;
662 E_Pointer *pointer;
663 656
664 unsigned char comp_hidden : 1; 657 unsigned char comp_hidden : 1;
665 658
@@ -692,6 +685,12 @@ struct _E_Border_Hook
692 unsigned char delete_me : 1; 685 unsigned char delete_me : 1;
693}; 686};
694 687
688struct _E_Event_Border_Hide
689{
690 E_Border *border;
691 int manage;
692};
693
695struct _E_Event_Border_Simple 694struct _E_Event_Border_Simple
696{ 695{
697 E_Border *border; 696 E_Border *border;
@@ -762,7 +761,6 @@ EAPI void e_border_pinned_set(E_Border *bd, int set);
762 761
763EAPI E_Border *e_border_find_by_client_window(Ecore_X_Window win); 762EAPI E_Border *e_border_find_by_client_window(Ecore_X_Window win);
764EAPI E_Border *e_border_find_all_by_client_window(Ecore_X_Window win); 763EAPI E_Border *e_border_find_all_by_client_window(Ecore_X_Window win);
765EAPI E_Border *e_border_find_by_frame_window(Ecore_X_Window win);
766EAPI E_Border *e_border_find_by_window(Ecore_X_Window win); 764EAPI E_Border *e_border_find_by_window(Ecore_X_Window win);
767EAPI E_Border *e_border_find_by_alarm(Ecore_X_Sync_Alarm alarm); 765EAPI E_Border *e_border_find_by_alarm(Ecore_X_Sync_Alarm alarm);
768EAPI E_Border *e_border_focused_get(void); 766EAPI E_Border *e_border_focused_get(void);
@@ -844,5 +842,12 @@ extern EAPI int E_EVENT_BORDER_PROPERTY;
844extern EAPI int E_EVENT_BORDER_FULLSCREEN; 842extern EAPI int E_EVENT_BORDER_FULLSCREEN;
845extern EAPI int E_EVENT_BORDER_UNFULLSCREEN; 843extern EAPI int E_EVENT_BORDER_UNFULLSCREEN;
846 844
845/* macro for finding misuse of changed flag */
846#if 0
847# define BD_CHANGED(BD) BD->changed = 1; INF("%s:%d - BD CHANGED: %p", __FILE__, __LINE__, BD)
848#else
849# define BD_CHANGED(BD) BD->changed = 1
850#endif
851
847#endif 852#endif
848#endif 853#endif
diff --git a/src/bin/e_comp.c b/src/bin/e_comp.c
index e2b9ce0..ca72ab7 100644
--- a/src/bin/e_comp.c
+++ b/src/bin/e_comp.c
@@ -81,6 +81,7 @@ static int _e_comp_log_dom = -1;
81#define CRI(f, x ...) 81#define CRI(f, x ...)
82#endif 82#endif
83 83
84static Eina_Bool _e_comp_win_do_shadow(E_Comp_Win *cw);
84static void _e_comp_win_ready_timeout_setup(E_Comp_Win *cw); 85static void _e_comp_win_ready_timeout_setup(E_Comp_Win *cw);
85static void _e_comp_render_queue(E_Comp *c); 86static void _e_comp_render_queue(E_Comp *c);
86static void _e_comp_win_damage(E_Comp_Win *cw, int x, int y, int w, int h, Eina_Bool dmg); 87static void _e_comp_win_damage(E_Comp_Win *cw, int x, int y, int w, int h, Eina_Bool dmg);
@@ -201,9 +202,10 @@ _e_comp_fullscreen_check(E_Comp *c)
201 { 202 {
202 if ((!cw->visible) || (cw->input_only) || (cw->invalid) || (cw->real_obj)) 203 if ((!cw->visible) || (cw->input_only) || (cw->invalid) || (cw->real_obj))
203 continue; 204 continue;
205 if (!cw->bd) continue;
204 if ((cw->x == 0) && (cw->y == 0) && 206 if ((cw->x == 0) && (cw->y == 0) &&
205 ((cw->x + cw->w) >= c->man->w) && 207 ((cw->bd->client.w) >= c->man->w) &&
206 ((cw->y + cw->h) >= c->man->h) && 208 ((cw->bd->client.h) >= c->man->h) &&
207 (!cw->argb) && (!cw->shaped) && (!cw->bg_win) 209 (!cw->argb) && (!cw->shaped) && (!cw->bg_win)
208 ) 210 )
209 { 211 {
@@ -455,10 +457,11 @@ _e_comp_win_restack(E_Comp_Win *cw)
455 } 457 }
456 EINA_LIST_FOREACH(cw->stack_below, l, cwp) 458 EINA_LIST_FOREACH(cw->stack_below, l, cwp)
457 { 459 {
458 e_layout_child_lower_below(cwp->shobj, cw->shobj); 460 e_layout_child_lower_below(cwp->effect_obj, cw->effect_obj);
459 cw->c->wins = eina_inlist_remove(cw->c->wins, EINA_INLIST_GET(cwp)); 461 cw->c->wins = eina_inlist_remove(cw->c->wins, EINA_INLIST_GET(cwp));
460 cw->c->wins = eina_inlist_prepend_relative(cw->c->wins, EINA_INLIST_GET(cwp), EINA_INLIST_GET(cw)); 462 cw->c->wins = eina_inlist_prepend_relative(cw->c->wins, EINA_INLIST_GET(cwp), EINA_INLIST_GET(cw));
461 } 463 }
464 _e_comp_shapes_update(cw->c, NULL, E_CONTAINER_SHAPE_MOVE);
462} 465}
463 466
464static void 467static void
@@ -466,12 +469,16 @@ _e_comp_win_geometry_update(E_Comp_Win *cw)
466{ 469{
467 int x, y, w, h; 470 int x, y, w, h;
468 471
469 if (cw->visible) 472 if (cw->bd)
473 x = cw->bd->x, y = cw->bd->y;
474 else if (cw->visible)
470 x = cw->x, y = cw->y; 475 x = cw->x, y = cw->y;
471 else 476 else
472 x = cw->hidden.x, y = cw->hidden.y; 477 x = cw->hidden.x, y = cw->hidden.y;
473 if (cw->real_obj) 478 if (cw->real_obj)
474 w = cw->w, h = cw->h; 479 w = cw->w, h = cw->h;
480 else if (cw->bd)
481 w = cw->bd->w, h = cw->bd->h;
475 else 482 else
476 w = cw->pw, h = cw->ph; 483 w = cw->pw, h = cw->ph;
477 if (cw->not_in_layout) 484 if (cw->not_in_layout)
@@ -865,10 +872,10 @@ _e_comp_win_update(E_Comp_Win *cw)
865 { 872 {
866 if (pshaped != cw->shaped) 873 if (pshaped != cw->shaped)
867 { 874 {
868 if (cw->shaped) 875 if (_e_comp_win_do_shadow(cw))
869 edje_object_signal_emit(cw->shobj, "e,state,shadow,off", "e");
870 else
871 edje_object_signal_emit(cw->shobj, "e,state,shadow,on", "e"); 876 edje_object_signal_emit(cw->shobj, "e,state,shadow,on", "e");
877 else
878 edje_object_signal_emit(cw->shobj, "e,state,shadow,off", "e");
872 } 879 }
873 } 880 }
874 881
@@ -1006,6 +1013,7 @@ _e_comp_win_adopt(E_Comp_Win *cw)
1006 cw->c->updates = eina_list_append(cw->c->updates, cw); 1013 cw->c->updates = eina_list_append(cw->c->updates, cw);
1007 } 1014 }
1008 cw->redirected = 1; 1015 cw->redirected = 1;