all repos — tint2 @ 5966b198b65cebde6ae72d30ba499d204b54c46b

fork of the tint2 desktop panel for my custom setup - only minimized windows across all desktops for the taskbar

Executor: send click coordinates via environment variables
o9000 mrovi9000@gmail.com
commit

5966b198b65cebde6ae72d30ba499d204b54c46b

parent

8af45bf3e6389a087ecf7df5b086b94d728e0248

3 files changed, 14 insertions(+), 4 deletions(-)

jump to
M src/execplugin/execplugin.csrc/execplugin/execplugin.c

@@ -428,7 +428,7 @@

g_object_unref(layout); } -void execp_action(void *obj, int button) +void execp_action(void *obj, int button, int x, int y) { Execp *execp = obj; char *command = NULL;

@@ -450,7 +450,17 @@ command = execp->backend->dwheel_command;

break; } if (command) { - tint_exec(command); + char *full_cmd = g_strdup_printf("export EXECP_X=%d;" + "export EXECP_Y=%d;" + "export EXECP_W=%d;" + "export EXECP_H=%d; %s", + x, + y, + execp->area.width, + execp->area.height, + command); + tint_exec(full_cmd); + g_free(full_cmd); } else { if (execp->backend->child_pipe > 0) { // Command currently running, nothing to do
M src/execplugin/execplugin.hsrc/execplugin/execplugin.h

@@ -130,7 +130,7 @@ // Returns 1 if the new size is different than the previous size.

gboolean resize_execp(void *obj); // Called on mouse click event. -void execp_action(void *obj, int button); +void execp_action(void *obj, int button, int x, int y); // Called to check if new output from the command can be read. // No command might be running.
M src/tint.csrc/tint.c

@@ -808,7 +808,7 @@ #endif

Execp *execp = click_execp(panel, e->xbutton.x, e->xbutton.y); if (execp) { - execp_action(execp, e->xbutton.button); + execp_action(execp, e->xbutton.button, e->xbutton.x - execp->area.posx, e->xbutton.y - execp->area.posy); if (panel_layer == BOTTOM_LAYER) XLowerWindow(server.display, panel->main_win); task_drag = 0;