summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2013-01-10 11:53:39 +0000
committerCarsten Haitzler <raster@rasterman.com>2013-01-10 11:53:39 +0000
commit191b71fa86bd56b9d213b538ce8d92d9c23fc59f (patch)
tree803861294481b51a19d7bf5ed44d4e2e68b4ea89
parent3d214f40995acee29ae61bbbf16590a1e288bb04 (diff)
and dont set states until state change cb tells u they changed in
elm_win. more testing needed. SVN revision: 82559
-rw-r--r--src/lib/elm_win.c42
1 files changed, 34 insertions, 8 deletions
diff --git a/src/lib/elm_win.c b/src/lib/elm_win.c
index 436357001..7bfb83f3d 100644
--- a/src/lib/elm_win.c
+++ b/src/lib/elm_win.c
@@ -265,17 +265,20 @@ _elm_win_state_eval(void *data __UNUSED__)
265 { 265 {
266 ecore_throttle_adjust(-_elm_config->auto_throttle_amount); 266 ecore_throttle_adjust(-_elm_config->auto_throttle_amount);
267 _elm_win_auto_throttled = EINA_FALSE; 267 _elm_win_auto_throttled = EINA_FALSE;
268 printf("throttle off\n");
268 } 269 }
269 } 270 }
270 else 271 else
271 { 272 {
272 if ((_elm_win_count_iconified + _elm_win_count_withdrawn) >= 273 printf("%i %i %i\n", _elm_win_count_iconified, _elm_win_count_withdrawn, _elm_win_count_shown);
273 _elm_win_count_shown) 274 if ((_elm_win_count_iconified + _elm_win_count_withdrawn)
275 >= _elm_win_count_shown)
274 { 276 {
275 if (!_elm_win_auto_throttled) 277 if (!_elm_win_auto_throttled)
276 { 278 {
277 ecore_throttle_adjust(_elm_config->auto_throttle_amount); 279 ecore_throttle_adjust(_elm_config->auto_throttle_amount);
278 _elm_win_auto_throttled = EINA_TRUE; 280 _elm_win_auto_throttled = EINA_TRUE;
281 printf("throttle on\n");
279 } 282 }
280 } 283 }
281 else 284 else
@@ -284,6 +287,7 @@ _elm_win_state_eval(void *data __UNUSED__)
284 { 287 {
285 ecore_throttle_adjust(-_elm_config->auto_throttle_amount); 288 ecore_throttle_adjust(-_elm_config->auto_throttle_amount);
286 _elm_win_auto_throttled = EINA_FALSE; 289 _elm_win_auto_throttled = EINA_FALSE;
290 printf("throttle off\n");
287 } 291 }
288 } 292 }
289 } 293 }
@@ -972,11 +976,13 @@ _elm_win_state_change(Ecore_Evas *ee)
972 ch_maximized = EINA_TRUE; 976 ch_maximized = EINA_TRUE;
973 } 977 }
974 978
979
975 profile = ecore_evas_window_profile_get(sd->ee); 980 profile = ecore_evas_window_profile_get(sd->ee);
976 ch_profile = _elm_win_profile_set(sd, profile); 981 ch_profile = _elm_win_profile_set(sd, profile);
977 982
978 if (sd->withdrawn) _elm_win_count_withdrawn++; 983 if (sd->withdrawn) _elm_win_count_withdrawn++;
979 if (sd->iconified) _elm_win_count_iconified++; 984 if (sd->iconified) _elm_win_count_iconified++;
985 printf("win with: %i = %i\n", sd->withdrawn, _elm_win_count_withdrawn);
980 _elm_win_state_eval_queue(); 986 _elm_win_state_eval_queue();
981 987
982 if ((ch_withdrawn) || (ch_iconified)) 988 if ((ch_withdrawn) || (ch_iconified))
@@ -2221,7 +2227,7 @@ _elm_win_frame_cb_minimize(void *data,
2221 Elm_Win_Smart_Data *sd; 2227 Elm_Win_Smart_Data *sd;
2222 2228
2223 if (!(sd = data)) return; 2229 if (!(sd = data)) return;
2224 sd->iconified = EINA_TRUE; 2230// sd->iconified = EINA_TRUE;
2225 TRAP(sd, iconified_set, EINA_TRUE); 2231 TRAP(sd, iconified_set, EINA_TRUE);
2226} 2232}
2227 2233
@@ -2486,6 +2492,24 @@ elm_win_add(Evas_Object *parent,
2486} 2492}
2487 2493
2488static void 2494static void
2495_elm_win_cb_hide(void *data __UNUSED__,
2496 Evas *e __UNUSED__,
2497 Evas_Object *obj __UNUSED__,
2498 void *event_info __UNUSED__)
2499{
2500 _elm_win_state_eval_queue();
2501}
2502
2503static void
2504_elm_win_cb_show(void *data __UNUSED__,
2505 Evas *e __UNUSED__,
2506 Evas_Object *obj __UNUSED__,
2507 void *event_info __UNUSED__)
2508{
2509 _elm_win_state_eval_queue();
2510}
2511
2512static void
2489_win_constructor(Eo *obj, void *_pd, va_list *list) 2513_win_constructor(Eo *obj, void *_pd, va_list *list)
2490{ 2514{
2491 Elm_Win_Smart_Data *sd = _pd; 2515 Elm_Win_Smart_Data *sd = _pd;
@@ -2854,6 +2878,8 @@ _win_constructor(Eo *obj, void *_pd, va_list *list)
2854 ecore_evas_callback_focus_out_set(sd->ee, _elm_win_focus_out); 2878 ecore_evas_callback_focus_out_set(sd->ee, _elm_win_focus_out);
2855 ecore_evas_callback_move_set(sd->ee, _elm_win_move); 2879 ecore_evas_callback_move_set(sd->ee, _elm_win_move);
2856 ecore_evas_callback_state_change_set(sd->ee, _elm_win_state_change); 2880 ecore_evas_callback_state_change_set(sd->ee, _elm_win_state_change);
2881 evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE, _elm_win_cb_hide, sd);
2882 evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _elm_win_cb_show, sd);
2857 2883
2858 evas_image_cache_set(sd->evas, (_elm_config->image_cache * 1024)); 2884 evas_image_cache_set(sd->evas, (_elm_config->image_cache * 1024));
2859 evas_font_cache_set(sd->evas, (_elm_config->font_cache * 1024)); 2885 evas_font_cache_set(sd->evas, (_elm_config->font_cache * 1024));
@@ -3486,7 +3512,7 @@ _fullscreen_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3486 } 3512 }
3487 else 3513 else
3488 { 3514 {
3489 sd->fullscreen = fullscreen; 3515// sd->fullscreen = fullscreen;
3490 3516
3491 if (fullscreen) 3517 if (fullscreen)
3492 { 3518 {
@@ -3588,7 +3614,7 @@ _maximized_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3588 Eina_Bool maximized = va_arg(*list, int); 3614 Eina_Bool maximized = va_arg(*list, int);
3589 Elm_Win_Smart_Data *sd = _pd; 3615 Elm_Win_Smart_Data *sd = _pd;
3590 3616
3591 sd->maximized = maximized; 3617// sd->maximized = maximized;
3592 // YYY: handle if sd->img_obj 3618 // YYY: handle if sd->img_obj
3593 TRAP(sd, maximized_set, maximized); 3619 TRAP(sd, maximized_set, maximized);
3594#ifdef HAVE_ELEMENTARY_X 3620#ifdef HAVE_ELEMENTARY_X
@@ -3627,7 +3653,7 @@ _iconified_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3627 Eina_Bool iconified = va_arg(*list, int); 3653 Eina_Bool iconified = va_arg(*list, int);
3628 Elm_Win_Smart_Data *sd = _pd; 3654 Elm_Win_Smart_Data *sd = _pd;
3629 3655
3630 sd->iconified = iconified; 3656// sd->iconified = iconified;
3631 TRAP(sd, iconified_set, iconified); 3657 TRAP(sd, iconified_set, iconified);
3632#ifdef HAVE_ELEMENTARY_X 3658#ifdef HAVE_ELEMENTARY_X
3633 _elm_win_xwin_update(sd); 3659 _elm_win_xwin_update(sd);
@@ -3665,7 +3691,7 @@ _withdrawn_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3665 Eina_Bool withdrawn = va_arg(*list, int); 3691 Eina_Bool withdrawn = va_arg(*list, int);
3666 Elm_Win_Smart_Data *sd = _pd; 3692 Elm_Win_Smart_Data *sd = _pd;
3667 3693
3668 sd->withdrawn = withdrawn; 3694// sd->withdrawn = withdrawn;
3669 TRAP(sd, withdrawn_set, withdrawn); 3695 TRAP(sd, withdrawn_set, withdrawn);
3670#ifdef HAVE_ELEMENTARY_X 3696#ifdef HAVE_ELEMENTARY_X
3671 _elm_win_xwin_update(sd); 3697 _elm_win_xwin_update(sd);
@@ -4249,7 +4275,7 @@ _sticky_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4249 Eina_Bool sticky = va_arg(*list, int); 4275 Eina_Bool sticky = va_arg(*list, int);
4250 Elm_Win_Smart_Data *sd = _pd; 4276 Elm_Win_Smart_Data *sd = _pd;
4251 4277
4252 sd->sticky = sticky; 4278// sd->sticky = sticky;
4253 TRAP(sd, sticky_set, sticky); 4279 TRAP(sd, sticky_set, sticky);
4254#ifdef HAVE_ELEMENTARY_X 4280#ifdef HAVE_ELEMENTARY_X
4255 _elm_win_xwin_update(sd); 4281 _elm_win_xwin_update(sd);