[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[E-devel] Click to focus raise option



Hello,

I added an option to e's config to allow the user to specify if a window should be raised when clicking with click to focus. The patch is attached. It adds the option to the misc setting of the focus config panel.

Let me know if something is wrong (it seems to be working correctly here).

Thanks,
dan
Index: TODO
===================================================================
RCS file: /cvs/e/e17/apps/e/TODO,v
retrieving revision 1.338
diff -u -r1.338 TODO
--- TODO	3 Jun 2006 02:48:31 -0000	1.338
+++ TODO	5 Jun 2006 22:03:53 -0000
@@ -80,7 +80,6 @@
 
 * option to allow flipping desktops to wrap at virtual desktop grid edges
 * winlist and exebuf can let the mouse select items
-* option to NOT raise on focus in click to focus
 * switch to desktop of a new window if it opens on another desktop than the
   current one
 * emit signal to submenu entries if they have a submenu shown for them or not
Index: src/bin/e_config.c
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_config.c,v
retrieving revision 1.176
diff -u -r1.176 e_config.c
--- src/bin/e_config.c	5 Jun 2006 10:50:33 -0000	1.176
+++ src/bin/e_config.c	5 Jun 2006 22:03:53 -0000
@@ -366,6 +366,7 @@
    E_CONFIG_LIST(D, T, path_append_backgrounds, _e_config_path_append_edd); /**/
    E_CONFIG_VAL(D, T, window_placement_policy, INT);
    E_CONFIG_VAL(D, T, focus_policy, INT); /**/
+   E_CONFIG_VAL(D, T, focus_click_raise, INT);
    E_CONFIG_VAL(D, T, focus_setting, INT); /**/
    E_CONFIG_VAL(D, T, pass_click_on, INT); /**/
    E_CONFIG_VAL(D, T, always_click_to_raise, INT); /**/
@@ -542,6 +543,7 @@
    e_config->language = NULL;
    e_config->window_placement_policy = E_WINDOW_PLACEMENT_SMART;
    e_config->focus_policy = E_FOCUS_SLOPPY;
+   e_config->focus_click_raise = 1;
    e_config->focus_setting = E_FOCUS_NEW_DIALOG_IF_OWNER_FOCUSED;
    e_config->pass_click_on = 1;
    e_config->always_click_to_raise = 0;
@@ -1151,6 +1153,7 @@
    E_CONFIG_LIMIT(e_config->edge_flip_timeout, 0.0, 2.0);
    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_click_raise, 0, 1);
    E_CONFIG_LIMIT(e_config->focus_setting, 0, 3);
    E_CONFIG_LIMIT(e_config->pass_click_on, 0, 1);
    E_CONFIG_LIMIT(e_config->always_click_to_raise, 0, 1);
Index: src/bin/e_config.h
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_config.h,v
retrieving revision 1.100
diff -u -r1.100 e_config.h
--- src/bin/e_config.h	5 Jun 2006 10:50:33 -0000	1.100
+++ src/bin/e_config.h	5 Jun 2006 22:03:53 -0000
@@ -50,7 +50,7 @@
 /* increment this whenever a new set of config values are added but the users
  * config doesn't need top be wiped - simply new values need to be put in
  */
-#define E_CONFIG_FILE_GENERATION 0x0094
+#define E_CONFIG_FILE_GENERATION 0x0095
 #define E_CONFIG_FILE_VERSION    ((E_CONFIG_FILE_EPOCH << 16) | E_CONFIG_FILE_GENERATION)
 
 #define E_EVAS_ENGINE_DEFAULT      0
@@ -128,6 +128,7 @@
    Evas_List  *path_append_messages; // GUI
    int         window_placement_policy; // GUI
    int         focus_policy; // GUI
+   int         focus_click_raise; // GUI
    int         focus_setting; // GUI
    int         pass_click_on; // GUI
    int         always_click_to_raise; // GUI
Index: src/bin/e_focus.c
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_focus.c,v
retrieving revision 1.20
diff -u -r1.20 e_focus.c
--- src/bin/e_focus.c	7 Jan 2006 10:39:45 -0000	1.20
+++ src/bin/e_focus.c	5 Jun 2006 22:03:53 -0000
@@ -81,7 +81,7 @@
      {
 	if (!bd->lock_focus_out)
 	  e_border_focus_set(bd, 1, 1);
-	if (!bd->lock_user_stacking)
+	if (!bd->lock_user_stacking && e_config->focus_click_raise)
 	  e_border_raise(bd);
      }
    else if (e_config->always_click_to_raise)
Index: src/bin/e_int_config_focus.c
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_int_config_focus.c,v
retrieving revision 1.12
diff -u -r1.12 e_int_config_focus.c
--- src/bin/e_int_config_focus.c	5 May 2006 12:20:14 -0000	1.12
+++ src/bin/e_int_config_focus.c	5 Jun 2006 22:03:53 -0000
@@ -19,6 +19,7 @@
    int mode;
    /*- ADVANCED -*/
    int focus_policy;
+   int focus_click_raise;
    int focus_setting;
    int pass_click_on;
    int always_click_to_raise;
@@ -53,6 +54,7 @@
 _fill_data(E_Config_Dialog_Data *cfdata)
 {
    cfdata->focus_policy = e_config->focus_policy;
+   cfdata->focus_click_raise = e_config->focus_click_raise;
    cfdata->focus_setting = e_config->focus_setting;
    cfdata->pass_click_on = e_config->pass_click_on;
    cfdata->always_click_to_raise = e_config->always_click_to_raise;
@@ -90,6 +92,8 @@
 {
    /* Actually take our cfdata settings and apply them in real life */
    e_border_button_bindings_ungrab_all();
+
+   e_config->focus_click_raise = 1;
    if (cfdata->mode == E_FOCUS_CLICK)
      {
 	e_config->focus_policy = E_FOCUS_CLICK;
@@ -131,6 +135,7 @@
    /* Actually take our cfdata settings and apply them in real life */
    e_border_button_bindings_ungrab_all();
    e_config->focus_policy = cfdata->focus_policy;
+   e_config->focus_click_raise = cfdata->focus_click_raise;
    e_config->focus_setting = cfdata->focus_setting;
    e_config->pass_click_on = cfdata->pass_click_on;
    e_config->always_click_to_raise = cfdata->always_click_to_raise;
@@ -179,7 +184,7 @@
    ob = e_widget_radio_add(evas, _("Sloppy focus"), E_FOCUS_SLOPPY, rg);
    e_widget_framelist_object_append(of, ob);
    e_widget_list_object_append(o, of, 1, 1, 0.5);
-   
+  
    of = e_widget_framelist_add(evas, _("New Window Focus"), 0);
    rg = e_widget_radio_group_new(&(cfdata->focus_setting));
    ob = e_widget_radio_add(evas, _("No new windows get focus"), E_FOCUS_NONE, rg);
@@ -202,6 +207,8 @@
    ob = e_widget_check_add(evas, _("Refocus last focused window on desktop switch"), &(cfdata->focus_last_focused_per_desktop));
    e_widget_framelist_object_append(of, ob);
    ob = e_widget_check_add(evas, _("Revert focus when hiding or closing a window"), &(cfdata->focus_revert_on_hide_or_close));
+   e_widget_framelist_object_append(of, ob);
+   ob = e_widget_check_add(evas, _("Raise window on click to focus"), &(cfdata->focus_click_raise));
    e_widget_framelist_object_append(of, ob);
    e_widget_list_object_append(o, of, 1, 1, 0.5);