Merge pull request #706 from psychon/maximized-workarea-changed

Maximized workarea changed
This commit is contained in:
Daniel Hahler 2016-02-28 22:09:51 +01:00
commit b84f214144
6 changed files with 22 additions and 48 deletions

View File

@ -202,6 +202,11 @@ client.connect_signal("request::fullscreen", fullscreen)
client.connect_signal("property::screen", screen_change)
client.connect_signal("property::border_width", geometry_change)
client.connect_signal("property::geometry", geometry_change)
screen.connect_signal("property::workarea", function(s)
for _, c in pairs(client.get(s)) do
geometry_change(c)
end
end)
return ewmh

View File

@ -74,7 +74,13 @@ function xresources.get_dpi(s)
return dpi_per_screen[s]
end
if not xresources.dpi then
xresources.dpi = tonumber(awesome.xrdb_get_value("", "Xft.dpi") or 96)
-- Might not be present when run under unit tests
if awesome and awesome.xrdb_get_value then
xresources.dpi = tonumber(awesome.xrdb_get_value("", "Xft.dpi"))
end
if not xresources.dpi then
xresources.dpi = 96
end
end
return xresources.dpi
end

View File

@ -12,7 +12,7 @@
-- http://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-0.12.html
local beautiful = require("beautiful")
local awful = require("awful")
local awful_util = require("awful.util")
local GLib = require("lgi").GLib
local index_theme = require("menubar.index_theme")
@ -26,18 +26,18 @@ local get_pragmatic_base_directories = function()
local dirs = {}
local dir = GLib.build_filenamev({GLib.get_home_dir(), ".icons"})
if awful.util.dir_readable(dir) then
if awful_util.dir_readable(dir) then
table.insert(dirs, dir)
end
dir = GLib.build_filenamev({GLib.get_user_data_dir(), "icons"})
if awful.util.dir_readable(dir) then
if awful_util.dir_readable(dir) then
table.insert(dirs, dir)
end
for _, v in ipairs(GLib.get_system_data_dirs()) do
dir = GLib.build_filenamev({v, "icons"})
if awful.util.dir_readable(dir) then
if awful_util.dir_readable(dir) then
table.insert(dirs, dir)
end
end
@ -45,7 +45,7 @@ local get_pragmatic_base_directories = function()
local need_usr_share_pixmaps = true
for _, v in ipairs(GLib.get_system_data_dirs()) do
dir = GLib.build_filenamev({v, "pixmaps"})
if awful.util.dir_readable(dir) then
if awful_util.dir_readable(dir) then
table.insert(dirs, dir)
end
if dir == "/usr/share/pixmaps" then
@ -54,7 +54,7 @@ local get_pragmatic_base_directories = function()
end
dir = "/usr/share/pixmaps"
if need_usr_share_pixmaps and awful.util.dir_readable(dir) then
if need_usr_share_pixmaps and awful_util.dir_readable(dir) then
table.insert(dirs, dir)
end
@ -66,7 +66,7 @@ local get_default_icon_theme_name = function()
for _, dir in ipairs(get_pragmatic_base_directories()) do
for _, icon_theme_name in ipairs(icon_theme_names) do
local filename = string.format("%s/%s/index.theme", dir, icon_theme_name)
if awful.util.file_readable(filename) then
if awful_util.file_readable(filename) then
return icon_theme_name
end
end
@ -153,7 +153,7 @@ local lookup_icon = function(self, icon_name, icon_size)
local filename = string.format("%s/%s/%s/%s.%s",
basedir, self.icon_theme_name, subdir,
icon_name, ext)
if awful.util.file_readable(filename) then
if awful_util.file_readable(filename) then
return filename
else
checked_already[filename] = true
@ -174,7 +174,7 @@ local lookup_icon = function(self, icon_name, icon_size)
basedir, self.icon_theme_name, subdir,
icon_name, ext)
if not checked_already[filename] then
if awful.util.file_readable(filename) then
if awful_util.file_readable(filename) then
closest_filename = filename
minimal_size = dist
end
@ -210,7 +210,7 @@ local lookup_fallback_icon = function(self, icon_name)
local filename = string.format("%s/%s.%s",
dir,
icon_name, ext)
if awful.util.file_readable(filename) then
if awful_util.file_readable(filename) then
return filename
end
end

View File

@ -3,11 +3,6 @@
-- @copyright 2015 Uli Schlachter and Kazunobu Kuriyama
---------------------------------------------------------------------------
-- Hack so that beautiful can be loaded
_G.awesome = {
xrdb_get_value = function() end
}
local kb = require("awful.widget.keyboardlayout")
describe("awful.widget.keyboardlayout get_groups_from_group_names", function()

View File

@ -3,29 +3,6 @@
-- @copyright 2015 Kazunobu Kuriyama
---------------------------------------------------------------------------
-- Hack so that beautiful can be loaded
_G.awesome = {
xrdb_get_value = function() end,
connect_signal = function() end,
register_xproperty = function() end
}
-- Additional hacks to load menubar
_G.screen = {
add_signal = function() end,
count = function() return 0 end
}
_G.client = {
connect_signal = function() end,
add_signal = function() end
}
_G.tag = {
connect_signal = function() end,
add_signal = function() end
}
_G.root = {
cursor = function() end
}
local os = os
local string = string
local icon_theme = require("menubar.icon_theme")

View File

@ -3,15 +3,6 @@
-- @copyright 2015 Uli Schlachter
---------------------------------------------------------------------------
-- Grml...
_G.awesome = {
xrdb_get_value = function(a, b)
if a ~= "" then error() end
if b ~= "Xft.dpi" then error() end
return nil
end
}
local textbox = require("wibox.widget.textbox")
describe("wibox.widget.textbox", function()