diff --git a/ewmh.c b/ewmh.c index c58dbbd61..730edc18d 100755 --- a/ewmh.c +++ b/ewmh.c @@ -430,7 +430,13 @@ ewmh_process_client_message(xcb_client_message_event_t *ev) lua_State *L = globalconf_get_lua_State(); luaA_object_push(L, c); lua_pushstring(L, "ewmh"); + + /* Create table argument with raise=true. */ + lua_newtable(L); + lua_pushstring(L, "raise"); lua_pushboolean(L, true); + lua_settable(L, -3); + luaA_object_emit_signal(L, -3, "request::activate", 2); lua_pop(L, 1); } diff --git a/lib/awful/autofocus.lua b/lib/awful/autofocus.lua index 0e2556ff9..066c9f717 100644 --- a/lib/awful/autofocus.lua +++ b/lib/awful/autofocus.lua @@ -24,7 +24,8 @@ local function check_focus(obj) if not client.focus or not client.focus:isvisible() then local c = aclient.focus.history.get(obj.screen, 0, aclient.focus.filter) if c then - c:emit_signal("request::activate", "autofocus.check_focus", false) + c:emit_signal("request::activate", "autofocus.check_focus", + {raise=false}) end end end @@ -45,7 +46,8 @@ local function check_focus_tag(t) if client.focus and client.focus.screen ~= s then local c = aclient.focus.history.get(s, 0, aclient.focus.filter) if c then - c:emit_signal("request::activate", "autofocus.check_focus_tag", false) + c:emit_signal("request::activate", "autofocus.check_focus_tag", + {raise=false}) end end end diff --git a/lib/awful/client.lua b/lib/awful/client.lua index 7fc60a036..52eab6a7f 100644 --- a/lib/awful/client.lua +++ b/lib/awful/client.lua @@ -70,7 +70,7 @@ function client.jumpto(c, merge) end end - c:emit_signal("request::activate", "client.jumpto", true) + c:emit_signal("request::activate", "client.jumpto", {raise=true}) end --- Get the first client that got the urgent hint. @@ -212,7 +212,8 @@ function client.focus.history.previous() end local c = client.focus.history.get(s, 1) if c then - c:emit_signal("request::activate", "client.focus.history.previous", false) + c:emit_signal("request::activate", "client.focus.history.previous", + {raise=false}) end end @@ -303,7 +304,8 @@ function client.focus.bydirection(dir, c) -- If we found a client to focus, then do it. if target then - cltbl[target]:emit_signal("request::activate", "client.focus.bydirection", false) + cltbl[target]:emit_signal("request::activate", + "client.focus.bydirection", {raise=false}) end end end @@ -335,7 +337,9 @@ function client.focus.global_bydirection(dir, c) local target = util.get_rectangle_in_direction(dir, geomtbl, capi.screen[scr].geometry) if target then - cltbl[target]:emit_signal("request::activate", "client.focus.global_bydirection", false) + cltbl[target]:emit_signal("request::activate", + "client.focus.global_bydirection", + {raise=false}) end end end @@ -348,7 +352,8 @@ end function client.focus.byidx(i, c) local target = client.next(i, c) if target then - target:emit_signal("request::activate", "client.focus.byidx", true) + target:emit_signal("request::activate", "client.focus.byidx", + {raise=true}) end end @@ -396,14 +401,15 @@ function client.swap.global_bydirection(dir, c) elseif sel.screen ~= c.screen and sel == c then client.movetoscreen(sel, capi.mouse.screen) - --swapping to a nonempty screen + -- swapping to a nonempty screen elseif sel.screen ~= c.screen and sel ~= c then client.movetoscreen(sel, c.screen) client.movetoscreen(c, scr) end screen.focus(sel.screen) - sel:emit_signal("request::activate", "client.swap.global_bydirection", false) + sel:emit_signal("request::activate", "client.swap.global_bydirection", + {raise=false}) end end diff --git a/lib/awful/ewmh.lua b/lib/awful/ewmh.lua index da05fc5d5..d00e07c7c 100644 --- a/lib/awful/ewmh.lua +++ b/lib/awful/ewmh.lua @@ -157,8 +157,9 @@ end -- -- @client c A client to use -- @tparam string context The context where this signal was used. --- @tparam boolean raise Should the client be raised? -function ewmh.activate(c, context, raise) +-- @tparam table hints A table with additional hints: +-- @tparam boolean hints.raise should the client be raised? (default false) +function ewmh.activate(c, context, hints) client.focus = c if raise then if awesome.startup or c:isvisible() then diff --git a/lib/awful/layout/init.lua b/lib/awful/layout/init.lua index 924a40989..97b94a741 100755 --- a/lib/awful/layout/init.lua +++ b/lib/awful/layout/init.lua @@ -179,7 +179,8 @@ local function arrange_on_tagged(c, tag) if not capi.client.focus or not capi.client.focus:isvisible() then local c = client.focus.history.get(tag.screen, 0) if c then - c:emit_signal("request::activate", "layout.arrange_on_tagged", false) + c:emit_signal("request::activate", "layout.arrange_on_tagged", + {raise=false}) end end end diff --git a/lib/awful/menu.lua b/lib/awful/menu.lua index 5aca0cb31..ab8d73ece 100644 --- a/lib/awful/menu.lua +++ b/lib/awful/menu.lua @@ -476,7 +476,7 @@ function menu.clients(args, item_args) if not c:isvisible() then tags.viewmore(c:tags(), c.screen) end - c:emit_signal("request::activate", "menu.clients", true) + c:emit_signal("request::activate", "menu.clients", {raise=true}) end, c.icon } if item_args then diff --git a/lib/awful/rules.lua b/lib/awful/rules.lua index d87f20e93..cba2644ef 100644 --- a/lib/awful/rules.lua +++ b/lib/awful/rules.lua @@ -217,7 +217,7 @@ function rules.execute(c, props, callbacks) -- Do this at last so we do not erase things done by the focus -- signal. if props.focus and (type(props.focus) ~= "function" or props.focus(c)) then - c:emit_signal('request::activate', "rules", false) + c:emit_signal('request::activate', "rules", {raise=false}) end end diff --git a/lib/awful/screen.lua b/lib/awful/screen.lua index d19bc3dac..58f1cc4ec 100644 --- a/lib/awful/screen.lua +++ b/lib/awful/screen.lua @@ -67,7 +67,7 @@ function screen.focus(_screen) local c = client.focus.history.get(_screen, 0) if c then - c:emit_signal("request::activate", "screen.focus", false) + c:emit_signal("request::activate", "screen.focus", {raise=false}) end end