no more round trips! bad bad bad!

SVN revision: 46459
This commit is contained in:
Carsten Haitzler 2010-02-25 12:26:10 +00:00
parent 6ca28f148a
commit 4513a24797
10 changed files with 70 additions and 40 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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)

View File

@ -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);
}
}

View File

@ -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

View File

@ -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;

View File

@ -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)

View File

@ -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));

View File

@ -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));

View File

@ -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;