diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 8fdcebd712..caae325863 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -80,6 +80,7 @@ scrouthtv Sebastien Waegeneire Stefan Radziuk Subhaditya Nath +Suyooo Tasos Sahanidis Thiago Kenji Okada Tilman Sauerbeck diff --git a/data/animation_presets.conf b/data/animation_presets.conf index b2dc536f5a..3e099743b1 100644 --- a/data/animation_presets.conf +++ b/data/animation_presets.conf @@ -118,7 +118,7 @@ fly-out = { curve = "cubic-bezier(0.05, 0, 0.69, -0.05)"; duration = "placeholder0"; start = 0; - end = "(window-height + window-y) * placeholder2 + (window-width + window-x) * placeholder1"; + end = "window-height * placeholder2 + window-y * placeholder5 + window-width * placeholder1 + window-x * placeholder4"; }; offset-x = "v-timing * placeholder3"; offset-y = "v-timing * (1 - placeholder3)"; @@ -133,9 +133,11 @@ fly-out = { }; *placeholders = ( (0, "duration"), - (1, "direction", [0, 0, -1, 1]), - (2, "direction", [-1, 1, 0, 0]), - (3, "direction", [0, 0, 1, 1]), + (1, "direction", [0, 0, -1, 1]), # left/right -> +1/-1 for X axis + (2, "direction", [-1, 1, 0, 0]), # up/down -> +1/-1 for Y axis + (3, "direction", [0, 0, 1, 1]), # X/Y axis switch + (4, "direction", [0, 0, -1, 0]), # whether window X is added + (5, "direction", [-1, 0, 0, 0]), # whether window Y is added ); }; fly-in = { @@ -143,7 +145,7 @@ fly-in = { curve = "cubic-bezier(0.17, 0.67, 0.68, 1.03)"; end = 0; duration = "placeholder0"; - start = "- window-height - window-y"; + start = "window-height * placeholder2 + window-y * placeholder5 + window-width * placeholder1 + window-x * placeholder4"; }; offset-x = "v-timing * placeholder3"; offset-y = "v-timing * (1 - placeholder3)"; @@ -158,9 +160,11 @@ fly-in = { }; *placeholders = ( (0, "duration"), - (1, "direction", [0, 0, -1, 1]), - (2, "direction", [-1, 1, 0, 0]), - (3, "direction", [0, 0, 1, 1]), + (1, "direction", [0, 0, -1, 1]), # left/right -> +1/-1 for X axis + (2, "direction", [-1, 1, 0, 0]), # up/down -> +1/-1 for Y axis + (3, "direction", [0, 0, 1, 1]), # X/Y axis switch + (4, "direction", [0, 0, -1, 0]), # whether window X is added + (5, "direction", [-1, 0, 0, 0]), # whether window Y is added ); }; geometry-change = { diff --git a/src/picom.c b/src/picom.c index 8e52a4d9d4..64fdb3dd1e 100644 --- a/src/picom.c +++ b/src/picom.c @@ -1415,7 +1415,8 @@ static void unredirect(session_t *ps) { xcb_composite_unredirect_subwindows(ps->c.c, ps->c.screen_info->root, session_redirection_mode(ps)); // Unmap overlay window - if (ps->overlay != XCB_NONE) { + if (ps->overlay != XCB_NONE && + session_redirection_mode(ps) == XCB_COMPOSITE_REDIRECT_MANUAL) { xcb_unmap_window(ps->c.c, ps->overlay); } @@ -2559,6 +2560,21 @@ static session_t *session_init(int argc, char **argv, Display *dpy, // We are here if we don't really function as a compositor, so we are not // taking over the screen, and we don't need to register as a compositor + // We still need to know what the overlay window is, so we won't be + // confused when we get events for the overlay window. Since + // CompositeGetOverlayWindow also maps the overlay, we need to immediately + // release it. + auto get_overlay = + xcb_composite_get_overlay_window(ps->c.c, ps->c.screen_info->root); + XCB_AWAIT_VOID(xcb_composite_release_overlay_window, ps->c.c, + ps->c.screen_info->root); + auto overlay_reply = + xcb_composite_get_overlay_window_reply(ps->c.c, get_overlay, NULL); + if (overlay_reply) { + ps->overlay = overlay_reply->overlay_win; + free(overlay_reply); + } + // If we are in debug mode, we need to create a window for rendering if // the backend supports presenting. @@ -2674,7 +2690,7 @@ static void session_destroy(session_t *ps) { #endif // Release overlay window - if (ps->overlay) { + if (ps->overlay && session_redirection_mode(ps) == XCB_COMPOSITE_REDIRECT_MANUAL) { xcb_composite_release_overlay_window(ps->c.c, ps->overlay); ps->overlay = XCB_NONE; } diff --git a/src/transition/generated/script_templates.c b/src/transition/generated/script_templates.c index 8be7063774..2a34f39377 100644 --- a/src/transition/generated/script_templates.c +++ b/src/transition/generated/script_templates.c @@ -909,23 +909,27 @@ static struct script *script_template__fly_out(int *output_slots) { {.type = INST_STORE, .slot = 3}, {.type = INST_LOAD, .slot = 2}, {.type = INST_STORE, .slot = 4}, - {.type = INST_BRANCH_ONCE, .rel = 25}, + {.type = INST_BRANCH_ONCE, .rel = 29}, {.type = INST_HALT}, {.type = INST_IMM, .imm = 0x0p+0}, {.type = INST_STORE_OVER_NAN, .slot = 10}, {.type = INST_LOAD_CTX, .ctx = 1073741824}, {.type = INST_STORE, .slot = 12}, {.type = INST_LOAD_CTX, .ctx = 24}, - {.type = INST_LOAD_CTX, .ctx = 8}, - {.type = INST_OP, .op = OP_ADD}, {.type = INST_LOAD_CTX, .ctx = 1073741832}, {.type = INST_OP, .op = OP_MUL}, - {.type = INST_LOAD_CTX, .ctx = 16}, - {.type = INST_LOAD_CTX, .ctx = 0}, + {.type = INST_LOAD_CTX, .ctx = 8}, + {.type = INST_LOAD_CTX, .ctx = 1073741844}, + {.type = INST_OP, .op = OP_MUL}, {.type = INST_OP, .op = OP_ADD}, + {.type = INST_LOAD_CTX, .ctx = 16}, {.type = INST_LOAD_CTX, .ctx = 1073741828}, {.type = INST_OP, .op = OP_MUL}, {.type = INST_OP, .op = OP_ADD}, + {.type = INST_LOAD_CTX, .ctx = 0}, + {.type = INST_LOAD_CTX, .ctx = 1073741840}, + {.type = INST_OP, .op = OP_MUL}, + {.type = INST_OP, .op = OP_ADD}, {.type = INST_STORE, .slot = 11}, {.type = INST_IMM, .imm = 0x1p+0}, {.type = INST_STORE, .slot = 5}, @@ -933,7 +937,7 @@ static struct script *script_template__fly_out(int *output_slots) { {.type = INST_STORE, .slot = 6}, {.type = INST_IMM, .imm = 0x1p+0}, {.type = INST_STORE, .slot = 7}, - {.type = INST_BRANCH, .rel = -51}, + {.type = INST_BRANCH, .rel = -55}, {.type = INST_IMM, .imm = 0x0p+0}, {.type = INST_STORE, .slot = 9}, {.type = INST_LOAD, .slot = 12}, @@ -1033,22 +1037,32 @@ static bool win_script_preset__fly_out(struct win_script *output, config_setting double placeholder1_direction; double placeholder2_direction; double placeholder3_direction; + double placeholder4_direction; + double placeholder5_direction; if (strcmp(knob_direction, "up") == 0) { placeholder1_direction = 0x0p+0; placeholder2_direction = -0x1p+0; placeholder3_direction = 0x0p+0; + placeholder4_direction = 0x0p+0; + placeholder5_direction = -0x1p+0; } else if (strcmp(knob_direction, "down") == 0) { placeholder1_direction = 0x0p+0; placeholder2_direction = 0x1p+0; placeholder3_direction = 0x0p+0; + placeholder4_direction = 0x0p+0; + placeholder5_direction = 0x0p+0; } else if (strcmp(knob_direction, "left") == 0) { placeholder1_direction = -0x1p+0; placeholder2_direction = 0x0p+0; placeholder3_direction = 0x1p+0; + placeholder4_direction = -0x1p+0; + placeholder5_direction = 0x0p+0; } else if (strcmp(knob_direction, "right") == 0) { placeholder1_direction = 0x1p+0; placeholder2_direction = 0x0p+0; placeholder3_direction = 0x1p+0; + placeholder4_direction = 0x0p+0; + placeholder5_direction = 0x0p+0; } else { log_error("Invalid choice \"%s\" for option \"direction\". Line %d.", knob_direction, @@ -1064,6 +1078,8 @@ static bool win_script_preset__fly_out(struct win_script *output, config_setting {.offset = SCRIPT_CTX_PLACEHOLDER_BASE + 4, .value = placeholder1_direction}, {.offset = SCRIPT_CTX_PLACEHOLDER_BASE + 8, .value = placeholder2_direction}, {.offset = SCRIPT_CTX_PLACEHOLDER_BASE + 12, .value = placeholder3_direction}, + {.offset = SCRIPT_CTX_PLACEHOLDER_BASE + 16, .value = placeholder4_direction}, + {.offset = SCRIPT_CTX_PLACEHOLDER_BASE + 20, .value = placeholder5_direction}, }; script_specialize(output->script, spec, ARR_SIZE(spec)); return true; @@ -1107,12 +1123,23 @@ static struct script *script_template__fly_in(int *output_slots) { {.type = INST_STORE, .slot = 3}, {.type = INST_LOAD, .slot = 2}, {.type = INST_STORE, .slot = 4}, - {.type = INST_BRANCH_ONCE, .rel = 16}, + {.type = INST_BRANCH_ONCE, .rel = 27}, {.type = INST_HALT}, {.type = INST_LOAD_CTX, .ctx = 24}, - {.type = INST_OP, .op = OP_NEG}, + {.type = INST_LOAD_CTX, .ctx = 1073741832}, + {.type = INST_OP, .op = OP_MUL}, {.type = INST_LOAD_CTX, .ctx = 8}, - {.type = INST_OP, .op = OP_SUB}, + {.type = INST_LOAD_CTX, .ctx = 1073741844}, + {.type = INST_OP, .op = OP_MUL}, + {.type = INST_OP, .op = OP_ADD}, + {.type = INST_LOAD_CTX, .ctx = 16}, + {.type = INST_LOAD_CTX, .ctx = 1073741828}, + {.type = INST_OP, .op = OP_MUL}, + {.type = INST_OP, .op = OP_ADD}, + {.type = INST_LOAD_CTX, .ctx = 0}, + {.type = INST_LOAD_CTX, .ctx = 1073741840}, + {.type = INST_OP, .op = OP_MUL}, + {.type = INST_OP, .op = OP_ADD}, {.type = INST_STORE_OVER_NAN, .slot = 10}, {.type = INST_LOAD_CTX, .ctx = 1073741824}, {.type = INST_STORE, .slot = 11}, @@ -1122,7 +1149,7 @@ static struct script *script_template__fly_in(int *output_slots) { {.type = INST_STORE, .slot = 6}, {.type = INST_IMM, .imm = 0x1p+0}, {.type = INST_STORE, .slot = 7}, - {.type = INST_BRANCH, .rel = -42}, + {.type = INST_BRANCH, .rel = -53}, {.type = INST_IMM, .imm = 0x0p+0}, {.type = INST_STORE, .slot = 9}, {.type = INST_LOAD, .slot = 11}, @@ -1222,22 +1249,32 @@ static bool win_script_preset__fly_in(struct win_script *output, config_setting_ double placeholder1_direction; double placeholder2_direction; double placeholder3_direction; + double placeholder4_direction; + double placeholder5_direction; if (strcmp(knob_direction, "up") == 0) { placeholder1_direction = 0x0p+0; placeholder2_direction = -0x1p+0; placeholder3_direction = 0x0p+0; + placeholder4_direction = 0x0p+0; + placeholder5_direction = -0x1p+0; } else if (strcmp(knob_direction, "down") == 0) { placeholder1_direction = 0x0p+0; placeholder2_direction = 0x1p+0; placeholder3_direction = 0x0p+0; + placeholder4_direction = 0x0p+0; + placeholder5_direction = 0x0p+0; } else if (strcmp(knob_direction, "left") == 0) { placeholder1_direction = -0x1p+0; placeholder2_direction = 0x0p+0; placeholder3_direction = 0x1p+0; + placeholder4_direction = -0x1p+0; + placeholder5_direction = 0x0p+0; } else if (strcmp(knob_direction, "right") == 0) { placeholder1_direction = 0x1p+0; placeholder2_direction = 0x0p+0; placeholder3_direction = 0x1p+0; + placeholder4_direction = 0x0p+0; + placeholder5_direction = 0x0p+0; } else { log_error("Invalid choice \"%s\" for option \"direction\". Line %d.", knob_direction, @@ -1253,6 +1290,8 @@ static bool win_script_preset__fly_in(struct win_script *output, config_setting_ {.offset = SCRIPT_CTX_PLACEHOLDER_BASE + 4, .value = placeholder1_direction}, {.offset = SCRIPT_CTX_PLACEHOLDER_BASE + 8, .value = placeholder2_direction}, {.offset = SCRIPT_CTX_PLACEHOLDER_BASE + 12, .value = placeholder3_direction}, + {.offset = SCRIPT_CTX_PLACEHOLDER_BASE + 16, .value = placeholder4_direction}, + {.offset = SCRIPT_CTX_PLACEHOLDER_BASE + 20, .value = placeholder5_direction}, }; script_specialize(output->script, spec, ARR_SIZE(spec)); return true;