Enlightenment CVS committal
Author : sebastid
Project : e17
Module : apps/e
Dir : e17/apps/e/src/bin
Modified Files:
e_border.c e_border.h e_config.c e_ipc_handlers.h e_place.c
e_place.h
Log Message:
Manual placement
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_border.c,v
retrieving revision 1.404
retrieving revision 1.405
diff -u -3 -r1.404 -r1.405
--- e_border.c 22 Sep 2005 16:36:59 -0000 1.404
+++ e_border.c 22 Sep 2005 17:10:02 -0000 1.405
@@ -3421,11 +3421,6 @@
}
else if (e->direction == MOVE)
{
- if (!_e_border_move_begin(bd))
- return 1;
- bd->moving = 1;
- e_zone_flip_win_disable();
-
bd->cur_mouse_action = e_action_find("window_move");
if (bd->cur_mouse_action)
{
@@ -3433,7 +3428,10 @@
(!bd->cur_mouse_action->func.end))
bd->cur_mouse_action = NULL;
if (bd->cur_mouse_action)
- e_object_ref(E_OBJECT(bd->cur_mouse_action));
+ {
+ e_object_ref(E_OBJECT(bd->cur_mouse_action));
+ bd->cur_mouse_action->func.go(E_OBJECT(bd), NULL);
+ }
}
}
return 1;
@@ -3860,8 +3858,6 @@
}
bd->mouse.current.mx = ev->root.x;
bd->mouse.current.my = ev->root.y;
- /* bug/problem. this action COULD be deleted during a move */
- /* ... VERY unlikely though... VERY */
/* also we dont pass the same params that went in - then again that */
/* should be ok as we are just ending the action if it has an end */
if (bd->cur_mouse_action)
@@ -4835,6 +4831,11 @@
&new_x, &new_y);
evas_list_free(skiplist);
}
+ else if (e_config->window_placement_policy ==
E_WINDOW_PLACEMENT_MANUAL)
+ {
+ e_place_zone_manual(bd->zone, bd->x, bd->w,
bd->client_inset.t,
+ &new_x, &new_y);
+ }
else
{
e_place_zone_cursor(bd->zone, bd->x, bd->y, bd->w,
bd->h,
@@ -4886,7 +4887,7 @@
bd->placed = 1;
bd->changes.pos = 1;
}
-
+
ecore_x_icccm_move_resize_send(bd->client.win,
bd->x + bd->client_inset.l,
bd->y + bd->client_inset.t,
@@ -5211,6 +5212,42 @@
{
ecore_evas_show(bd->bg_ecore_evas);
ecore_x_window_show(bd->win);
+ if ((!bd->re_manage) &&
+ (e_config->window_placement_policy == E_WINDOW_PLACEMENT_MANUAL) &&
+ (!move) && (!resize))
+ {
+ /* Set this window into moving state */
+ int x, y;
+
+ bd->cur_mouse_action = e_action_find("window_move");
+ if (bd->cur_mouse_action)
+ {
+ if ((!bd->cur_mouse_action->func.end_mouse) &&
+ (!bd->cur_mouse_action->func.end))
+ bd->cur_mouse_action = NULL;
+ if (bd->cur_mouse_action)
+ {
+ ecore_x_pointer_xy_get(bd->zone->container->win, &x, &y);
+
+ bd->x = x - bd->w / 2;
+ bd->y = y - bd->client_inset.t / 2;
+
+ bd->moveinfo.down.x = bd->x;
+ bd->moveinfo.down.y = bd->y;
+ bd->moveinfo.down.w = bd->w;
+ bd->moveinfo.down.h = bd->h;
+ bd->mouse.current.mx = x;
+ bd->mouse.current.my = y;
+ bd->moveinfo.down.button = 0;
+ bd->moveinfo.down.mx = x;
+ bd->moveinfo.down.my = y;
+
+ grabbed = 1;
+ e_object_ref(E_OBJECT(bd->cur_mouse_action));
+ bd->cur_mouse_action->func.go(E_OBJECT(bd), NULL);
+ }
+ }
+ }
bd->changes.visible = 0;
}
bd->new_client = 0;
@@ -6835,8 +6872,8 @@
if (!bd->lock_user_stacking)
e_border_raise(bd);
- if ((bd->shaded) || (bd->shading) || (bd->maximized ==
E_MAXIMIZE_FULLSCREEN) || (bd->fullscreen) ||
- (bd->lock_user_size))
+ if ((bd->shaded) || (bd->shading) || (bd->maximized ==
E_MAXIMIZE_FULLSCREEN) ||
+ (bd->fullscreen) || (bd->lock_user_size))
return 0;
if ((bd->client.icccm.base_w >= 0) &&
@@ -6863,7 +6900,7 @@
h = bd->client.h;
}
if (grabbed)
- ecore_x_pointer_grab(bd->win);
+ e_grabinput_get(bd->win, 0, bd->win);
if (bd->client.netwm.sync.request)
{
bd->client.netwm.sync.alarm =
ecore_x_sync_alarm_new(bd->client.netwm.sync.counter);
@@ -6884,7 +6921,7 @@
_e_border_resize_end(E_Border *bd)
{
if (grabbed)
- ecore_x_pointer_ungrab();
+ e_grabinput_release(bd->win, bd->win);
grabbed = 0;
if (bd->client.netwm.sync.alarm)
{
@@ -6939,8 +6976,9 @@
if ((bd->maximized == E_MAXIMIZE_FULLSCREEN) || (bd->fullscreen) ||
(bd->lock_user_location))
return 0;
+ printf("Grabbed: %d\n", grabbed);
if (grabbed)
- ecore_x_pointer_grab(bd->win);
+ e_grabinput_get(bd->win, 0, bd->win);
#if 0
if (bd->client.netwm.sync.request)
{
@@ -6963,7 +7001,7 @@
_e_border_move_end(E_Border *bd)
{
if (grabbed)
- ecore_x_pointer_ungrab();
+ e_grabinput_release(bd->win, bd->win);
grabbed = 0;
#if 0
if (bd->client.netwm.sync.alarm)
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_border.h,v
retrieving revision 1.113
retrieving revision 1.114
diff -u -3 -r1.113 -r1.114
--- e_border.h 22 Sep 2005 16:36:59 -0000 1.113
+++ e_border.h 22 Sep 2005 17:10:02 -0000 1.114
@@ -61,7 +61,8 @@
typedef enum _E_Window_Placement
{
E_WINDOW_PLACEMENT_SMART,
- E_WINDOW_PLACEMENT_CURSOR
+ E_WINDOW_PLACEMENT_CURSOR,
+ E_WINDOW_PLACEMENT_MANUAL
} E_Window_Placement;
typedef struct _E_Border E_Border;
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_config.c,v
retrieving revision 1.100
retrieving revision 1.101
diff -u -3 -r1.100 -r1.101
--- e_config.c 19 Sep 2005 10:52:45 -0000 1.100
+++ e_config.c 22 Sep 2005 17:10:02 -0000 1.101
@@ -957,7 +957,7 @@
E_CONFIG_LIMIT(e_config->zone_desks_y_count, 1, 64);
E_CONFIG_LIMIT(e_config->use_edge_flip, 0, 1);
E_CONFIG_LIMIT(e_config->edge_flip_timeout, 0.0, 2.0);
- E_CONFIG_LIMIT(e_config->window_placement_policy, 0, 1);
+ E_CONFIG_LIMIT(e_config->window_placement_policy, E_WINDOW_PLACEMENT_SMART,
E_WINDOW_PLACEMENT_MANUAL);
E_CONFIG_LIMIT(e_config->focus_policy, 0, 2);
E_CONFIG_LIMIT(e_config->focus_setting, 0, 3);
E_CONFIG_LIMIT(e_config->pass_click_on, 0, 1);
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_ipc_handlers.h,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -3 -r1.73 -r1.74
--- e_ipc_handlers.h 19 Sep 2005 16:02:16 -0000 1.73
+++ e_ipc_handlers.h 22 Sep 2005 17:10:02 -0000 1.74
@@ -5020,22 +5020,23 @@
/****************************************************************************/
#define HDL E_IPC_OP_WINDOW_PLACEMENT_POLICY_SET
#if (TYPE == E_REMOTE_OPTIONS)
- OP("-window-placement-policy-set", 1, "Set the window placement policy.
OPT1 = SMART or CURSOR", 0, HDL)
+ OP("-window-placement-policy-set", 1, "Set the window placement policy.
OPT1 = SMART, CURSOR or MANUAL", 0, HDL)
#elif (TYPE == E_REMOTE_OUT)
REQ_INT_START(HDL)
int value = 0;
if (!strcmp(params[0], "SMART")) value = E_WINDOW_PLACEMENT_SMART;
else if (!strcmp(params[0], "CURSOR")) value = E_WINDOW_PLACEMENT_CURSOR;
+ else if (!strcmp(params[0], "MANUAL")) value = E_WINDOW_PLACEMENT_MANUAL;
else
{
- printf("window placement policy must be SMART or CURSOR\n");
+ printf("window placement policy must be SMART, CURSOR or MANUAL\n");
exit(-1);
}
REQ_INT_END(value, HDL);
#elif (TYPE == E_WM_IN)
START_INT(value, HDL);
e_config->window_placement_policy = value;
- E_CONFIG_LIMIT(e_config->window_placement_policy, 0, 1);
+ E_CONFIG_LIMIT(e_config->window_placement_policy, E_WINDOW_PLACEMENT_SMART,
E_WINDOW_PLACEMENT_MANUAL);
SAVE;
END_INT
#elif (TYPE == E_REMOTE_IN)
@@ -5065,6 +5066,8 @@
printf("REPLY: SMART\n");
else if (policy == E_WINDOW_PLACEMENT_CURSOR)
printf("REPLY: CURSOR\n");
+ else if (policy == E_WINDOW_PLACEMENT_MANUAL)
+ printf("REPLY: MANUAL\n");
END_INT
#endif
#undef HDL
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_place.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -3 -r1.11 -r1.12
--- e_place.c 20 Sep 2005 05:14:57 -0000 1.11
+++ e_place.c 22 Sep 2005 17:10:02 -0000 1.12
@@ -480,5 +480,16 @@
return 1;
}
+int
+e_place_zone_manual(E_Zone *zone, int x, int w, int it, int *rx, int *ry)
+{
+ int cursor_x = 0, cursor_y = 0;
+ E_OBJECT_CHECK_RETURN(zone, 0);
+ ecore_x_pointer_xy_get(zone->container->win, &cursor_x, &cursor_y);
+ *rx = cursor_x - ((w - x) >> 1);
+ *ry = cursor_y - (it >> 1);
+
+ return 1;
+}
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_place.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- e_place.h 20 Sep 2005 05:14:57 -0000 1.8
+++ e_place.h 22 Sep 2005 17:10:02 -0000 1.9
@@ -9,6 +9,7 @@
EAPI void e_place_zone_region_smart_cleanup(E_Zone *zone);
EAPI int e_place_zone_region_smart(E_Zone *zone, Evas_List *skiplist, int x,
int y, int w, int h, int *rx, int *ry);
EAPI int e_place_zone_cursor(E_Zone *zone, int x, int y, int w, int h, int it,
int *rx, int *ry);
+EAPI int e_place_zone_manual(E_Zone *zone, int x, int w, int it, int *rx, int
*ry);
#endif
#endif
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs