summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2019-08-10 10:57:09 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2019-08-10 10:57:09 +0100
commita172d930dafaa4b77df21f35cfb4873c459fd71a (patch)
treeb58c2c7884c29816d4c8c2ed50f681b9de7732b0 /src/modules
parente11eb90231e75e5c9b87c676b4a857a5c164b5eb (diff)
tiling - ignore min size for layout of tree to avoid insta-floats
so some clients just cant tile due to min size and this leads to really bad results so pass the problem back to the user to go resize them up to fit. this probably needs far more extensive layout logic. the data struct is a tree but perhaps it needs to flatten out into a table to make layouting more sane. but that's the future. for now be less bad today.
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/tiling/e_mod_tiling.c3
-rw-r--r--src/modules/tiling/window_tree.c33
-rw-r--r--src/modules/tiling/window_tree.h8
3 files changed, 28 insertions, 16 deletions
diff --git a/src/modules/tiling/e_mod_tiling.c b/src/modules/tiling/e_mod_tiling.c
index c7813d5..bf41fa7 100644
--- a/src/modules/tiling/e_mod_tiling.c
+++ b/src/modules/tiling/e_mod_tiling.c
@@ -479,7 +479,8 @@ _reapply_tree(void)
479 479
480 if (zw > 0 && zh > 0) 480 if (zw > 0 && zh > 0)
481 tiling_window_tree_apply(_G.tinfo->tree, zx, zy, zw, zh, 481 tiling_window_tree_apply(_G.tinfo->tree, zx, zy, zw, zh,
482 tiling_g.config->window_padding); 482 tiling_g.config->window_padding,
483 EINA_FALSE);
483 else 484 else
484 ERR("The zone desk geometry was not useful at all (%d,%d,%d,%d)", zx, zy, zw, zh); 485 ERR("The zone desk geometry was not useful at all (%d,%d,%d,%d)", zx, zy, zw, zh);
485 } 486 }
diff --git a/src/modules/tiling/window_tree.c b/src/modules/tiling/window_tree.c
index fab4563..fa3fa8d 100644
--- a/src/modules/tiling/window_tree.c
+++ b/src/modules/tiling/window_tree.c
@@ -296,20 +296,20 @@ _tiling_window_tree_level_apply(Window_Tree *root, Evas_Coord x, Evas_Coord y,
296 Tiling_Split_Type split_type = level % 2; 296 Tiling_Split_Type split_type = level % 2;
297 double total_weight = 0.0; 297 double total_weight = 0.0;
298 298
299 root->space.x = x;
300 root->space.y = y;
301 root->space.w = w - padding;
302 root->space.h = h - padding;
303
299 if (root->client) 304 if (root->client)
300 { 305 {
301 if (!e_object_is_del(E_OBJECT(root->client))) 306 if (!e_object_is_del(E_OBJECT(root->client)))
302 { 307 {
303 if ((root->client->icccm.min_w > (w - padding)) || 308 if ((root->client->icccm.min_w > (w - padding)) ||
304 (root->client->icccm.min_h > (h - padding))) 309 (root->client->icccm.min_h > (h - padding)))
305 { 310 *floaters = eina_list_append(*floaters, root->client);
306 *floaters = eina_list_append(*floaters, root->client); 311 tiling_e_client_move_resize_extra(root->client, x, y,
307 } 312 w - padding, h - padding);
308 else
309 {
310 tiling_e_client_move_resize_extra(root->client, x, y,
311 w - padding, h - padding);
312 }
313 } 313 }
314 return; 314 return;
315 } 315 }
@@ -341,9 +341,10 @@ _tiling_window_tree_level_apply(Window_Tree *root, Evas_Coord x, Evas_Coord y,
341 ((Window_Tree *)(void *)root->children->last)->weight += 1.0 - total_weight; 341 ((Window_Tree *)(void *)root->children->last)->weight += 1.0 - total_weight;
342} 342}
343 343
344void 344Eina_Bool
345tiling_window_tree_apply(Window_Tree *root, Evas_Coord x, Evas_Coord y, 345tiling_window_tree_apply(Window_Tree *root, Evas_Coord x, Evas_Coord y,
346 Evas_Coord w, Evas_Coord h, Evas_Coord padding) 346 Evas_Coord w, Evas_Coord h, Evas_Coord padding,
347 Eina_Bool force_float)
347{ 348{
348 Eina_List *floaters = NULL; 349 Eina_List *floaters = NULL;
349 E_Client *ec; 350 E_Client *ec;
@@ -354,10 +355,16 @@ tiling_window_tree_apply(Window_Tree *root, Evas_Coord x, Evas_Coord y,
354 h -= padding; 355 h -= padding;
355 _tiling_window_tree_level_apply(root, x, y, w, h, 0, padding, &floaters); 356 _tiling_window_tree_level_apply(root, x, y, w, h, 0, padding, &floaters);
356 357
357 EINA_LIST_FREE(floaters, ec) 358 if (floaters)
358 { 359 {
359 tiling_e_client_does_not_fit(ec); 360 // some clients failed to properly fit and maybe SHOULD float
361 EINA_LIST_FREE(floaters, ec)
362 {
363 if (force_float) tiling_e_client_does_not_fit(ec);
364 }
365 return EINA_FALSE;
360 } 366 }
367 return EINA_TRUE;
361} 368}
362 369
363static Window_Tree * 370static Window_Tree *
diff --git a/src/modules/tiling/window_tree.h b/src/modules/tiling/window_tree.h
index 364305c..a410e78 100644
--- a/src/modules/tiling/window_tree.h
+++ b/src/modules/tiling/window_tree.h
@@ -21,6 +21,9 @@ struct _Window_Tree
21 /* FIXME: client is falid iff children is null. Sholud enforce it. */ 21 /* FIXME: client is falid iff children is null. Sholud enforce it. */
22 Eina_Inlist *children; /* Window_Tree * type */ 22 Eina_Inlist *children; /* Window_Tree * type */
23 E_Client *client; 23 E_Client *client;
24 struct {
25 int x, y, w, h;
26 } space;
24 double weight; 27 double weight;
25}; 28};
26 29
@@ -52,8 +55,9 @@ Window_Tree *tiling_window_tree_remove(Window_Tree *root, Window_Tree *item);
52Window_Tree *tiling_window_tree_client_find(Window_Tree *root, 55Window_Tree *tiling_window_tree_client_find(Window_Tree *root,
53 E_Client *client); 56 E_Client *client);
54 57
55void tiling_window_tree_apply(Window_Tree *root, Evas_Coord x, Evas_Coord y, 58Eina_Bool tiling_window_tree_apply(Window_Tree *root, Evas_Coord x, Evas_Coord y,
56 Evas_Coord w, Evas_Coord h, Evas_Coord padding); 59 Evas_Coord w, Evas_Coord h, Evas_Coord padding,
60 Eina_Bool force_float);
57 61
58Eina_Bool tiling_window_tree_node_resize(Window_Tree *node, int w_dir, 62Eina_Bool tiling_window_tree_node_resize(Window_Tree *node, int w_dir,
59 double w_diff, int h_dir, double h_diff); 63 double w_diff, int h_dir, double h_diff);