discomfitor pushed a commit to branch master.
commit 339f4c58e4853a4e953b3b177059415bf0e12f6f
Author: Mike Blumenkrantz <[email protected]>
Date: Mon Feb 25 08:18:06 2013 +0000
gadman no longer crashes when right clicking a dnd-enabled gadget
---
src/modules/gadman/e_mod_gadman.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/src/modules/gadman/e_mod_gadman.c
b/src/modules/gadman/e_mod_gadman.c
index acfb313..94669b8 100644
--- a/src/modules/gadman/e_mod_gadman.c
+++ b/src/modules/gadman/e_mod_gadman.c
@@ -660,7 +660,8 @@ static void
_gadman_gadcon_dnd_move_cb(E_Gadcon *gc, E_Gadcon_Client *gcc)
{
Evas_Object *mover;
- int x, y;
+ E_Zone *zone;
+ int x, y, mx, my;
int ox, oy, ow, oh;
/* only use this for dragging gadcons around the desktop */
@@ -672,7 +673,11 @@ _gadman_gadcon_dnd_move_cb(E_Gadcon *gc, E_Gadcon_Client
*gcc)
/* don't go out of the screen */
x = MAX(x, gcc->dx), y = MAX(y, gcc->dy);
- x = MIN(x, Man->width - ow + gcc->dx), y = MIN(y, Man->height - ow +
gcc->dy);
+
+ /* adjust in case one screen is larger than another */
+ zone = e_gadcon_zone_get(gc);
+ mx = MIN(Man->width, zone->x + zone->w), my = MIN(Man->height, zone->y +
zone->h);
+ x = MIN(x, mx - ow + gcc->dx), y = MIN(y, my - oh + gcc->dy);
evas_object_move(gcc->o_frame, x - gcc->dx, y - gcc->dy);
evas_object_move(mover, x - gcc->dx, y - gcc->dy);
@@ -1011,7 +1016,7 @@ _attach_menu(void *data __UNUSED__, E_Gadcon_Client *gcc,
E_Menu *menu)
e_menu_item_label_set(mi, _("Plain"));
e_menu_item_radio_set(mi, 1);
e_menu_item_radio_group_set(mi, 1);
- if (!strcmp(gcc->cf->style, E_GADCON_CLIENT_STYLE_PLAIN))
+ if (gcc->cf && (!e_util_strcmp(gcc->cf->style,
E_GADCON_CLIENT_STYLE_PLAIN)))
e_menu_item_toggle_set(mi, 1);
e_menu_item_callback_set(mi, on_menu_style_plain, gcc);
--
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb