fix for multi-screen
This commit is contained in:
parent
366cb13e71
commit
22029cc6b4
15
editor.lua
15
editor.lua
|
@ -365,6 +365,9 @@ local function create(data)
|
|||
data.cmds[cmd_index] = ""
|
||||
|
||||
local screen = api.screen.focused()
|
||||
local screen_x = screen.geometry.x
|
||||
local screen_y = screen.geometry.y
|
||||
|
||||
local kg
|
||||
local infobox = api.wibox({
|
||||
screen = screen,
|
||||
|
@ -391,13 +394,13 @@ local function create(data)
|
|||
|
||||
for i, a in ipairs(closed_areas) do
|
||||
local sa = shrink_area_with_gap(a, gap)
|
||||
cr:rectangle(sa.x, sa.y, sa.width, sa.height)
|
||||
cr:rectangle(sa.x - screen_x, sa.y - screen_y, sa.width, sa.height)
|
||||
cr:clip()
|
||||
cr:set_source(closed_color)
|
||||
cr:rectangle(sa.x, sa.y, sa.width, sa.height)
|
||||
cr:rectangle(sa.x - screen_x, sa.y - screen_y, sa.width, sa.height)
|
||||
cr:fill()
|
||||
cr:set_source(border_color)
|
||||
cr:rectangle(sa.x, sa.y, sa.width, sa.height)
|
||||
cr:rectangle(sa.x - screen_x, sa.y - screen_y, sa.width, sa.height)
|
||||
cr:set_line_width(10.0)
|
||||
cr:stroke()
|
||||
cr:reset_clip()
|
||||
|
@ -405,18 +408,18 @@ local function create(data)
|
|||
|
||||
for i, a in ipairs(open_areas) do
|
||||
local sa = shrink_area_with_gap(a, gap)
|
||||
cr:rectangle(sa.x, sa.y, sa.width, sa.height)
|
||||
cr:rectangle(sa.x - screen_x, sa.y - screen_y, sa.width, sa.height)
|
||||
cr:clip()
|
||||
if i == #open_areas then
|
||||
cr:set_source(api.gears.color(active_color))
|
||||
else
|
||||
cr:set_source(api.gears.color(open_color))
|
||||
end
|
||||
cr:rectangle(sa.x, sa.y, sa.width, sa.height)
|
||||
cr:rectangle(sa.x - screen_x, sa.y - screen_y, sa.width, sa.height)
|
||||
cr:fill()
|
||||
|
||||
cr:set_source(border_color)
|
||||
cr:rectangle(sa.x, sa.y, sa.width, sa.height)
|
||||
cr:rectangle(sa.x - screen_x, sa.y - screen_y, sa.width, sa.height)
|
||||
cr:set_line_width(10.0)
|
||||
if i ~= #open_areas then
|
||||
cr:set_dash({5, 5}, 0)
|
||||
|
|
15
switcher.lua
15
switcher.lua
|
@ -52,6 +52,9 @@ local traverse_radius = api.dpi(5)
|
|||
|
||||
local function start(c)
|
||||
local screen = c.screen
|
||||
local screen_x = screen.geometry.x
|
||||
local screen_y = screen.geometry.y
|
||||
|
||||
local layout = api.layout.get(screen)
|
||||
if c.floating or layout.get_regions == nil then return end
|
||||
|
||||
|
@ -82,7 +85,7 @@ local function start(c)
|
|||
|
||||
local msg, ext
|
||||
for i, a in ipairs(regions) do
|
||||
cr:rectangle(a.x, a.y, a.width, a.height)
|
||||
cr:rectangle(a.x - screen_x, a.y - screen_y, a.width, a.height)
|
||||
cr:clip()
|
||||
|
||||
if i == c.machi_region and tablist ~= nil then
|
||||
|
@ -106,10 +109,10 @@ local function start(c)
|
|||
height = height + ext.height + vpadding
|
||||
end
|
||||
|
||||
local x_offset = a.x + a.width / 2
|
||||
local y_offset = a.y + a.height / 2 - height / 2 + vpadding
|
||||
local x_offset = a.x + a.width / 2 - screen_x
|
||||
local y_offset = a.y + a.height / 2 - height / 2 + vpadding - screen_y
|
||||
|
||||
cr:rectangle(a.x, y_offset - vpadding, a.width, height)
|
||||
cr:rectangle(a.x - screen_x, y_offset - vpadding - screen_y, a.width, height)
|
||||
cr:set_source(fill_color)
|
||||
cr:fill()
|
||||
|
||||
|
@ -134,14 +137,14 @@ local function start(c)
|
|||
-- cr:rectangle(a.x, a.y, a.width, a.height)
|
||||
-- cr:fill()
|
||||
cr:set_source(border_color)
|
||||
cr:rectangle(a.x, a.y, a.width, a.height)
|
||||
cr:rectangle(a.x - screen_x, a.y - screen_y, a.width, a.height)
|
||||
cr:set_line_width(10.0)
|
||||
cr:stroke()
|
||||
cr:reset_clip()
|
||||
end
|
||||
|
||||
-- show the traverse point
|
||||
cr:rectangle(traverse_x - traverse_radius, traverse_y - traverse_radius, traverse_radius * 2, traverse_radius * 2)
|
||||
cr:rectangle(traverse_x - screen_x - traverse_radius, traverse_y - screen_y - traverse_radius, traverse_radius * 2, traverse_radius * 2)
|
||||
cr:set_source_rgba(1, 1, 1, 1)
|
||||
cr:fill()
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue