Tiling2: Fix handling of maximized windows.
authorTom Hacohen <tom@stosb.com>
Thu, 20 Feb 2014 14:56:27 +0000 (14:56 +0000)
committerTom Hacohen <tom@stosb.com>
Fri, 21 Feb 2014 09:15:18 +0000 (09:15 +0000)
This fixes T978.

src/modules/tiling/e_mod_tiling.c

index 6a6a14b..d0709d5 100644 (file)
@@ -153,7 +153,8 @@ desk_should_tile_check(const E_Desk *desk)
 static int
 is_ignored_window(const Client_Extra *extra)
 {
-   if (extra->client->sticky || extra->floating)
+   if (extra->client->sticky || extra->client->maximized ||
+         extra->client->fullscreen || extra->floating)
      return true;
 
    return false;
@@ -834,6 +835,26 @@ _e_mod_action_toggle_split_mode(E_Object *obj EINA_UNUSED,
 /* }}} */
 /* Hooks {{{ */
 
+static Eina_Bool
+_maximize_check_handle(E_Client *ec, Client_Extra *extra)
+{
+   if (extra->tiled && ec->maximized)
+     {
+        _restore_client_no_sizing(ec);
+        _remove_client(ec);
+
+        return EINA_TRUE;
+     }
+   else if (!extra->tiled && !ec->maximized)
+     {
+        _add_client(ec);
+
+        return EINA_TRUE;
+     }
+
+   return EINA_FALSE;
+}
+
 static void
 _move_or_resize(E_Client *ec)
 {
@@ -844,6 +865,9 @@ _move_or_resize(E_Client *ec)
         return;
      }
 
+   if (_maximize_check_handle(ec, extra))
+      return;
+
    if (is_ignored_window(extra))
      return;