summaryrefslogtreecommitdiff
path: root/sway/handlers.c
diff options
context:
space:
mode:
authorDrew DeVault <[email protected]>2017-06-14 18:53:40 -0400
committerGitHub <[email protected]>2017-06-14 18:53:40 -0400
commit298f56353ef155f6a2ccc977c96b2ff5d971e65e (patch)
treedcb3b74f1dde93bce8657b7509662ffd7db667d0 /sway/handlers.c
parenta5c07dde6aba87584ddb6c6a2769472a6003623a (diff)
parenteb6e38c86d2deb37cc6f378f8644c4a530fd7448 (diff)
Merge branch 'master' into server-decoration
Diffstat (limited to 'sway/handlers.c')
-rw-r--r--sway/handlers.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/sway/handlers.c b/sway/handlers.c
index 0aa35c26..39261e3d 100644
--- a/sway/handlers.c
+++ b/sway/handlers.c
@@ -609,6 +609,8 @@ static void handle_view_geometry_request(wlc_handle handle, const struct wlc_geo
view->y = geometry->origin.y;
update_geometry(view);
}
+ } else {
+ wlc_view_set_geometry(handle, 0, geometry);
}
}
@@ -927,6 +929,26 @@ static bool handle_pointer_button(wlc_handle view, uint32_t time, const struct w
// Update view pointer is on
pointer_state.view = container_under_pointer();
+ struct sway_mode *mode = config->current_mode;
+ // handle bindings
+ for (int i = 0; i < mode->bindings->length; ++i) {
+ struct sway_binding *binding = mode->bindings->items[i];
+ if ((modifiers->mods ^ binding->modifiers) == 0) {
+ switch (state) {
+ case WLC_BUTTON_STATE_PRESSED: {
+ if (!binding->release && handle_bindsym(binding, button, 0)) {
+ return EVENT_HANDLED;
+ }
+ }
+ case WLC_BUTTON_STATE_RELEASED:
+ if (binding->release && handle_bindsym(binding, button, 0)) {
+ return EVENT_HANDLED;
+ }
+ break;
+ }
+ }
+ }
+
// Update pointer_state
switch (button) {
case M_LEFT_CLICK: