summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Bosveld <Joel.Bosveld@gmail.com>2009-08-07 14:28:28 +0800
committerJoel Bosveld <Joel.Bosveld@gmail.com>2009-08-07 14:28:28 +0800
commit7173879f7c36907e33861a8d433715a58340e88d (patch)
treea077a4207996814abad39acd1f55f9228e82db57
parent087b4d199b28d15106e6a68e5ad0c2b8ba411d9d (diff)
patches: add patch for enlightenment for transformation and redirection support
-rw-r--r--patches/e.patch162
1 files changed, 162 insertions, 0 deletions
diff --git a/patches/e.patch b/patches/e.patch
new file mode 100644
index 0000000..716ef1d
--- /dev/null
+++ b/patches/e.patch
@@ -0,0 +1,162 @@
+Index: ecore/src/lib/ecore_x/Ecore_X.h
+===================================================================
+--- ecore/src/lib/ecore_x/Ecore_X.h (revision 41344)
++++ ecore/src/lib/ecore_x/Ecore_X.h (working copy)
+@@ -5,6 +5,10 @@
+ #ifndef _ECORE_X_H
+ #define _ECORE_X_H
+
++#ifndef TRANSFORMATION
++#define TRANSFORMATION
++#endif
++
+ #ifdef EAPI
+ # undef EAPI
+ #endif
+@@ -1759,7 +1763,11 @@
+ EAPI int ecore_x_test_fake_key_up(const char *key);
+ EAPI int ecore_x_test_fake_key_press(const char *key);
+ EAPI const char *ecore_x_keysym_string_get(int keysym);
+-
++
++#ifdef TRANSFORMATION
++EAPI void ecore_x_root_to_transformed_coordinates (Ecore_X_Window w, int x, int y, int *tx, int *ty);
++#endif
++
+ #ifdef __cplusplus
+ }
+ #endif
+Index: ecore/src/lib/ecore_x/xlib/ecore_x_window.c
+===================================================================
+--- ecore/src/lib/ecore_x/xlib/ecore_x_window.c (revision 41344)
++++ ecore/src/lib/ecore_x/xlib/ecore_x_window.c (working copy)
+@@ -736,23 +736,31 @@
+ _ecore_x_window_tree_walk(Window win)
+ {
+ Window *list = NULL;
+- Window parent_win = 0, root_win = 0;
++ Window parent_win = 0, root_win = 0, dest = 0;
+ int i, j;
+ unsigned int num;
+ Shadow *s, **sl;
+- XWindowAttributes att;
++ XWindowAttributes att, datt;
+
++#ifdef TRANSFORMATION
++ dest = XCompositeGetDestinationWindow (_ecore_x_disp, win);
++#endif
++
+ if (!XGetWindowAttributes(_ecore_x_disp, win, &att)) return NULL;
++ if (dest && !XGetWindowAttributes(_ecore_x_disp, dest, &datt)) return NULL;
+ // if (att.class == InputOnly) return NULL;
+ if (att.map_state != IsViewable) return NULL;
++ /* if destination is unmapped, don't redirect input */
++ if (dest && datt.map_state != IsViewable) dest = 0;
+
+ s = calloc(1, sizeof(Shadow));
+ if (!s) return NULL;
+- s->win = win;
++ s->win = dest ? dest : win;
+ s->x = att.x;
+ s->y = att.y;
+ s->w = att.width;
+ s->h = att.height;
++
+ if (XQueryTree(_ecore_x_disp, s->win, &root_win, &parent_win,
+ &list, &num))
+ {
+@@ -788,6 +796,7 @@
+ if (sl) s->children = sl;
+ }
+ }
++ if (list) XFree(list);
+ }
+ return s;
+ }
+@@ -903,10 +912,16 @@
+ Window child;
+ int i, j;
+ int wx, wy;
+-
++ int tx = x, ty = y; /* transformed coordinates */
++
+ wx = s->x + bx;
+ wy = s->y + by;
+- if (!((x >= wx) && (y >= wy) && (x < (wx + s->w)) && (y < (wy + s->h))))
++#ifdef TRANSFORMATION
++ XTranslateCoordinates(_ecore_x_disp, ecore_x_window_root_get(s->win), s->win, x, y, &tx, &ty, &child);
++ tx += wx;
++ ty += wy;
++#endif
++ if (!((tx >= wx) && (ty >= wy) && (tx < (wx + s->w)) && (ty < (wy + s->h))))
+ return 0;
+ if (s->children)
+ {
+@@ -1415,3 +1430,21 @@
+ return 0;
+ #endif
+ }
++
++#ifdef TRANSFORMATION
++EAPI void
++ecore_x_root_to_transformed_coordinates (Ecore_X_Window w, int x, int y, int *tx, int *ty)
++{
++ Window child;
++ Window root = ecore_x_window_root_get(w);
++ Shadow *s = _ecore_x_window_shadow_tree_find (w);
++
++ XTranslateCoordinates(_ecore_x_disp, root, w, x, y, tx, ty, &child);
++ while (s)
++ {
++ *tx += s->x;
++ *ty += s->y;
++ s = s->parent;
++ }
++}
++#endif
+Index: e/src/bin/e_dnd.c
+===================================================================
+--- e/src/bin/e_dnd.c (revision 41344)
++++ e/src/bin/e_dnd.c (working copy)
+@@ -787,6 +787,13 @@
+ _e_drag_move(_drag_current, x, y);
+ }
+
++#ifdef TRANSFORMATION
++ /* Transform coordinates from screen root window space to transformed root
++ * window space of win
++ */
++ ecore_x_root_to_transformed_coordinates (win, x, y, &x, &y);
++#endif
++
+ if (_drag_current)
+ {
+ E_Drop_Handler *h;
+@@ -934,6 +941,13 @@
+ ecore_x_window_free(_drag_win);
+ _drag_win = 0;
+
++#ifdef TRANSFORMATION
++ /* Transform coordinates from screen root window space to transformed root
++ * window space of win
++ */
++ ecore_x_root_to_transformed_coordinates (win, x, y, &x, &y);
++#endif
++
+ if (_drag_current->data)
+ {
+ E_Drop_Handler *h;
+@@ -1001,6 +1015,13 @@
+
+ ev.data = _xdnd->data;
+
++#ifdef TRANSFORMATION
++ /* Transform coordinates from screen root window space to transformed root
++ * window space of win
++ */
++ ecore_x_root_to_transformed_coordinates (win, x, y, &x, &y);
++#endif
++
+ if (ev.data)
+ {
+ E_Drop_Handler *h;