options to allow shading etc.

SVN revision: 19648
This commit is contained in:
Carsten Haitzler 2006-01-08 12:32:16 +00:00
parent 4453a2bb87
commit 5c33ead53a
4 changed files with 24 additions and 9 deletions

View File

@ -695,7 +695,7 @@ e_border_resize(E_Border *bd, int w, int h)
E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE);
if ((bd->shaded) || (bd->shading) || (bd->fullscreen) ||
(bd->maximized == E_MAXIMIZE_FULLSCREEN))
((bd->maximized == E_MAXIMIZE_FULLSCREEN) && (!e_config->allow_shading)))
return;
if (bd->new_client)
{
@ -752,7 +752,7 @@ e_border_move_resize(E_Border *bd, int x, int y, int w, int h)
E_OBJECT_CHECK(bd);
E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE);
if ((bd->fullscreen) || (bd->maximized == E_MAXIMIZE_FULLSCREEN)) return;
if ((bd->fullscreen) || ((bd->maximized == E_MAXIMIZE_FULLSCREEN) && (!e_config->allow_shading))) return;
if (bd->new_client)
{
E_Border_Pending_Move_Resize *pnd;
@ -1284,7 +1284,8 @@ e_border_shade(E_Border *bd, E_Direction dir)
E_OBJECT_CHECK(bd);
E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE);
if ((bd->fullscreen) || (bd->maximized) || (bd->shading)) return;
if ((bd->fullscreen) || ((bd->maximized) && (!e_config->allow_shading))
|| (bd->shading)) return;
if ((bd->client.border.name) &&
(!strcmp("borderless", bd->client.border.name))) return;
if (!bd->shaded)
@ -1371,7 +1372,8 @@ e_border_unshade(E_Border *bd, E_Direction dir)
E_OBJECT_CHECK(bd);
E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE);
if ((bd->fullscreen) || (bd->maximized) || (bd->shading)) return;
if ((bd->fullscreen) || ((bd->maximized) && (!e_config->allow_shading))
|| (bd->shading)) return;
if (bd->shaded)
{
// printf("UNSHADE!\n");
@ -3754,8 +3756,10 @@ _e_border_cb_window_move_resize_request(void *data, int ev_type, void *ev)
bd = e_border_find_by_client_window(e->win);
if (!bd) return 1;
if ((bd->shaded) || (bd->shading) || (bd->maximized == E_MAXIMIZE_FULLSCREEN) ||
(bd->fullscreen) || (bd->moving) || (bd->resize_mode != RESIZE_NONE))
if ((bd->shaded) || (bd->shading)
|| ((bd->maximized == E_MAXIMIZE_FULLSCREEN) && (!e_config->allow_shading))
|| (bd->fullscreen) || (bd->moving)
|| (bd->resize_mode != RESIZE_NONE))
return 1;
if ((e->button >= 1) && (e->button <= 3))
@ -6284,8 +6288,9 @@ _e_border_resize_begin(E_Border *bd)
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) && (!e_config->allow_shading))
|| (bd->fullscreen) || (bd->lock_user_size))
return 0;
if ((bd->client.icccm.base_w >= 0) &&
@ -6385,7 +6390,8 @@ _e_border_move_begin(E_Border *bd)
{
if (!bd->lock_user_stacking)
e_border_raise(bd);
if ((bd->maximized == E_MAXIMIZE_FULLSCREEN) || (bd->fullscreen) || (bd->lock_user_location))
if ((bd->maximized == E_MAXIMIZE_FULLSCREEN)
|| (bd->fullscreen) || (bd->lock_user_location))
return 0;
if (grabbed)

View File

@ -332,6 +332,7 @@ e_config_init(void)
E_CONFIG_VAL(D, T, winlist_pos_max_w, INT); /**/
E_CONFIG_VAL(D, T, winlist_pos_max_h, INT); /**/
E_CONFIG_VAL(D, T, maximize_policy, INT); /**/
E_CONFIG_VAL(D, T, allow_shading, INT); /**/
E_CONFIG_VAL(D, T, kill_if_close_not_possible, INT); /**/
E_CONFIG_VAL(D, T, kill_process, INT); /**/
E_CONFIG_VAL(D, T, kill_timer_wait, DOUBLE); /**/
@ -479,6 +480,7 @@ e_config_init(void)
e_config->winlist_pos_max_w = 320;
e_config->winlist_pos_max_h = 320;
e_config->maximize_policy = E_MAXIMIZE_FULLSCREEN;
e_config->allow_shading = 0;
e_config->kill_if_close_not_possible = 1;
e_config->kill_process = 1;
e_config->kill_timer_wait = 10.0;
@ -1494,6 +1496,7 @@ e_config_init(void)
E_CONFIG_LIMIT(e_config->winlist_pos_max_w, 8, 4000);
E_CONFIG_LIMIT(e_config->winlist_pos_max_h, 8, 4000);
E_CONFIG_LIMIT(e_config->maximize_policy, E_MAXIMIZE_FULLSCREEN, E_MAXIMIZE_FILL);
E_CONFIG_LIMIT(e_config->allow_shading, 0, 1);
E_CONFIG_LIMIT(e_config->kill_if_close_not_possible, 0, 1);
E_CONFIG_LIMIT(e_config->kill_process, 0, 1);
E_CONFIG_LIMIT(e_config->kill_timer_wait, 0.0, 120.0);

View File

@ -152,6 +152,7 @@ struct _E_Config
int winlist_pos_max_w; // GUI
int winlist_pos_max_h; // GUI
int maximize_policy; // GUI
int allow_shading; // GUI
int kill_if_close_not_possible;
int kill_process;
double kill_timer_wait;

View File

@ -28,6 +28,7 @@ struct _CFData
int window_resist;
int gadget_resist;
int maximize_policy;
int allow_shading;
};
/* a nice easy setup function that does the dirty work */
@ -65,6 +66,7 @@ _fill_data(CFData *cfdata)
if (cfdata->use_auto_raise) cfdata->auto_raise = 1;
if (cfdata->use_resist) cfdata->resist = 1;
cfdata->maximize = cfdata->maximize_policy;
cfdata->allow_shading = e_config->allow_shading;
}
static void *
@ -111,6 +113,7 @@ _advanced_apply_data(E_Config_Dialog *cfd, CFData *cfdata)
e_config->window_resist = cfdata->window_resist;
e_config->gadget_resist = cfdata->gadget_resist;
e_config->maximize_policy = cfdata->maximize_policy;
e_config->allow_shading = cfdata->allow_shading;
e_config_save_queue();
return 1; /* Apply was OK */
}
@ -196,6 +199,8 @@ _advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, CFData *cfdata)
e_widget_framelist_object_append(of, ob);
ob = e_widget_radio_add(evas, _("Fill available space"), E_MAXIMIZE_FILL, rg);
e_widget_framelist_object_append(of, ob);
ob = e_widget_check_add(evas, _("Allow shading/resizing"), &(cfdata->allow_shading));
e_widget_framelist_object_append(of, ob);
e_widget_list_object_append(o, of, 1, 1, 0.5);
return o;