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;
63 DLOG(
"This window was never used as a scratchpad before.\n");
83 DLOG(
"should show scratchpad window %p\n", con);
93 if (fs->
type != CT_WORKSPACE) {
103 DLOG(
"Focused window is a scratchpad window, hiding it.\n");
115 current != __i3_scratch) {
118 if (current == active) {
119 DLOG(
"Window is a scratchpad window, hiding it.\n");
132 LOG(
"You don't have any scratchpad windows yet.\n");
133 LOG(
"Use 'move scratchpad' to move a window to the scratchpad.\n");
143 DLOG(
"Adjusting size of this window.\n");
156 if (current != active) {
168 static int _gcd(
const int m,
const int n) {
171 return _gcd(n, (m % n));
185 static int _lcm(
const int m,
const int n) {
186 const int o =
_gcd(m, n);
187 return ((m * n) / o);
201 DLOG(
"Current resolution: (%d, %d) %d x %d\n",
208 if (output == __i3_output)
210 DLOG(
"output %s's resolution: (%d, %d) %d x %d\n",
213 if (new_width == -1) {
221 DLOG(
"new width = %d, new height = %d\n",
222 new_width, new_height);