mirror of
https://github.com/gwenhael-le-moine/sway-patched-tray-menu.git
synced 2024-12-27 21:58:16 +01:00
c2ed3d8bd6
The directive sets the timeout before an urgent view becomes normal again after switching to it from another workspace. Also: * When an xwayland surface removes the urgent hint while the timer is active, we now ignore the request. This happens as soon as the view receives focus, so it was effectively making the timer pointless. * The timeout is now only applied when switching to it from another workspace.
28 lines
760 B
C
28 lines
760 B
C
#include "log.h"
|
|
#include "sway/commands.h"
|
|
#include "sway/config.h"
|
|
#include "sway/tree/arrange.h"
|
|
#include "sway/tree/container.h"
|
|
#include "sway/tree/view.h"
|
|
#include "sway/tree/layout.h"
|
|
|
|
struct cmd_results *cmd_force_display_urgency_hint(int argc, char **argv) {
|
|
struct cmd_results *error = NULL;
|
|
if ((error = checkarg(argc, "force_display_urgency_hint",
|
|
EXPECTED_AT_LEAST, 1))) {
|
|
return error;
|
|
}
|
|
|
|
char *err;
|
|
int timeout = (int)strtol(argv[0], &err, 10);
|
|
if (*err) {
|
|
if (strcmp(err, "ms") != 0) {
|
|
return cmd_results_new(CMD_INVALID, "force_display_urgency_hint",
|
|
"Expected 'force_display_urgency_hint <timeout> ms'");
|
|
}
|
|
}
|
|
|
|
config->urgent_timeout = timeout > 0 ? timeout : 0;
|
|
|
|
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
|
|
}
|