summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dransfeld <sd@tango.flipp.net>2013-11-21 13:24:46 +0100
committerSebastian Dransfeld <sd@tango.flipp.net>2013-11-21 13:26:09 +0100
commitd739ed0e2ecd8eab1bdf4d30b5fd40faba4c0533 (patch)
treea1644a084112c87cafc00cc0dafae281674e58a7
parent7a6a87b9556cef8bd6289218fb496067ecac523e (diff)
handle desktop applications better
Fixes T201
-rw-r--r--src/bin/e_border.c18
-rw-r--r--src/bin/e_border.h1
-rw-r--r--src/bin/e_focus.c14
3 files changed, 26 insertions, 7 deletions
diff --git a/src/bin/e_border.c b/src/bin/e_border.c
index 19b49ffff..462c8e015 100644
--- a/src/bin/e_border.c
+++ b/src/bin/e_border.c
@@ -420,6 +420,7 @@ e_border_new(E_Container *con, Ecore_X_Window win, int first_map, int internal)
420 ecore_x_window_shadow_tree_flush(); 420 ecore_x_window_shadow_tree_flush();
421 e_object_del_func_set(E_OBJECT(bd), E_OBJECT_CLEANUP_FUNC(_e_border_del)); 421 e_object_del_func_set(E_OBJECT(bd), E_OBJECT_CLEANUP_FUNC(_e_border_del));
422 422
423 bd->focus_policy = e_config->focus_policy;
423 bd->w = 1; 424 bd->w = 1;
424 bd->h = 1; 425 bd->h = 1;
425 /* FIXME: ewww - round trip */ 426 /* FIXME: ewww - round trip */
@@ -7281,6 +7282,21 @@ _e_border_eval0(E_Border *bd)
7281 bd->client.netwm.update.state = 1; 7282 bd->client.netwm.update.state = 1;
7282 } 7283 }
7283 } 7284 }
7285 else if (bd->client.netwm.type == ECORE_X_WINDOW_TYPE_DESKTOP)
7286 {
7287 bd->focus_policy = E_FOCUS_CLICK;
7288 e_focus_setup(bd);
7289 if (!bd->client.netwm.state.skip_pager)
7290 {
7291 bd->client.netwm.state.skip_pager = 1;
7292 bd->client.netwm.update.state = 1;
7293 }
7294 if (!bd->client.netwm.state.skip_taskbar)
7295 {
7296 bd->client.netwm.state.skip_taskbar = 1;
7297 bd->client.netwm.update.state = 1;
7298 }
7299 }
7284 bd->client.netwm.fetch.type = 0; 7300 bd->client.netwm.fetch.type = 0;
7285 } 7301 }
7286 if (bd->client.icccm.fetch.machine) 7302 if (bd->client.icccm.fetch.machine)
@@ -8115,6 +8131,8 @@ _e_border_eval0(E_Border *bd)
8115 bordername = bd->bordername; 8131 bordername = bd->bordername;
8116 else if ((bd->client.mwm.borderless) || (bd->borderless)) 8132 else if ((bd->client.mwm.borderless) || (bd->borderless))
8117 bordername = "borderless"; 8133 bordername = "borderless";
8134 else if (bd->client.netwm.type == ECORE_X_WINDOW_TYPE_DESKTOP)
8135 bordername = "borderless";
8118 else if (((bd->client.icccm.transient_for != 0) || 8136 else if (((bd->client.icccm.transient_for != 0) ||
8119 (bd->client.netwm.type == ECORE_X_WINDOW_TYPE_DIALOG)) && 8137 (bd->client.netwm.type == ECORE_X_WINDOW_TYPE_DIALOG)) &&
8120 (bd->client.icccm.min_w == bd->client.icccm.max_w) && 8138 (bd->client.icccm.min_w == bd->client.icccm.max_w) &&
diff --git a/src/bin/e_border.h b/src/bin/e_border.h
index 33babaffe..0b28fe7d2 100644
--- a/src/bin/e_border.h
+++ b/src/bin/e_border.h
@@ -667,6 +667,7 @@ struct _E_Border
667 Eina_Bool argb; 667 Eina_Bool argb;
668 668
669 int tmp_input_hidden; 669 int tmp_input_hidden;
670 int focus_policy;
670}; 671};
671 672
672struct _E_Border_Pending_Move_Resize 673struct _E_Border_Pending_Move_Resize
diff --git a/src/bin/e_focus.c b/src/bin/e_focus.c
index 28fb473c2..3a45779e6 100644
--- a/src/bin/e_focus.c
+++ b/src/bin/e_focus.c
@@ -27,8 +27,8 @@ e_focus_idler_before(void)
27EAPI void 27EAPI void
28e_focus_event_mouse_in(E_Border *bd) 28e_focus_event_mouse_in(E_Border *bd)
29{ 29{
30 if ((e_config->focus_policy == E_FOCUS_MOUSE) || 30 if ((bd->focus_policy == E_FOCUS_MOUSE) ||
31 (e_config->focus_policy == E_FOCUS_SLOPPY)) 31 (bd->focus_policy == E_FOCUS_SLOPPY))
32 { 32 {
33 e_border_focus_set(bd, 1, 1); 33 e_border_focus_set(bd, 1, 1);
34 } 34 }
@@ -49,7 +49,7 @@ e_focus_event_mouse_in(E_Border *bd)
49EAPI void 49EAPI void
50e_focus_event_mouse_out(E_Border *bd) 50e_focus_event_mouse_out(E_Border *bd)
51{ 51{
52 if (e_config->focus_policy == E_FOCUS_MOUSE) 52 if (bd->focus_policy == E_FOCUS_MOUSE)
53 { 53 {
54 if (!bd->lock_focus_in) 54 if (!bd->lock_focus_in)
55 { 55 {
@@ -65,7 +65,7 @@ e_focus_event_mouse_down(E_Border *bd)
65{ 65{
66 if (!bd->focused) 66 if (!bd->focused)
67 { 67 {
68 if (e_config->focus_policy == E_FOCUS_CLICK) 68 if (bd->focus_policy == E_FOCUS_CLICK)
69 e_border_focus_set(bd, 1, 1); 69 e_border_focus_set(bd, 1, 1);
70 else if (e_config->always_click_to_focus) 70 else if (e_config->always_click_to_focus)
71 e_border_focus_set(bd, 1, 1); 71 e_border_focus_set(bd, 1, 1);
@@ -85,7 +85,7 @@ e_focus_event_mouse_up(E_Border *bd __UNUSED__)
85EAPI void 85EAPI void
86e_focus_event_focus_in(E_Border *bd) 86e_focus_event_focus_in(E_Border *bd)
87{ 87{
88 if ((e_config->focus_policy == E_FOCUS_CLICK) && 88 if ((bd->focus_policy == E_FOCUS_CLICK) &&
89 (!e_config->always_click_to_raise) && 89 (!e_config->always_click_to_raise) &&
90 (!e_config->always_click_to_focus)) 90 (!e_config->always_click_to_focus))
91 { 91 {
@@ -104,7 +104,7 @@ e_focus_event_focus_in(E_Border *bd)
104EAPI void 104EAPI void
105e_focus_event_focus_out(E_Border *bd) 105e_focus_event_focus_out(E_Border *bd)
106{ 106{
107 if ((e_config->focus_policy == E_FOCUS_CLICK) && 107 if ((bd->focus_policy == E_FOCUS_CLICK) &&
108 (!e_config->always_click_to_raise) && 108 (!e_config->always_click_to_raise) &&
109 (!e_config->always_click_to_focus)) 109 (!e_config->always_click_to_focus))
110 { 110 {
@@ -128,7 +128,7 @@ e_focus_event_focus_out(E_Border *bd)
128EAPI void 128EAPI void
129e_focus_setup(E_Border *bd) 129e_focus_setup(E_Border *bd)
130{ 130{
131 if ((e_config->focus_policy == E_FOCUS_CLICK) || 131 if ((bd->focus_policy == E_FOCUS_CLICK) ||
132 (e_config->always_click_to_raise) || 132 (e_config->always_click_to_raise) ||
133 (e_config->always_click_to_focus)) 133 (e_config->always_click_to_focus))
134 { 134 {