From 4513a247978d0823e83df650fd879a5144e38f43 Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Thu, 25 Feb 2010 12:26:10 +0000 Subject: [PATCH] no more round trips! bad bad bad! SVN revision: 46459 --- src/bin/e_border.c | 8 ++-- src/bin/e_dnd.c | 4 +- src/bin/e_focus.c | 15 +++++-- src/bin/e_hints.c | 43 ++++++++++---------- src/bin/e_hints.h | 8 +++- src/modules/comp/e_mod_comp.c | 18 ++++++++ src/modules/illume-home/e_mod_main.c | 3 +- src/modules/illume-indicator/e_mod_ind_win.c | 5 +-- src/modules/illume-softkey/e_mod_sft_win.c | 4 +- src/modules/illume2/policies/illume/policy.c | 2 +- 10 files changed, 70 insertions(+), 40 deletions(-) diff --git a/src/bin/e_border.c b/src/bin/e_border.c index 5de54ac20..28b4d5e46 100644 --- a/src/bin/e_border.c +++ b/src/bin/e_border.c @@ -451,9 +451,9 @@ e_border_new(E_Container *con, Ecore_X_Window win, int first_map, int internal) bd->client.e.fetch.state = 1; } /* loop to check for qtopia atoms */ - if (atoms[i] == _QTOPIA_SOFT_MENU) + if (atoms[i] == ATM__QTOPIA_SOFT_MENU) bd->client.qtopia.fetch.soft_menu = 1; - else if (atoms[i] == _QTOPIA_SOFT_MENUS) + else if (atoms[i] == ATM__QTOPIA_SOFT_MENUS) bd->client.qtopia.fetch.soft_menus = 1; /* loop to check for vkbd atoms */ else if (atoms[i] == ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_STATE) @@ -4483,12 +4483,12 @@ _e_border_cb_window_property(void *data, int ev_type, void *ev) bd->client.netwm.fetch.icon = 1; bd->changed = 1; } - else if (e->atom == _QTOPIA_SOFT_MENU) + else if (e->atom == ATM__QTOPIA_SOFT_MENU) { bd->client.qtopia.fetch.soft_menu = 1; bd->changed = 1; } - else if (e->atom == _QTOPIA_SOFT_MENUS) + else if (e->atom == ATM__QTOPIA_SOFT_MENUS) { bd->client.qtopia.fetch.soft_menus = 1; bd->changed = 1; diff --git a/src/bin/e_dnd.c b/src/bin/e_dnd.c index a8d64ffd8..7cda21130 100644 --- a/src/bin/e_dnd.c +++ b/src/bin/e_dnd.c @@ -763,7 +763,9 @@ _e_drag_update(Ecore_X_Window root, int x, int y, Ecore_X_Atom action) { /* A little bit of caching to avoid trips to X. */ cache.win = root; - cache.root = ecore_x_window_root_get(root); +// wtf - get root of root window? pointless! +// cache.root = ecore_x_window_root_get(root); + cache.root = root; } win = ecore_x_window_shadow_tree_at_xy_with_skip_get(cache.root, x, y, ignore_win, 2); // win = ecore_x_window_at_xy_with_skip_get(x, y, ignore_win, 2); diff --git a/src/bin/e_focus.c b/src/bin/e_focus.c index f94babfd4..62156cf2e 100644 --- a/src/bin/e_focus.c +++ b/src/bin/e_focus.c @@ -34,7 +34,10 @@ e_focus_event_mouse_in(E_Border* bd) (e_config->focus_policy == E_FOCUS_SLOPPY)) { if (!bd->lock_focus_out) - e_border_focus_set(bd, 1, 1); + { + if (!bd->focused) + e_border_focus_set(bd, 1, 1); + } } if (bd->raise_timer) ecore_timer_del(bd->raise_timer); bd->raise_timer = NULL; @@ -67,7 +70,10 @@ e_focus_event_mouse_out(E_Border* bd) if ((ecore_loop_time_get() - e_grabinput_last_focus_time_get()) > 0.2) { if (!bd->lock_focus_in) - e_border_focus_set(bd, 0, 1); + { + if (bd->focused) + e_border_focus_set(bd, 0, 1); + } } } if (bd->raise_timer) @@ -83,7 +89,10 @@ e_focus_event_mouse_down(E_Border* bd) if (e_config->focus_policy == E_FOCUS_CLICK) { if (!bd->lock_focus_out) - e_border_focus_set(bd, 1, 1); + { + if (!bd->focused) + e_border_focus_set(bd, 1, 1); + } if (!bd->lock_user_stacking) { if (e_config->border_raise_on_focus) diff --git a/src/bin/e_hints.c b/src/bin/e_hints.c index f00a23f59..db137418d 100644 --- a/src/bin/e_hints.c +++ b/src/bin/e_hints.c @@ -3,13 +3,12 @@ */ #include "e.h" -EAPI Ecore_X_Atom _QTOPIA_SOFT_MENU = 0; -EAPI Ecore_X_Atom _QTOPIA_SOFT_MENUS = 0; - -static Ecore_X_Atom gnome_atom = 0; -static Ecore_X_Atom enlightenment_comms = 0; -static Ecore_X_Atom enlightenment_version = 0; -static Ecore_X_Atom enlightenment_scale = 0; +EAPI Ecore_X_Atom ATM__QTOPIA_SOFT_MENU = 0; +EAPI Ecore_X_Atom ATM__QTOPIA_SOFT_MENUS = 0; +EAPI Ecore_X_Atom ATM_GNOME_SM_PROXY = 0; +EAPI Ecore_X_Atom ATM_ENLIGHTENMENT_COMMS = 0; +EAPI Ecore_X_Atom ATM_ENLIGHTENMENT_VERSION = 0; +EAPI Ecore_X_Atom ATM_ENLIGHTENMENT_SCALE = 0; EAPI void e_hints_init(void) @@ -27,12 +26,12 @@ e_hints_init(void) Ecore_X_Atom atoms[6]; ecore_x_atoms_get(atom_names, 6, atoms); - _QTOPIA_SOFT_MENU = atoms[0]; - _QTOPIA_SOFT_MENUS = atoms[1]; - gnome_atom = atoms[2]; - enlightenment_comms = atoms[3]; - enlightenment_version = atoms[4]; - enlightenment_scale = atoms[5]; + ATM__QTOPIA_SOFT_MENU = atoms[0]; + ATM__QTOPIA_SOFT_MENUS = atoms[1]; + ATM_GNOME_SM_PROXY = atoms[2]; + ATM_ENLIGHTENMENT_COMMS = atoms[3]; + ATM_ENLIGHTENMENT_VERSION = atoms[4]; + ATM_ENLIGHTENMENT_SCALE = atoms[5]; roots = ecore_x_window_root_list(&num); if (roots) @@ -204,13 +203,13 @@ e_hints_e16_comms_pretend(E_Manager *man) /* to help detect this is NOT e16 */ snprintf(buf, sizeof(buf), "Enlightenment %s", VERSION); - ecore_x_window_prop_property_set(win, enlightenment_version, ECORE_X_ATOM_STRING, 8, buf, strlen(buf)); - ecore_x_window_prop_property_set(man->root, enlightenment_version, ECORE_X_ATOM_STRING, 8, buf, strlen(buf)); + ecore_x_window_prop_property_set(win, ATM_ENLIGHTENMENT_VERSION, ECORE_X_ATOM_STRING, 8, buf, strlen(buf)); + ecore_x_window_prop_property_set(man->root, ATM_ENLIGHTENMENT_VERSION, ECORE_X_ATOM_STRING, 8, buf, strlen(buf)); snprintf(buf, sizeof(buf), "WINID %8x", (int)win); - ecore_x_window_prop_property_set(win, enlightenment_comms, ECORE_X_ATOM_STRING, 8, buf, 14); + ecore_x_window_prop_property_set(win, ATM_ENLIGHTENMENT_COMMS, ECORE_X_ATOM_STRING, 8, buf, 14); - ecore_x_window_prop_property_set(man->root, enlightenment_comms, ECORE_X_ATOM_STRING, 8, buf, 14); + ecore_x_window_prop_property_set(man->root, ATM_ENLIGHTENMENT_COMMS, ECORE_X_ATOM_STRING, 8, buf, 14); } EAPI void @@ -1364,7 +1363,7 @@ e_hints_window_qtopia_soft_menu_get(E_Border *bd) { unsigned int val; - if (ecore_x_window_prop_card32_get(bd->client.win, _QTOPIA_SOFT_MENU, &val, 1)) + if (ecore_x_window_prop_card32_get(bd->client.win, ATM__QTOPIA_SOFT_MENU, &val, 1)) bd->client.qtopia.soft_menu = val; else bd->client.qtopia.soft_menu = 0; @@ -1375,7 +1374,7 @@ e_hints_window_qtopia_soft_menus_get(E_Border *bd) { unsigned int val; - if (ecore_x_window_prop_card32_get(bd->client.win, _QTOPIA_SOFT_MENUS, &val, 1)) + if (ecore_x_window_prop_card32_get(bd->client.win, ATM__QTOPIA_SOFT_MENUS, &val, 1)) bd->client.qtopia.soft_menus = val; else bd->client.qtopia.soft_menus = 0; @@ -1396,9 +1395,9 @@ e_hints_window_virtual_keyboard_get(E_Border *bd) EAPI void e_hints_openoffice_gnome_fake(Ecore_X_Window root) { - const char *string = "GNOME_SM_PROXY"; + const char *string = "ATM_GNOME_SM_PROXY"; - ecore_x_window_prop_property_set(root, gnome_atom, ECORE_X_ATOM_STRING, + ecore_x_window_prop_property_set(root, ATM_GNOME_SM_PROXY, ECORE_X_ATOM_STRING, 8, (void *)string, strlen(string)); } @@ -1423,7 +1422,7 @@ e_hints_scale_update(void) { scale = e_scale * 1000; for (i = 0; i < num; i++) - ecore_x_window_prop_card32_set(roots[i], enlightenment_scale, &scale, 1); + ecore_x_window_prop_card32_set(roots[i], ATM_ENLIGHTENMENT_SCALE, &scale, 1); free(roots); } } diff --git a/src/bin/e_hints.h b/src/bin/e_hints.h index c3fedeb14..ac0c2b1a3 100644 --- a/src/bin/e_hints.h +++ b/src/bin/e_hints.h @@ -55,8 +55,12 @@ EAPI void e_hints_openoffice_kde_fake(Ecore_X_Window root); EAPI void e_hints_scale_update(void); -extern EAPI Ecore_X_Atom _QTOPIA_SOFT_MENU; -extern EAPI Ecore_X_Atom _QTOPIA_SOFT_MENUS; +extern EAPI Ecore_X_Atom ATM__QTOPIA_SOFT_MENU; +extern EAPI Ecore_X_Atom ATM__QTOPIA_SOFT_MENUS; +extern EAPI Ecore_X_Atom ATM_GNOME_SM_PROXY; +extern EAPI Ecore_X_Atom ATM_ENLIGHTENMENT_COMMS; +extern EAPI Ecore_X_Atom ATM_ENLIGHTENMENT_VERSION; +extern EAPI Ecore_X_Atom ATM_ENLIGHTENMENT_SCALE; #endif #endif diff --git a/src/modules/comp/e_mod_comp.c b/src/modules/comp/e_mod_comp.c index 6045c5a38..ed5ce5cfc 100644 --- a/src/modules/comp/e_mod_comp.c +++ b/src/modules/comp/e_mod_comp.c @@ -699,6 +699,24 @@ _e_mod_comp_cb_update(E_Comp *c) c->updates = new_updates; c->render_overflow--; c->update_job = NULL; + + { + static double t0 = 0.0; + double td, t; + + t = ecore_time_get(); + td = t - t0; + if (td > 0.0) + { + int fps, i; + + fps = 1.0 / td; + for (i = 0; i < fps; i+= 2) putchar('='); + printf(" : %3.3f\n", 1.0 / td); + } + t0 = t; + } + if (c->render_overflow == 0) { if (c->render_animator) c->render_animator = NULL; diff --git a/src/modules/illume-home/e_mod_main.c b/src/modules/illume-home/e_mod_main.c index 8b3fa03a5..d9e280213 100644 --- a/src/modules/illume-home/e_mod_main.c +++ b/src/modules/illume-home/e_mod_main.c @@ -897,8 +897,7 @@ _il_home_cb_prop_change(void *data, int type, void *event) ev = event; if (!(inst = data)) return 1; // if (ev->win != ecore_x_window_root_first_get()) return 1; - if (strcmp(ecore_x_atom_name_get(ev->atom), "ENLIGHTENMENT_SCALE")) - return 1; + if (ev->atom != ATM_ENLIGHTENMENT_SCALE) return 1; EINA_LIST_FOREACH(inst->wins, l, hwin) if (hwin->o_fm) diff --git a/src/modules/illume-indicator/e_mod_ind_win.c b/src/modules/illume-indicator/e_mod_ind_win.c index c3b24b8ff..771387e89 100644 --- a/src/modules/illume-indicator/e_mod_ind_win.c +++ b/src/modules/illume-indicator/e_mod_ind_win.c @@ -179,9 +179,8 @@ _e_mod_ind_win_cb_win_prop(void *data, int type __UNUSED__, void *event) ev = event; if (!(iwin = data)) return 1; - if (ev->win != ecore_x_window_root_get(iwin->win->evas_win)) return 1; - if (strcmp(ecore_x_atom_name_get(ev->atom), "ENLIGHTENMENT_SCALE")) - return 1; + if (ev->win != iwin->win->container->manager->root) return 1; + if (ev->atom != ATM_ENLIGHTENMENT_SCALE) return 1; /* set minimum size of this window */ e_win_size_min_set(iwin->win, iwin->zone->w, (32 * e_scale)); diff --git a/src/modules/illume-softkey/e_mod_sft_win.c b/src/modules/illume-softkey/e_mod_sft_win.c index a5b225bec..f7fd8b4b2 100644 --- a/src/modules/illume-softkey/e_mod_sft_win.c +++ b/src/modules/illume-softkey/e_mod_sft_win.c @@ -155,8 +155,8 @@ _e_mod_sft_win_cb_win_prop(void *data, int type __UNUSED__, void *event) ev = event; if (!(swin = data)) return 1; - if (ev->win != ecore_x_window_root_get(swin->win->evas_win)) return 1; - if (strcmp(ecore_x_atom_name_get(ev->atom), "ENLIGHTENMENT_SCALE")) return 1; + if (ev->win != swin->win->container->manager->root) return 1; + if (ev->atom != ATM_ENLIGHTENMENT_SCALE) return 1; /* set minimum size of this window */ e_win_size_min_set(swin->win, swin->zone->w, (32 * e_scale)); diff --git a/src/modules/illume2/policies/illume/policy.c b/src/modules/illume2/policies/illume/policy.c index 66b63890e..41565f343 100644 --- a/src/modules/illume2/policies/illume/policy.c +++ b/src/modules/illume2/policies/illume/policy.c @@ -1650,7 +1650,7 @@ _policy_property_change(Ecore_X_Event_Window_Property *event) ecore_x_e_illume_keyboard_geometry_set(bd->client.win, x, y, w, h); } } - else if (!strcmp(ecore_x_atom_name_get(event->atom), "ENLIGHTENMENT_SCALE")) + else if (event->atom == ATM_ENLIGHTENMENT_SCALE) { Eina_List *ml; E_Manager *man;