aboutsummaryrefslogtreecommitdiff
path: root/include/sway
diff options
context:
space:
mode:
authorMichael Weiser <michael.weiser@gmx.de>2020-03-12 22:10:04 +0100
committerBrian Ashworth <bosrsf04@gmail.com>2020-05-13 21:22:16 -0400
commit0f11aa037ad8765abf66e0c90052f9e4c37d56db (patch)
treee78523c566a1a96d53098bfc7c1d1f104043d373 /include/sway
parent2473cac32c9a062ddaee9d5495a72317bdd1f9ff (diff)
commands: Add per-view shortcuts_inhibitor command
Add a separate per-view shortcuts_inhibitor command that can be used with criteria to override the per-seat defaults. This allows to e.g. disable shortcuts inhibiting globally but enable it for specific, known-good virtualization and remote desktop software or, alternatively, to blacklist that one slightly broken piece of software that just doesn't seem to get it right but insists on trying. Add a flag to sway_view and handling logic in the input manager that respects that flag if configured but falls back to per-seat config otherwise. Add the actual command but with just enable and disable subcommands since there's no value in duplicating the per-seat activate/deactivate/toggle logic here. Split the inhibitor retrieval helper in two so we can use the backend half in the command to retrieve inhibitors for a specific surface and not just the currently focused one. Extend the manual page with documentation of the command and references to its per-seat sibling and usefulness with criteria. Signed-off-by: Michael Weiser <michael.weiser@gmx.de>
Diffstat (limited to 'include/sway')
-rw-r--r--include/sway/commands.h1
-rw-r--r--include/sway/input/seat.h8
-rw-r--r--include/sway/tree/view.h2
3 files changed, 11 insertions, 0 deletions
diff --git a/include/sway/commands.h b/include/sway/commands.h
index 3fde0893..4a2f8c20 100644
--- a/include/sway/commands.h
+++ b/include/sway/commands.h
@@ -164,6 +164,7 @@ sway_cmd cmd_resize;
sway_cmd cmd_scratchpad;
sway_cmd cmd_seamless_mouse;
sway_cmd cmd_set;
+sway_cmd cmd_shortcuts_inhibitor;
sway_cmd cmd_show_marks;
sway_cmd cmd_smart_borders;
sway_cmd cmd_smart_gaps;
diff --git a/include/sway/input/seat.h b/include/sway/input/seat.h
index fa232aa2..6a46fa91 100644
--- a/include/sway/input/seat.h
+++ b/include/sway/input/seat.h
@@ -295,6 +295,14 @@ void seatop_render(struct sway_seat *seat, struct sway_output *output,
bool seatop_allows_set_cursor(struct sway_seat *seat);
/**
+ * Returns the keyboard shortcuts inhibitor that applies to the given surface
+ * or NULL if none exists.
+ */
+struct sway_keyboard_shortcuts_inhibitor *
+keyboard_shortcuts_inhibitor_get_for_surface(const struct sway_seat *seat,
+ const struct wlr_surface *surface);
+
+/**
* Returns the keyboard shortcuts inhibitor that applies to the currently
* focused surface of a seat or NULL if none exists.
*/
diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h
index 4d3532d2..9230f456 100644
--- a/include/sway/tree/view.h
+++ b/include/sway/tree/view.h
@@ -110,6 +110,8 @@ struct sway_view {
struct wl_listener surface_new_subsurface;
int max_render_time; // In milliseconds
+
+ enum seat_config_shortcuts_inhibit shortcuts_inhibit;
};
struct sway_xdg_shell_view {