#include "layout.h"
#include "client.h"
#include "floating.h"
+#include "workspace.h"
/*
* Toggles floating mode for the given client.
if (con == NULL) {
LOG("This client is already in floating (container == NULL), re-inserting\n");
Client *next_tiling;
- SLIST_FOREACH(next_tiling, &(client->workspace->focus_stack), focus_clients)
+ Workspace *ws = client->workspace;
+ SLIST_FOREACH(next_tiling, &(ws->focus_stack), focus_clients)
if (!client_is_floating(next_tiling))
break;
/* If there are no tiling clients on this workspace, there can only be one
* container: the first one */
- if (next_tiling == TAILQ_END(&(client->workspace->focus_stack)))
- con = client->workspace->table[0][0];
+ if (next_tiling == TAILQ_END(&(ws->focus_stack)))
+ con = ws->table[0][0];
else con = next_tiling->container;
/* Remove the client from the list of floating clients */
- TAILQ_REMOVE(&(client->workspace->floating_clients), client, floating_clients);
+ TAILQ_REMOVE(&(ws->floating_clients), client, floating_clients);
LOG("destination container = %p\n", con);
Client *old_focused = con->currently_focused;
TAILQ_INSERT_TAIL(&(client->workspace->floating_clients), client, floating_clients);
if (client->fullscreen)
client->workspace->fullscreen_client = client;
-
}
/*
void resize_window_callback(Rect *old_rect, uint32_t new_x, uint32_t new_y) {
int32_t new_width = old_rect->width + (new_x - event->root_x);
int32_t new_height = old_rect->height + (new_y - event->root_y);
- /* Obey minimum window size */
- if (new_width < 75 || new_height < 50)
- return;
- /* Reposition the client correctly while moving */
- client->rect.width = new_width;
- client->rect.height = new_height;
+ /* Obey minimum window size and reposition the client */
+ if (new_width >= 50)
+ client->rect.width = new_width;
+
+ if (new_height >= 20)
+ client->rect.height = new_height;
/* resize_client flushes */
resize_client(conn, client);
/* motion_notify events are saved for later */
FREE(last_motion_notify);
last_motion_notify = inside_event;
-
break;
+
+ case XCB_UNMAP_NOTIFY:
+ LOG("Unmap-notify, aborting\n");
+ xcb_event_handle(&evenths, inside_event);
+ goto done;
+
default:
LOG("Passing to original handler\n");
/* Use original handler */