2 #define I3__FILE__ "scratchpad.c"
22 if (con->
type == CT_WORKSPACE) {
23 LOG(
"'move scratchpad' used on a workspace \"%s\". Calling it "
24 "recursively on all windows on this workspace.\n", con->
name);
34 DLOG(
"should move con %p to __i3_scratch\n", con);
38 DLOG(
"This window is already on __i3_scratch.\n");
47 if (maybe_floating_con == NULL) {
51 con = maybe_floating_con;
62 DLOG(
"This window was never used as a scratchpad before.\n");
77 DLOG(
"should show scratchpad window %p\n", con);
87 if (fs->
type != CT_WORKSPACE) {
95 TAILQ_FOREACH(walk_con, &(focused_ws->floating_head), floating_windows) {
99 DLOG(
"Found an unfocused scratchpad window on this workspace\n");
100 DLOG(
"Focusing it: %p\n", walk_con);
119 DLOG(
"Found a visible scratchpad window on another workspace,\n");
120 DLOG(
"moving it to this workspace: con = %p\n", walk_con);
132 DLOG(
"Focused window is a scratchpad window, hiding it.\n");
144 current != __i3_scratch) {
147 if (current == active) {
148 DLOG(
"Window is a scratchpad window, hiding it.\n");
161 LOG(
"You don't have any scratchpad windows yet.\n");
162 LOG(
"Use 'move scratchpad' to move a window to the scratchpad.\n");
172 DLOG(
"Adjusting size of this window.\n");
185 if (current != active) {
197 static int _gcd(
const int m,
const int n) {
200 return _gcd(n, (m % n));
214 static int _lcm(
const int m,
const int n) {
215 const int o =
_gcd(m, n);
216 return ((m * n) / o);
230 DLOG(
"Current resolution: (%d, %d) %d x %d\n",
237 if (output == __i3_output)
239 DLOG(
"output %s's resolution: (%d, %d) %d x %d\n",
242 if (new_width == -1) {
253 DLOG(
"new width = %d, new height = %d\n",
254 new_width, new_height);
260 if (memcmp(&old_rect, &new_rect,
sizeof(
Rect)) == 0) {
261 DLOG(
"Scratchpad size unchanged.\n");
265 DLOG(
"Fixing coordinates of scratchpad windows\n");
267 TAILQ_FOREACH(con, &(__i3_scratch->floating_head), floating_windows) {