summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2021-06-12 09:02:09 +0200
committerAnton Khirnov <anton@khirnov.net>2021-06-12 09:02:09 +0200
commit82ed6ed9242675313e1835b18356b2b1e91fb4b0 (patch)
tree1f958313e52974d02524034d86d121d13e307c97
parentd2779c6613a500654fb27fa47f53a3bb96b220c1 (diff)
workspace: pass the desktop to desktop:view signal
Not its index. This is more convenient to use.
-rw-r--r--rc.lua2
-rw-r--r--workspace.lua7
2 files changed, 5 insertions, 4 deletions
diff --git a/rc.lua b/rc.lua
index 4460166..011218f 100644
--- a/rc.lua
+++ b/rc.lua
@@ -103,7 +103,7 @@ for s in screen do
wsp.signals:connect_signal("desktop:view",
function(signals, view_screen, desktop)
if view_screen == s then
- pgr:set_desktop(wsp.desktops[desktop])
+ pgr:set_desktop(desktop)
end
end)
diff --git a/workspace.lua b/workspace.lua
index 1522d68..63fad94 100644
--- a/workspace.lua
+++ b/workspace.lua
@@ -113,10 +113,11 @@ function Workspace:view(screen, desktop_idx, page_idx)
self.screen_state[screen_other] = state_cur
desktop.screen_map[page_idx] = screen
- self.signals:emit_signal("desktop:view", screen, desktop_idx)
+ self.signals:emit_signal("desktop:view", screen, desktop)
if state_cur then
self.desktops[state_cur.desktop_idx].screen_map[state_cur.page_idx] = screen_other
- self.signals:emit_signal("desktop:view", screen_other, state_cur.desktop_idx)
+ self.signals:emit_signal("desktop:view", screen_other,
+ self.desktops[state_cur.desktop_idx])
end
else
-- mark previous page as free
@@ -131,7 +132,7 @@ function Workspace:view(screen, desktop_idx, page_idx)
desktop.screen_map[page_idx] = screen
self.screen_state[screen] = { page_idx = page_idx, desktop_idx = desktop_idx }
- self.signals:emit_signal("desktop:view", screen, desktop_idx)
+ self.signals:emit_signal("desktop:view", screen, desktop)
end
self:_apply_state()