commit
39aace50e9
|
@ -27,7 +27,7 @@ local function screen_change(window)
|
|||
if data[window][reqtype] then
|
||||
if data[window][reqtype].width then
|
||||
data[window][reqtype].width = math.min(data[window][reqtype].width,
|
||||
screen[window.screen].workarea.width)
|
||||
window.screen.workarea.width)
|
||||
if reqtype == "maximized_horizontal" then
|
||||
local bw = window.border_width or 0
|
||||
data[window][reqtype].width = data[window][reqtype].width - 2*bw
|
||||
|
@ -35,7 +35,7 @@ local function screen_change(window)
|
|||
end
|
||||
if data[window][reqtype].height then
|
||||
data[window][reqtype].height = math.min(data[window][reqtype].height,
|
||||
screen[window.screen].workarea.height)
|
||||
window.screen.workarea.height)
|
||||
if reqtype == "maximized_vertical" then
|
||||
local bw = window.border_width or 0
|
||||
data[window][reqtype].height = data[window][reqtype].height - 2*bw
|
||||
|
@ -43,7 +43,7 @@ local function screen_change(window)
|
|||
end
|
||||
if data[window][reqtype].screen then
|
||||
local from = screen[data[window][reqtype].screen].workarea
|
||||
local to = screen[window.screen].workarea
|
||||
local to = window.screen.workarea
|
||||
local new_x, new_y
|
||||
if data[window][reqtype].x then
|
||||
new_x = to.x + data[window][reqtype].x - from.x
|
||||
|
@ -80,7 +80,7 @@ local function geometry_change(window)
|
|||
|
||||
-- Fix up the geometry in case this window needs to cover the whole screen.
|
||||
local bw = window.border_width or 0
|
||||
local g = screen[window.screen].workarea
|
||||
local g = window.screen.workarea
|
||||
if window.maximized_vertical then
|
||||
window:geometry { height = g.height - 2*bw, y = g.y }
|
||||
end
|
||||
|
@ -89,7 +89,7 @@ local function geometry_change(window)
|
|||
end
|
||||
if window.fullscreen then
|
||||
window.border_width = 0
|
||||
window:geometry(screen[window.screen].geometry)
|
||||
window:geometry(window.screen.geometry)
|
||||
end
|
||||
|
||||
geometry_change_lock = false
|
||||
|
@ -128,7 +128,7 @@ local function get_valid_tags(c, s)
|
|||
local tags, new_tags = c:tags(), {}
|
||||
|
||||
for _, t in ipairs(tags) do
|
||||
if screen[s] == t.screen then
|
||||
if s == t.screen then
|
||||
table.insert(new_tags, t)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -201,8 +201,14 @@ local function group_label(group, color)
|
|||
return margin
|
||||
end
|
||||
|
||||
local function get_screen(s)
|
||||
return s and capi.screen[s]
|
||||
end
|
||||
|
||||
local function create_wibox(s, available_groups)
|
||||
local wa = capi.screen[s].workarea
|
||||
s = get_screen(s)
|
||||
|
||||
local wa = s.workarea
|
||||
local height = (widget.height < wa.height) and widget.height or
|
||||
(wa.height - widget.border_width * 2)
|
||||
local width = (widget.width < wa.width) and widget.width or
|
||||
|
|
|
@ -23,7 +23,7 @@ local magnifier = {}
|
|||
function magnifier.mouse_resize_handler(c, corner, x, y)
|
||||
capi.mouse.coords({ x = x, y = y })
|
||||
|
||||
local wa = capi.screen[c.screen].workarea
|
||||
local wa = c.screen.workarea
|
||||
local center_x = wa.x + wa.width / 2
|
||||
local center_y = wa.y + wa.height / 2
|
||||
local maxdist_pow = (wa.width^2 + wa.height^2) / 4
|
||||
|
|
|
@ -28,7 +28,7 @@ tile.resize_jump_to_corner = true
|
|||
|
||||
local function mouse_resize_handler(c, _, _, _, orientation)
|
||||
orientation = orientation or "tile"
|
||||
local wa = capi.screen[c.screen].workarea
|
||||
local wa = c.screen.workarea
|
||||
local mwfact = c.screen.selected_tag.master_width_factor
|
||||
local cursor
|
||||
local g = c:geometry()
|
||||
|
|
|
@ -22,7 +22,7 @@ function module.drag_to_tag(c)
|
|||
|
||||
local dir = nil
|
||||
|
||||
local wa = capi.screen[c.screen].workarea
|
||||
local wa = c.screen.workarea
|
||||
|
||||
if coords.x >= wa.x + wa.width - 1 then
|
||||
capi.mouse.coords({ x = wa.x + 2 }, true)
|
||||
|
|
|
@ -203,8 +203,8 @@ function module.snap(c, snap, x, y, fixed_x, fixed_y)
|
|||
geom.x = x or geom.x
|
||||
geom.y = y or geom.y
|
||||
|
||||
geom, edge = snap_inside(geom, capi.screen[c.screen].geometry, snap)
|
||||
geom = snap_inside(geom, capi.screen[c.screen].workarea, snap)
|
||||
geom, edge = snap_inside(geom, c.screen.geometry, snap)
|
||||
geom = snap_inside(geom, c.screen.workarea, snap)
|
||||
|
||||
-- Allow certain windows to snap to the edge of the workarea.
|
||||
-- Only allow docking to workarea for consistency/to avoid problems.
|
||||
|
|
|
@ -135,7 +135,7 @@ function screen.focus_bydirection(dir, _screen)
|
|||
if sel then
|
||||
local geomtbl = {}
|
||||
for s in capi.screen do
|
||||
geomtbl[s] = capi.screen[s].geometry
|
||||
geomtbl[s] = s.geometry
|
||||
end
|
||||
local target = grect.get_in_direction(dir, geomtbl, sel.geometry)
|
||||
if target then
|
||||
|
|
|
@ -21,6 +21,10 @@ end
|
|||
-- Information about a pending wallpaper change, see prepare_context()
|
||||
local pending_wallpaper = nil
|
||||
|
||||
local function get_screen(s)
|
||||
return s and screen[s]
|
||||
end
|
||||
|
||||
--- Prepare the needed state for setting a wallpaper.
|
||||
-- This function returns a cairo context through which a wallpaper can be drawn.
|
||||
-- The context is only valid for a short time and should not be saved in a
|
||||
|
@ -29,8 +33,10 @@ local pending_wallpaper = nil
|
|||
-- @return[1] The available geometry (table with entries width and height)
|
||||
-- @return[1] A cairo context that the wallpaper should be drawn to
|
||||
function wallpaper.prepare_context(s)
|
||||
s = get_screen(s)
|
||||
|
||||
local root_width, root_height = root.size()
|
||||
local geom = s and screen[s].geometry or root_geometry()
|
||||
local geom = s and s.geometry or root_geometry()
|
||||
local source, target, cr
|
||||
|
||||
if not pending_wallpaper then
|
||||
|
|
|
@ -415,7 +415,7 @@ function menubar.show(scr)
|
|||
-- Set position and size
|
||||
scr = scr or awful.screen.focused() or 1
|
||||
scr = get_screen(scr)
|
||||
local scrgeom = capi.screen[scr].workarea
|
||||
local scrgeom = scr.workarea
|
||||
local geometry = menubar.geometry
|
||||
instance.geometry = {x = geometry.x or scrgeom.x,
|
||||
y = geometry.y or scrgeom.y,
|
||||
|
|
Loading…
Reference in New Issue