This is a patch that adds the option to allow these actions. It adds it
to the window manipulation config. Please review it before even
considering updating, since I'm not a C developer.

The option defaults to the current default. I also thougth of making the
window automatically unmaximize itself, but then noticed that that was
never the case with the more forgiving maximizing options.
-- 
Виктор Кожухаров /Viktor Kojouharov/ <[EMAIL PROTECTED]>
Index: src/bin/e_border.c
===================================================================
RCS file: /root/e17/apps/e/src/bin/e_border.c,v
retrieving revision 1.1.1.18
diff -u -r1.1.1.18 e_border.c
--- src/bin/e_border.c	29 Dec 2005 14:35:25 -0000	1.1.1.18
+++ src/bin/e_border.c	6 Jan 2006 11:25:19 -0000
@@ -695,7 +695,7 @@
    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_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_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_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");
@@ -3753,8 +3755,10 @@
    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))
@@ -6250,8 +6254,9 @@
 
    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) &&
@@ -6351,7 +6356,8 @@
 {
    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)
Index: src/bin/e_config.c
===================================================================
RCS file: /root/e17/apps/e/src/bin/e_config.c,v
retrieving revision 1.1.1.14
diff -u -r1.1.1.14 e_config.c
--- src/bin/e_config.c	27 Dec 2005 17:35:57 -0000	1.1.1.14
+++ src/bin/e_config.c	6 Jan 2006 11:25:19 -0000
@@ -332,6 +332,7 @@
    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->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_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);
Index: src/bin/e_config.h
===================================================================
RCS file: /root/e17/apps/e/src/bin/e_config.h,v
retrieving revision 1.1.1.12
diff -u -r1.1.1.12 e_config.h
--- src/bin/e_config.h	4 Jan 2006 22:35:16 -0000	1.1.1.12
+++ src/bin/e_config.h	6 Jan 2006 11:25:19 -0000
@@ -152,6 +152,7 @@
    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;
Index: src/bin/e_int_config_window_manipulation.c
===================================================================
RCS file: /root/e17/apps/e/src/bin/e_int_config_window_manipulation.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 e_int_config_window_manipulation.c
--- src/bin/e_int_config_window_manipulation.c	19 Nov 2005 06:34:36 -0000	1.1.1.1
+++ src/bin/e_int_config_window_manipulation.c	6 Jan 2006 11:25:19 -0000
@@ -28,6 +28,7 @@
    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 @@
    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 @@
    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 @@
    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;

Reply via email to