fix segv's for display config dialog

SVN revision: 22518
This commit is contained in:
Carsten Haitzler 2006-05-10 14:54:59 +00:00
parent 282a978df4
commit 0f82e95afe
3 changed files with 42 additions and 12 deletions

View File

@ -380,8 +380,8 @@ struct _E_Border
} changes; } changes;
struct { struct {
unsigned char start : 1; unsigned char start : 1;
int x, y; int x, y;
} drag; } drag;
unsigned int layer; unsigned int layer;

View File

@ -1198,15 +1198,41 @@ _e_container_resize_handle(E_Container *con)
bd = l->data; bd = l->data;
if (bd->w > bd->zone->w) if (bd->saved.w > bd->zone->w)
e_border_resize(bd, bd->zone->w, bd->h); bd->saved.w = bd->zone->w;
if ((bd->x + bd->w) > (bd->zone->x + bd->zone->w)) if ((bd->saved.x + bd->saved.w) > (bd->zone->x + bd->zone->w))
e_border_move(bd, bd->zone->x + bd->zone->w - bd->w, bd->y); bd->saved.x = bd->zone->x + bd->zone->w - bd->saved.w;
if (bd->h > bd->zone->h) if (bd->saved.h > bd->zone->h)
e_border_resize(bd, bd->w, bd->zone->h); bd->saved.h = bd->zone->h;
if ((bd->y + bd->h) > (bd->zone->y + bd->zone->h)) if ((bd->saved.y + bd->saved.h) > (bd->zone->y + bd->zone->h))
e_border_move(bd, bd->x, bd->zone->y + bd->zone->h - bd->h); bd->saved.y = bd->zone->y + bd->zone->h - bd->saved.h;
if (bd->fullscreen)
{
e_border_unfullscreen(bd);
e_border_fullscreen(bd, e_config->fullscreen_policy);
}
else if (bd->maximized != E_MAXIMIZE_NONE)
{
E_Maximize max;
max = bd->maximized;
e_border_unmaximize(bd);
e_border_maximize(bd, max);
}
else
{
if (bd->w > bd->zone->w)
e_border_resize(bd, bd->zone->w, bd->h);
if ((bd->x + bd->w) > (bd->zone->x + bd->zone->w))
e_border_move(bd, bd->zone->x + bd->zone->w - bd->w, bd->y);
if (bd->h > bd->zone->h)
e_border_resize(bd, bd->w, bd->zone->h);
if ((bd->y + bd->h) > (bd->zone->y + bd->zone->h))
e_border_move(bd, bd->x, bd->zone->y + bd->zone->h - bd->h);
}
} }
} }
#endif #endif

View File

@ -53,14 +53,17 @@ _surebox_dialog_cb_delete(E_Win *win)
{ {
E_Dialog *dia; E_Dialog *dia;
SureBox *sb; SureBox *sb;
E_Config_Dialog *cfd;
dia = win->data; dia = win->data;
sb = dia->data; sb = dia->data;
sb->cfdata->surebox = NULL; sb->cfdata->surebox = NULL;
cfd = sb->cfdata->cfd;
if (sb->timer) ecore_timer_del(sb->timer); if (sb->timer) ecore_timer_del(sb->timer);
sb->timer = NULL; sb->timer = NULL;
free(sb); free(sb);
e_object_del(E_OBJECT(dia)); e_object_del(E_OBJECT(dia));
e_object_unref(E_OBJECT(cfd));
} }
static void static void
@ -165,6 +168,7 @@ _surebox_new(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
e_win_centered_set(sb->dia->win, 1); e_win_centered_set(sb->dia->win, 1);
e_win_sticky_set(sb->dia->win, 1); e_win_sticky_set(sb->dia->win, 1);
e_dialog_show(sb->dia); e_dialog_show(sb->dia);
e_object_ref(E_OBJECT(cfd));
} }
@ -211,7 +215,7 @@ static void
_free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata) _free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
{ {
if (cfdata->surebox) if (cfdata->surebox)
e_object_del(E_OBJECT(cfdata->surebox->dia)); _surebox_dialog_cb_delete(cfdata->surebox->dia->win);
free(cfdata); free(cfdata);
} }