1

In Awesome 3.5.6, I have configured modkey + mouse wheel forward/backward to raise and lower the focused window, as follows:

clientbuttons = awful.util.table.join(
  awful.button({ }, 1, function (c) client.focus = c; c:raise() end),
  awful.button({ modkey }, 1, awful.mouse.client.move),
  awful.button({ modkey }, 3, awful.mouse.client.resize),
  awful.button({ modkey }, 4, function(c) c:raise() end),
  awful.button({ modkey }, 5, function(c) c:lower() end))

-- ...

awful.rules.rules = {
  -- All clients will match this rule.
  { rule = { },
    properties = { border_width = beautiful.border_width,
                   border_color = beautiful.border_normal,
                   focus = awful.client.focus.filter,
                   raise = true,
                   keys = clientkeys,
                   buttons = clientbuttons } },
  -- ...

This is working fine, but the problem is that the mod+button4 event is propagating through to the client. E.g. in the case of Chrome, the browser window scrolls after being raised or lowered.

My question: how can I get Awesome to consume the mouse event and not propagate it to the client? I tried returning "true" or "false" from the function(c) (as event-swallowing in indicated in some other contexts), but no luck.

Robert Fleming
  • 1,337
  • 17
  • 13

1 Answers1

0

There is both a press and release callback. If both are set, then the events should not be propagated. If they still are, test with 4.0. If it still doesn't solve the problem, report a bug.

https://awesomewm.org/apidoc/classes/awful.button.html

  • 1
    No luck in 3.5.6 adding the `release` callback (which I wrote as `function(c) end`). I'll try upgrading to 4.0 next, but it seems to me that ideally the choice of whether to implement a `release` callback would be orthogonal to the choice of whether the event should propagate to the client. E.g. the default behavior of unmodified button-1 click: (1) focus, (2) raise, and (3) propagate to client. It would be great if there were a way for the callback itself to signal whether the event has been "consumed" (e.g. by its return value, or by modifying the event object). – Robert Fleming Jan 21 '17 at 07:12
  • Filed as [issue 1447](https://github.com/awesomeWM/awesome/issues/1447). – Robert Fleming Jan 24 '17 at 00:01